Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -680,13 +680,21 @@ async def orchestrate_deep_research(openai_api_key: str, serpapi_api_key: str, i
|
|
| 680 |
return final_report, process_log, extra_context
|
| 681 |
|
| 682 |
def load_example(example_choice: str) -> str:
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 690 |
|
| 691 |
def run_deep_research(openai_api_key: str, serpapi_api_key: str, initial_query: str, reportstyle: str, breadth: int, depth: int,
|
| 692 |
followup_clarifications: str, include_domains: str, exclude_keywords: str, additional_clarifications: str,
|
|
|
|
| 680 |
return final_report, process_log, extra_context
|
| 681 |
|
| 682 |
def load_example(example_choice: str) -> str:
|
| 683 |
+
filename = ""
|
| 684 |
+
if example_choice == "Implications of the release of advanced Deep Research solutions":
|
| 685 |
+
filename = "example1.txt"
|
| 686 |
+
elif example_choice == "AI regulation in finance":
|
| 687 |
+
filename = "example2.txt"
|
| 688 |
+
elif example_choice == "AI top voices":
|
| 689 |
+
filename = "example3.txt"
|
| 690 |
+
try:
|
| 691 |
+
with open(filename, "r", encoding="utf-8") as f:
|
| 692 |
+
content = f.read()
|
| 693 |
+
logging.info(f"load_example: Loaded content from {filename}")
|
| 694 |
+
return content
|
| 695 |
+
except Exception as e:
|
| 696 |
+
logging.error(f"load_example: Error loading {filename}: {e}")
|
| 697 |
+
return ""
|
| 698 |
|
| 699 |
def run_deep_research(openai_api_key: str, serpapi_api_key: str, initial_query: str, reportstyle: str, breadth: int, depth: int,
|
| 700 |
followup_clarifications: str, include_domains: str, exclude_keywords: str, additional_clarifications: str,
|