Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,7 +55,13 @@ class ResearchOrchestrator:
|
|
| 55 |
formatted_output = self.formatter.format_response(cited_analysis, search_results)
|
| 56 |
logging.info("Response formatted successfully")
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
except Exception as e:
|
| 61 |
error_msg = f"❌ An error occurred: {str(e)}"
|
|
@@ -144,4 +150,5 @@ with gr.Blocks(title="Research Assistant") as demo:
|
|
| 144 |
)
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
-
demo.launch()
|
|
|
|
|
|
| 55 |
formatted_output = self.formatter.format_response(cited_analysis, search_results)
|
| 56 |
logging.info("Response formatted successfully")
|
| 57 |
|
| 58 |
+
# Add completion notification
|
| 59 |
+
if len(search_results) >= 3:
|
| 60 |
+
completion_message = "\n\n---\n[ANALYSIS COMPLETE] ✅ Research finished with sufficient sources."
|
| 61 |
+
else:
|
| 62 |
+
completion_message = "\n\n---\n[RECOMMEND FURTHER ANALYSIS] ⚠️ Limited sources found. Consider refining your query."
|
| 63 |
+
|
| 64 |
+
yield formatted_output + completion_message
|
| 65 |
|
| 66 |
except Exception as e:
|
| 67 |
error_msg = f"❌ An error occurred: {str(e)}"
|
|
|
|
| 150 |
)
|
| 151 |
|
| 152 |
if __name__ == "__main__":
|
| 153 |
+
demo.launch()
|
| 154 |
+
|