Skip to content

feat: use reasoning field in StreamingChunk for Bedrock#2901

Open
Br1an67 wants to merge 1 commit intodeepset-ai:mainfrom
Br1an67:fix/issue-10480-bedrock-reasoning-field
Open

feat: use reasoning field in StreamingChunk for Bedrock#2901
Br1an67 wants to merge 1 commit intodeepset-ai:mainfrom
Br1an67:fix/issue-10480-bedrock-reasoning-field

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 1, 2026

Related Issues

Proposed Changes:

Populate StreamingChunk.reasoning with ReasoningContent instead of storing reasoning content deltas in meta["reasoning_contents"]. This aligns the Bedrock integration with the standard StreamingChunk.reasoning field, consistent with other integrations (Ollama in #2850, Google GenAI in #2900).

Changes:

  • _process_streaming_event(): Create ReasoningContent with reasoning text and Bedrock-specific block data in extra, pass via reasoning kwarg instead of meta["reasoning_contents"]
  • _process_reasoning_contents(): Read from chunk.reasoning.extra["reasoning_contents"] instead of chunk.meta["reasoning_contents"]

How did you test it?

  • All 23 existing unit tests pass
  • Added assertion in test_process_streaming_response_one_tool_call_with_thinking verifying streaming chunks carry reasoning in chunk.reasoning and not in chunk.meta

Notes for the reviewer

The extra field on ReasoningContent preserves the Bedrock-specific structure (block indices, signatures, redacted content) needed for round-tripping with the Bedrock API.

Checklist

Populate StreamingChunk.reasoning with ReasoningContent instead of
storing reasoning content deltas in meta["reasoning_contents"].
Update _process_reasoning_contents to read from chunk.reasoning.extra
instead of chunk.meta.
@Br1an67 Br1an67 requested a review from a team as a code owner March 1, 2026 17:12
@Br1an67 Br1an67 requested review from julian-risch and removed request for a team March 1, 2026 17:12
@CLAassistant
Copy link

CLAassistant commented Mar 1, 2026

CLA assistant check
All committers have signed the CLA.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock - use reasoning field in StreamingChunk

2 participants