Skip to content

feat: use reasoning field in StreamingChunk for Bedrock#2901

Merged
julian-risch merged 1 commit intodeepset-ai:mainfrom
Br1an67:fix/issue-10480-bedrock-reasoning-field
Mar 7, 2026
Merged

feat: use reasoning field in StreamingChunk for Bedrock#2901
julian-risch merged 1 commit intodeepset-ai:mainfrom
Br1an67:fix/issue-10480-bedrock-reasoning-field

Conversation

@Br1an67
Copy link
Copy Markdown
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
Copy Markdown

CLAassistant commented Mar 1, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you for your contribution @Br1an67 . I am sorry that it took a bit longer than usual to review your pull request.

@julian-risch julian-risch merged commit 7a9a4f5 into deepset-ai:main Mar 7, 2026
11 checks passed
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

3 participants