Spaces:
Sleeping
Sleeping
Alexandre Gazola
commited on
Commit
·
7ca052e
1
Parent(s):
43fc159
fix
Browse files
app.py
CHANGED
|
@@ -55,9 +55,13 @@ class LangChainAgent:
|
|
| 55 |
"input": question,
|
| 56 |
"chat_history": []
|
| 57 |
})
|
| 58 |
-
|
| 59 |
-
print(f"Agent response: {
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 63 |
"""
|
|
|
|
| 55 |
"input": question,
|
| 56 |
"chat_history": []
|
| 57 |
})
|
| 58 |
+
output = result.get("output", "No answer returned.")
|
| 59 |
+
print(f"Agent response: {output}")
|
| 60 |
+
match = re.search(r"FINAL ANSWER:\s*(.*)", response['output'])
|
| 61 |
+
if match:
|
| 62 |
+
return match.group(1).strip()
|
| 63 |
+
else:
|
| 64 |
+
return output
|
| 65 |
|
| 66 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 67 |
"""
|