Spaces:
Sleeping
Sleeping
Update chatbot_logic.py
Browse files- chatbot_logic.py +3 -2
chatbot_logic.py
CHANGED
|
@@ -38,8 +38,9 @@ def get_bot_response(query):
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
result = qa_chain.invoke({"query": query})
|
| 41 |
-
if not result:
|
| 42 |
return "🤖 Sorry, I couldn't find anything relevant in the meal plans."
|
| 43 |
-
return result
|
| 44 |
except Exception as e:
|
| 45 |
return f"❌ Failed to process your query: {e}"
|
|
|
|
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
result = qa_chain.invoke({"query": query})
|
| 41 |
+
if not result or not result.get("result"):
|
| 42 |
return "🤖 Sorry, I couldn't find anything relevant in the meal plans."
|
| 43 |
+
return result["result"]
|
| 44 |
except Exception as e:
|
| 45 |
return f"❌ Failed to process your query: {e}"
|
| 46 |
+
|