Assistant消息只有 tool_calls 时,content 被设为空字符串导致 API 报错

错误信息:messages: text content blocks must be non-empty

问题:当 Claude 只返回 tool_use 而没有文本内容时,Alma 把 assistant 消息的 content 设置成了空字符串 "",导致 Anthropic API 拒绝请求。

问题消息结构: { "role": "assistant", "content": "", ← 应该省略或设为 null "tool_calls": [...] }

具体request body已经上传,使用的一个第三方的claude model。这个bug偶尔出现,偶尔没有。

alma_empty_content_request.json

9.1 KB Text

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
💡

Feature Request

Date

2 months ago

Author

Travis Cao

Subscribe to post

Get notified by email when there are changes.