1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| # chat - 开始 event: conversation.chat.created // 在 chat 事件里,data 字段中的 id 为 Chat ID,即会话 ID。 data: {"id": "123", "conversation_id":"123", "bot_id":"222", "created_at":1710348675,compleated_at:null, "last_error": null, "meta_data": {}, "status": "created","usage":null}
# chat - 处理中 event: conversation.chat.in_progress data: {"id": "123", "conversation_id":"123", "bot_id":"222", "created_at":1710348675, compleated_at: null, "last_error": null,"meta_data": {}, "status": "in_progress","usage":null}
# MESSAGE - 知识库召回 event: conversation.message.completed data: {"id": "msg_001", "role":"assistant","type":"knowledge","content":"---\nrecall slice 1:xxxxxxx\n","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - function_call event: conversation.message.completed data: {"id": "msg_002", "role":"assistant","type":"function_call","content":"{\"name\":\"toutiaosousuo-search\",\"arguments\":{\"cursor\":0,\"input_query\":\"今天的体育新闻\",\"plugin_id\":7281192623887548473,\"api_id\":7288907006982012986,\"plugin_type\":1","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - toolOutput event: conversation.message.completed data: {"id": "msg_003", "role":"assistant","type":"tool_output","content":"........","content_type":"card","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - answer is card event: conversation.message.completed data: {"id": "msg_004", "role":"assistant","type":"answer","content":"{{card_json}}","content_type":"card","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - answer is normal text event: conversation.message.delta data:{"id": "msg_005", "role":"assistant","type":"answer","content":"以下","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
event: conversation.message.delta data:{"id": "msg_005", "role":"assistant","type":"answer","content":"是","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
...... {{ N 个 delta 消息包}} ......
event: conversation.message.completed data:{"id": "msg_005", "role":"assistant","type":"answer","content":"{{msg_005 完整的结果。即之前所有 msg_005 delta 内容拼接的结果}}","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - 多 answer 的情况,会继续有 message.delta event: conversation.message.delta data:{"id": "msg_006", "role":"assistant","type":"answer","content":"你好你好","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
...... {{ N 个 delta 消息包}} ......
event: conversation.message.completed data:{"id": "msg_006", "role":"assistant","type":"answer","content":"{{msg_006 完整的结果。即之前所有 msg_006 delta 内容拼接的结果}}","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - Verbose (流式 plugin, 多 answer 结束,Multi-agent 跳转等场景) event: conversation.message.completed data:{"id": "msg_007", "role":"assistant","type":"verbose","content":"{\"msg_type\":\"generate_answer_finish\",\"data\":\"\"}","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# MESSAGE - suggestion event: conversation.message.completed data: {"id": "msg_008", "role":"assistant","type":"follow_up","content":"朗尼克的报价是否会成功?","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"} event: conversation.message.completed data: {"id": "msg_009", "role":"assistant","type":"follow_up","content":"中国足球能否出现?","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"} event: conversation.message.completed data: {"id": "msg_010", "role":"assistant","type":"follow_up","content":"羽毛球种子选手都有谁?","content_type":"text","chat_id": "123", "conversation_id":"123", "bot_id":"222"}
# chat - 完成 event: conversation.chat.completed (chat完成) data: {"id": "123", "chat_id": "123", "conversation_id":"123", "bot_id":"222", "created_at":1710348675, compleated_at:1710348675, "last_error":null, "meta_data": {}, "status": "compleated", "usage":{"token_count":3397,"output_tokens":1173,"input_tokens":2224}}
event: done (stream流结束) data: [DONE]
# chat - 失败 event: conversation.chat.failed data: { "code":701231, "msg":"error" }
|