Update app.py
Browse files
app.py
CHANGED
|
@@ -264,7 +264,7 @@ if st.session_state.chat_history and st.session_state.chat_history[-1][0] == "us
|
|
| 264 |
|
| 265 |
if isinstance(message, tuple):
|
| 266 |
# This is a tool-related message.
|
| 267 |
-
#
|
| 268 |
role, text = message
|
| 269 |
if "call_" in text.lower():
|
| 270 |
tool_calls_text += text + "\n\n"
|
|
@@ -294,3 +294,4 @@ if st.session_state.chat_history and st.session_state.chat_history[-1][0] == "us
|
|
| 294 |
f"**Final Answer:**\n\n{final_answer_text}"
|
| 295 |
)
|
| 296 |
st.session_state.chat_history.append(("assistant", combined_response))
|
|
|
|
|
|
| 264 |
|
| 265 |
if isinstance(message, tuple):
|
| 266 |
# This is a tool-related message.
|
| 267 |
+
# We use a simple heuristic: if the text contains "call_" (case-insensitive), we treat it as a tool call.
|
| 268 |
role, text = message
|
| 269 |
if "call_" in text.lower():
|
| 270 |
tool_calls_text += text + "\n\n"
|
|
|
|
| 294 |
f"**Final Answer:**\n\n{final_answer_text}"
|
| 295 |
)
|
| 296 |
st.session_state.chat_history.append(("assistant", combined_response))
|
| 297 |
+
|