mou3az commited on
Commit
60711cf
1 Parent(s): 2a17ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -229,15 +229,15 @@ def Web_Search(history):
229
  source_knowledge = ""
230
 
231
  augmented_prompt = f"""
232
- If the answer to the next query is not contained in the Search, say 'No Answer Is Available' and then just give guidance for the query.
233
  Query: {message}
234
- Search:
235
  {source_knowledge}
236
  """
237
 
238
  msg=HumanMessage(content=augmented_prompt)
239
  messages.append(msg)
240
- response = chat_model.invoke(msg)
241
  messages.append(AIMessage(content=response.content))
242
 
243
  if len(messages) >= 8:
@@ -313,7 +313,7 @@ def Link_Scratch(history):
313
  response_message = "The provided link is empty or does not contain any meaningful words."
314
  else:
315
  augmented_prompt = f"""
316
- If the answer to the next query is not contained in the Link Content, say 'No Answer Is Available' and then just give guidance for the query.
317
  Query: {user_message}
318
  Link Content:
319
  {content_data}
@@ -372,7 +372,7 @@ def File_Interact(history,filepath):
372
  response_message = "The file is empty or does not contain any meaningful words."
373
  else:
374
  augmented_prompt = f"""
375
- If the answer to the next query is not contained in the File Content, say 'No Answer Is Available' and then just give guidance for the query.
376
  Query: {user_message}
377
  File Content:
378
  {content_data}
 
229
  source_knowledge = ""
230
 
231
  augmented_prompt = f"""
232
+ If you can't answer the next Query using the Search Content, say 'No Answer Is Available' and then just give guidance for the query.
233
  Query: {message}
234
+ Search Content:
235
  {source_knowledge}
236
  """
237
 
238
  msg=HumanMessage(content=augmented_prompt)
239
  messages.append(msg)
240
+ response = chat_model.invoke(messages)
241
  messages.append(AIMessage(content=response.content))
242
 
243
  if len(messages) >= 8:
 
313
  response_message = "The provided link is empty or does not contain any meaningful words."
314
  else:
315
  augmented_prompt = f"""
316
+ If you can't answer the next Query using the Link Content, say 'No Answer Is Available' and then just give guidance for the query.
317
  Query: {user_message}
318
  Link Content:
319
  {content_data}
 
372
  response_message = "The file is empty or does not contain any meaningful words."
373
  else:
374
  augmented_prompt = f"""
375
+ If you can't answer the next Query using the File Content, say 'No Answer Is Available' and then just give guidance for the query.
376
  Query: {user_message}
377
  File Content:
378
  {content_data}