Shreyas094 commited on
Commit
cb68263
·
verified ·
1 Parent(s): 3e9d376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -461,15 +461,10 @@ After writing the document, please provide a list of sources used in your respon
461
  yield "I apologize, but I couldn't generate a response at this time. Please try again later."
462
 
463
  def get_response_with_search(query, model, num_calls=3, temperature=0.2):
464
- try:
465
- database, temp_dir, search_results = duckduckgo_search(query)
466
- context = retrieve_web_search_results(database, query)
467
-
468
- if context == "No relevant information found.":
469
- yield "I'm sorry, but I couldn't find any relevant information for your query. Could you please rephrase or ask a different question?", ""
470
- return
471
-
472
- prompt = f"""Using the following context from web search results:
473
  {context}
474
  Write a detailed and complete research document that fulfills the following user request: '{query}'
475
  After writing the document, please provide a list of sources used in your response."""
 
461
  yield "I apologize, but I couldn't generate a response at this time. Please try again later."
462
 
463
  def get_response_with_search(query, model, num_calls=3, temperature=0.2):
464
+ database, temp_dir, search_results = duckduckgo_search(query)
465
+ context = retrieve_web_search_results(database, query)
466
+
467
+ prompt = f"""Using the following context from web search results:
 
 
 
 
 
468
  {context}
469
  Write a detailed and complete research document that fulfills the following user request: '{query}'
470
  After writing the document, please provide a list of sources used in your response."""