LLM-Red-Team / spark-free-api

🚀 讯飞星火大模型逆向API白嫖测试【特长:办公助手】,支持高速流式输出、智能体对话、联网搜索、AI绘图、长文档解读、图像解析、多轮对话,零配置部署,多路token支持,自动清理会话痕迹。
https://udify.app/chat/xsLvQf9U0QJRIkmN
GNU General Public License v3.0
104 stars 37 forks source link

补全对话返回的数据格式有问题 #10

Closed Li1Fan closed 3 months ago

Li1Fan commented 3 months ago

返回的内容如下: { "id": "384881606:cht000b3dff@dx1900a112429b81d560", "model": "spark", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "allTool\n{\"payload\":{\"plugins\":{\"text\":[{\"deskToolName\":\"天气查询\",\"role\":\"assistant\",\"content_type\":\"text\",\"name\":\"weather.basic_weather\",\"invoked\":{\"plugin_id\":\"weather\",\"status_code\":200,\"plugin_ver\":\"\",\"namespace\":\"weather\",\"status_msg\":\"Success\",\"type\":\"local\"},\"status\":\"finished\"}]}},\"header\":{\"code\":0,\"message\":\"Success\",\"sid\":\"cht000b3dff@dx1900a112429b81d560\",\"status\":0}}\n\nallTool\n{\"payload\":{\"plugins\":{\"text\":[{\"deskToolName\":\"天气查询\",\"role\":\"tool\",\"content_type\":\"text\",\"name\":\"weather.basic_weather\",\"content_meta\":{},\"invoked\":{\"plugin_id\":\"weather\",\"status_code\":200,\"plugin_ver\":\"\",\"namespace\":\"weather\",\"status_msg\":\"Success\",\"type\":\"local\"},\"status\":\"finished\"}]}},\"header\":{\"code\":0,\"message\":\"Success\",\"sid\":\"cht000b3dff@dx1900a112429b81d560\",\"status\":1}}\n\n福州未来七天的天气状况多为阴和小雨,温度范围在25℃~33℃,风向变化较大,风力保持在微风。建议市民出门时携带雨具,同时注意防暑降温,避免高温时段户外活动。\n\n具体天气情况如下:\n- 2024-06-12(今天):阴,25℃ ~ 33℃,西北风微风。\n- 2024-06-13(明天):大雨转小雨,25℃ ~ 30℃,东风转东北风微风。\n- 2024-06-14(后天):小雨转阴,26℃ ~ 31℃,南风微风。\n- 2024-06-15(周六):小雨转阴,26℃ ~ 32℃,北风微风。\n- 2024-06-16(周日):小雨转阴,26℃ ~ 33℃,北风微风。\n- 2024-06-17(下周一):小雨转阴,26℃ ~ 32℃,北风微风。\n- 2024-06-18(下周二):小雨转阴,26℃ ~ 32℃,北风微风。" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1, "completion_tokens": 1, "total_tokens": 2 }, "created": 1718155814 }

Vinlic commented 3 months ago

格式没有问题,检查你的传参,流式和非流式获得的数据格式是不一样的,讯飞新增了tool调用消息,最近会去除

Vinlic commented 3 months ago

请更新到0.0.10版本,已处理出现allTool代码块问题。