Spaces:
Sleeping
Sleeping
Update Manyata_UI.py
Browse files- Manyata_UI.py +7 -7
Manyata_UI.py
CHANGED
|
@@ -37,15 +37,15 @@ def pull_messages_from_step(
|
|
| 37 |
yield gr.ChatMessage(role="assistant", content=f"**{step_number}**")
|
| 38 |
|
| 39 |
# First yield the thought/reasoning from the LLM
|
| 40 |
-
|
| 41 |
# Clean up the LLM output
|
| 42 |
-
|
| 43 |
# Remove any trailing <end_code> and extra backticks, handling multiple possible formats
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
# For tool calls, create a parent message
|
| 51 |
if hasattr(step_log, "tool_calls") and step_log.tool_calls is not None:
|
|
|
|
| 37 |
yield gr.ChatMessage(role="assistant", content=f"**{step_number}**")
|
| 38 |
|
| 39 |
# First yield the thought/reasoning from the LLM
|
| 40 |
+
# if hasattr(step_log, "model_output") and step_log.model_output is not None:
|
| 41 |
# Clean up the LLM output
|
| 42 |
+
# model_output = step_log.model_output.strip()
|
| 43 |
# Remove any trailing <end_code> and extra backticks, handling multiple possible formats
|
| 44 |
+
# model_output = re.sub(r"```\s*<end_code>", "```", model_output) # handles ```<end_code>
|
| 45 |
+
# model_output = re.sub(r"<end_code>\s*```", "```", model_output) # handles <end_code>```
|
| 46 |
+
# model_output = re.sub(r"```\s*\n\s*<end_code>", "```", model_output) # handles ```\n<end_code>
|
| 47 |
+
# model_output = model_output.strip()
|
| 48 |
+
# yield gr.ChatMessage(role="assistant", content=model_output)
|
| 49 |
|
| 50 |
# For tool calls, create a parent message
|
| 51 |
if hasattr(step_log, "tool_calls") and step_log.tool_calls is not None:
|