调用模型 tool call 报错InternalError.Algo.InvalidParameter

[API Error: generate data error: HTTP error! status: 400, body: {“error”:{“message”:“<400> InternalError.Algo.InvalidParameter: messages with role “tool” must be a response to a preceeding
message with “tool_calls”. (request id: 2026031314522183505380573766800)”,“type”:“upstream_error”,“param”:“400”,“code”:“bad_response_status_code”}} TraceID:
00-89b5273aa8effd3f837f69449cb11b6e-e0a3519b3ce0cf91-01]

使用iflow的auth第三种方案,采用转发的阿里云的glm-4.6,执行就会报这个错。求解答

阿里云的glm - 4.6 和此处的 tool call 看上去不兼容呀 :sweat_smile:
就像美团的Longcat连正常对话都难
进猜测哈;
因为你这里tool call 后 不能通过客户端返回Tool欸

忘了哪里看的,帖子找不到了,好像说第三方平台的模型不知道 iflow 的 tool 的调用方式?需要先列出所有 tool,才能正确调用? :thinking: 这个不清楚真假,不过可以试试

不过 iflow 最好还是方式 1 或 2 登录,使用第一方适配的模型,第三方测试体验一下还行,主力的话还是最好不要吧,毕竟所谓的 openai 兼容格式,其实各家有各家的想法,只是大体上兼容 :joy:

感觉可以预先写进提示词文档里面

找到问题了,是转发项目one-api的问题。采用开源项目new-api就解决了。和iflow没有关系。谢谢各位回复