Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,9 @@ class BasicAgent:
|
|
| 26 |
state_dict = alfred.invoke({"messages": [HumanMessage(content = question)]})
|
| 27 |
response = state_dict["messages"][-1]
|
| 28 |
try:
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
except:
|
| 31 |
return "Sorry, I can't answer to this question."
|
| 32 |
|
|
|
|
| 26 |
state_dict = alfred.invoke({"messages": [HumanMessage(content = question)]})
|
| 27 |
response = state_dict["messages"][-1]
|
| 28 |
try:
|
| 29 |
+
response = response.content
|
| 30 |
+
response = response.split("Final answer:")[1].strip()
|
| 31 |
+
return response
|
| 32 |
except:
|
| 33 |
return "Sorry, I can't answer to this question."
|
| 34 |
|