Shreyas094 commited on
Commit
24fd82d
·
verified ·
1 Parent(s): 4e7e055

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -444,7 +444,7 @@ def rank_results(query, results):
444
  result['combined_score'] = (date_score + relevance_scores[i]) / 2
445
 
446
  # Sort by combined score and return top 3
447
- return sorted(results, key=lambda x: x['combined_score'], reverse=True)[:3]
448
 
449
  def create_web_search_vectors(search_results):
450
  embed = get_embeddings()
@@ -479,7 +479,7 @@ def get_response_with_search(query, model, num_calls=3, temperature=0.2):
479
  prompt = f"""Using the following context from a web search result:
480
  {context}
481
  This information is from {date}.
482
- You are an expert AI assistant. Write a detailed and complete research document that fulfills the following user request: '{query}'
483
  Base your summary strictly on the information from this source. Only include information that is directly supported by the given content.
484
  If any part of the information cannot be verified from this source, clearly state that it could not be confirmed."""
485
 
 
444
  result['combined_score'] = (date_score + relevance_scores[i]) / 2
445
 
446
  # Sort by combined score and return top 3
447
+ return sorted(results, key=lambda x: x['combined_score'], reverse=True)[:1]
448
 
449
  def create_web_search_vectors(search_results):
450
  embed = get_embeddings()
 
479
  prompt = f"""Using the following context from a web search result:
480
  {context}
481
  This information is from {date}.
482
+ You are an expert AI assistant. Write a detailed and complete research article that fulfills the following user request: '{query}'
483
  Base your summary strictly on the information from this source. Only include information that is directly supported by the given content.
484
  If any part of the information cannot be verified from this source, clearly state that it could not be confirmed."""
485