Skip to content

fix(aws): ignore reasoning content blocks in aws_bedrock_chat - #1190

Open
pcbeingused333 wants to merge 1 commit into
warpstreamlabs:mainfrom
pcbeingused333:fix/bedrock-chat-reasoning
Open

pcbeingused333 wants to merge 1 commit into
warpstreamlabs:mainfrom
pcbeingused333:fix/bedrock-chat-reasoning

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

aws_bedrock_chat fails with unexpected number of response content: 2 when the model returns reasoning alongside its answer.

The Converse API returns that reasoning as a separate reasoningContent block next to the text block, while the processor requires exactly one content block.

This drops reasoningContent blocks before the existing check, so the text block becomes the output. Other cases behave as before: several text blocks, or an unsupported block type, still return an error.

A test feeds a response with a reasoningContent block followed by a text block through a mock server. It fails on main with the error above and passes with this change. It was not run against the live Bedrock service.

This change was prepared with AI assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant