Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -83,12 +83,13 @@ def respond_in_assistant_thread(
|
|
83 |
# messages_in_thread.append({"role": role, "content": message["text"]})
|
84 |
|
85 |
# Pass the latest prompt and chat history to the LLM (call_llm is your own code)
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
92 |
|
93 |
except Exception as e:
|
94 |
logger.exception(f"Failed to respond to an inquiry: {e}")
|
|
|
83 |
# messages_in_thread.append({"role": role, "content": message["text"]})
|
84 |
|
85 |
# Pass the latest prompt and chat history to the LLM (call_llm is your own code)
|
86 |
+
agent_gen = agent.run(task=query, stream=True)
|
87 |
|
88 |
+
for val in agent_gen:
|
89 |
+
if 'final_answer' in val:
|
90 |
+
say(val['final_answer'])
|
91 |
+
elif 'rationale' in val:
|
92 |
+
say(f"Rationale: {val['rationale']}")
|
93 |
|
94 |
except Exception as e:
|
95 |
logger.exception(f"Failed to respond to an inquiry: {e}")
|