Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2295,7 +2295,9 @@ def generate_query_tree(context: str, breadth: int, depth: int, selected_engines
|
|
| 2295 |
prompt = f"""
|
| 2296 |
|
| 2297 |
Generate a list of {breadth} search queries relevant to the following context:
|
|
|
|
| 2298 |
"{context}"
|
|
|
|
| 2299 |
// Requirements
|
| 2300 |
- The queries should be suitable for a search engine.
|
| 2301 |
- Each query should combine terms using logical operators (AND, OR) where appropriate.
|
|
@@ -2315,9 +2317,8 @@ def generate_query_tree(context: str, breadth: int, depth: int, selected_engines
|
|
| 2315 |
Do not include any extra text, markdown formatting, or commentary. Output the JSON starting from "{{" and ending with "}}".
|
| 2316 |
Now generate the result.
|
| 2317 |
"""
|
| 2318 |
-
|
| 2319 |
-
|
| 2320 |
-
llm_response = openai_call(prompt=prompt, messages=messages, temperature=0, max_tokens_param=150)
|
| 2321 |
logging.info(f"Generated query tree: {llm_response}")
|
| 2322 |
|
| 2323 |
cleaned_response = llm_response.strip().strip("`").strip()
|
|
@@ -2884,7 +2885,7 @@ def iterative_deep_research_gen(initial_query: str, reportstyle: str, breadth: i
|
|
| 2884 |
if followup_suggestions:
|
| 2885 |
# Deduplicate follow-up suggestions before adding them to context.
|
| 2886 |
unique_suggestions = list(set(followup_suggestions))
|
| 2887 |
-
combined_context += "\nFollow-up suggestions: " + ", ".join(unique_suggestions)
|
| 2888 |
queries = generate_serp_queries(combined_context, breadth, depth, initial_query, selected_engines, results_per_query)
|
| 2889 |
|
| 2890 |
# ===================================================================
|
|
|
|
| 2295 |
prompt = f"""
|
| 2296 |
|
| 2297 |
Generate a list of {breadth} search queries relevant to the following context:
|
| 2298 |
+
|
| 2299 |
"{context}"
|
| 2300 |
+
|
| 2301 |
// Requirements
|
| 2302 |
- The queries should be suitable for a search engine.
|
| 2303 |
- Each query should combine terms using logical operators (AND, OR) where appropriate.
|
|
|
|
| 2317 |
Do not include any extra text, markdown formatting, or commentary. Output the JSON starting from "{{" and ending with "}}".
|
| 2318 |
Now generate the result.
|
| 2319 |
"""
|
| 2320 |
+
messages = []
|
| 2321 |
+
llm_response = openai_call(prompt=prompt, messages=messages, model="o3-mini", temperature=0, max_tokens_param=150)
|
|
|
|
| 2322 |
logging.info(f"Generated query tree: {llm_response}")
|
| 2323 |
|
| 2324 |
cleaned_response = llm_response.strip().strip("`").strip()
|
|
|
|
| 2885 |
if followup_suggestions:
|
| 2886 |
# Deduplicate follow-up suggestions before adding them to context.
|
| 2887 |
unique_suggestions = list(set(followup_suggestions))
|
| 2888 |
+
combined_context += "\n\nFollow-up suggestions: " + ", ".join(unique_suggestions)
|
| 2889 |
queries = generate_serp_queries(combined_context, breadth, depth, initial_query, selected_engines, results_per_query)
|
| 2890 |
|
| 2891 |
# ===================================================================
|