开发者社区 > 百炼大模型 > 正文

阿里云百炼Assistant API中Function tools被处罚第二次报上面的错误,怎么办?

阿里云百炼Assistant API中Function tools被处罚第二次报上面的错误,怎么处理?"statusCode": 400,
"message": "An assistant message with \"tool_calls\" must be followed by tool messages responding to each \"tool_call_id\". The following tool_call_ids did not have response messages: message[5].role",
"code": "SDKGenerationError",
"isJson": true,

展开
收起
三分钟热度的鱼 2024-07-31 22:19:01 78 0
1 条回答
写回答
取消 提交回答
  • 根据错误信息这似乎是因为在调用阿里云百炼Assistant API的Function tools时,您发送了一个包含tool_calls的助手消息,但缺少了响应每个tool_call_id的工具消息。要解决这个问题,您需要确保在发送包含tool_calls的message后,紧接着提供对应tool_call_id的工具响应消息。请检查您的API调用序列,确保每个tool_call都有相应的tool_response。

    2024-08-02 14:52:12
    赞同 9 展开评论 打赏

基于通义系列大模型和开源大模型的一站式大模型服务平台,提供「生成式大模型的全流程应用工具」和「企业大模型的全链路训练工具」。为大模型,也为小应用。

相关电子书

更多
Spring Boot2.0实战Redis分布式缓存 立即下载
CUDA MATH API 立即下载
API PLAYBOOK 立即下载