Shreyas094 commited on
Commit
5f389bb
·
verified ·
1 Parent(s): 2ded2ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -42,7 +42,7 @@ def duckduckgo_search(query):
42
  async def rephrase_query(query, context, model):
43
  # Log the original query for debugging
44
  logging.info(f"Original query: {query}")
45
-
46
  prompt = f"""You are a highly intelligent conversational chatbot. Your task is to analyze the given context and new query, then decide whether to rephrase the query with or without incorporating the context. Follow these steps:
47
  1. Determine if the new query is a continuation of the previous conversation or an entirely new topic.
48
  2. If it's a continuation, rephrase the query by incorporating relevant information from the context to make it more specific and contextual.
@@ -65,7 +65,7 @@ async def rephrase_query(query, context, model):
65
  temperature=0.2,
66
  )
67
 
68
- # The response should be the rephrased query as per your prompt
69
  rephrased_query = response.strip()
70
 
71
  # Log the rephrased query
 
42
  async def rephrase_query(query, context, model):
43
  # Log the original query for debugging
44
  logging.info(f"Original query: {query}")
45
+
46
  prompt = f"""You are a highly intelligent conversational chatbot. Your task is to analyze the given context and new query, then decide whether to rephrase the query with or without incorporating the context. Follow these steps:
47
  1. Determine if the new query is a continuation of the previous conversation or an entirely new topic.
48
  2. If it's a continuation, rephrase the query by incorporating relevant information from the context to make it more specific and contextual.
 
65
  temperature=0.2,
66
  )
67
 
68
+ # Extract the rephrased query
69
  rephrased_query = response.strip()
70
 
71
  # Log the rephrased query