Browse Source

fix:解决Agent_callback_handler报错,解决流式输出问题

main
guojialiang 1 year ago
parent
commit
52ad372672
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/mindpilot/app/chat/chat.py

+ 7
- 7
src/mindpilot/app/chat/chat.py View File

@@ -164,13 +164,13 @@ async def chat(
data["message_type"] = message_type
except:
...
elif data["status"] == AgentStatus.agent_finish:
try:
tool_output = json.loads(data["text"])
if message_type := tool_output.get("message_type"):
data["message_type"] = message_type
except:
...
# elif data["status"] == AgentStatus.agent_finish:
# try:
# tool_output = json.loads(data["text"])
# if message_type := tool_output.get("message_type"):
# data["message_type"] = message_type
# except:
# ...

ret = OpenAIChatOutput(
id=f"chat{uuid.uuid4()}",


Loading…
Cancel
Save