You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chatcmpl): preserve text content when adding Anthropic thinking blocks to tool calls
In the case of Anthropic Claude with extended thinking, this ensures that existing text content is properly converted to content array format before appending thinking blocks, preventing overwriting of original assistant message content.
This happens in a rare case where there is a (output text, thinking block, tool call) all in one response. Error message is like below:
```
"litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: messages.1.content.49: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.\"}"
```
The error is misleading because the actual reason is because we didn't provide the text content along side the thinking blocks.
0 commit comments