Guiyom commited on
Commit
4c364e9
·
verified ·
1 Parent(s): 1a68fb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
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
- # Example simple implementation: return a placeholder text or content from a file.
684
- examples = {
685
- "Implications of the release of advanced Deep Research solutions": "Example content 1...",
686
- "AI regulation in finance": "Example content 2...",
687
- "AI top voices": "Example content 3..."
688
- }
689
- return examples.get(example_choice, "Example not found.")
 
 
 
 
 
 
 
 
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,