Closed Li1Fan closed 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 }
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
allTool\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
格式没有问题,检查你的传参,流式和非流式获得的数据格式是不一样的,讯飞新增了tool调用消息,最近会去除
请更新到0.0.10版本,已处理出现allTool代码块问题。
返回的内容如下: { "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 }