Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -107,14 +107,14 @@ async def generate_report(query: QueryModel):
|
|
107 |
urls, optimized_search_query = search_brave(search_query, num_results=8)
|
108 |
all_text_with_urls = fetch_and_extract_content(data_format, urls, query_str)
|
109 |
reference = limit_tokens(str(all_text_with_urls))
|
110 |
-
user_prompt_final = user_prompt_final.format(description,reference)
|
111 |
except Exception as e:
|
112 |
print(e)
|
113 |
query.internet = False
|
114 |
print("failed to search/scrape results, falling back to LLM response")
|
115 |
|
116 |
if not query.internet:
|
117 |
-
user_prompt_final = prompt_user["offline"][query.output_format].format(description)
|
118 |
system_prompt_final = prompt_system["offline"]
|
119 |
|
120 |
md_report = together_response(user_prompt_final, model=llm_default_medium, SysPrompt=system_prompt_final)
|
|
|
107 |
urls, optimized_search_query = search_brave(search_query, num_results=8)
|
108 |
all_text_with_urls = fetch_and_extract_content(data_format, urls, query_str)
|
109 |
reference = limit_tokens(str(all_text_with_urls))
|
110 |
+
user_prompt_final = user_prompt_final.format(description=description, reference=reference)
|
111 |
except Exception as e:
|
112 |
print(e)
|
113 |
query.internet = False
|
114 |
print("failed to search/scrape results, falling back to LLM response")
|
115 |
|
116 |
if not query.internet:
|
117 |
+
user_prompt_final = prompt_user["offline"][query.output_format].format(description=description)
|
118 |
system_prompt_final = prompt_system["offline"]
|
119 |
|
120 |
md_report = together_response(user_prompt_final, model=llm_default_medium, SysPrompt=system_prompt_final)
|