Update app.py
Browse files
app.py
CHANGED
@@ -229,15 +229,15 @@ def Web_Search(history):
|
|
229 |
source_knowledge = ""
|
230 |
|
231 |
augmented_prompt = f"""
|
232 |
-
If
|
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(
|
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
|
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
|
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}
|