Skip to content

Conversation

@jdaigle
Copy link
Contributor

@jdaigle jdaigle commented Oct 24, 2025

Description

  1. The RedactedContent property of TextReasoningContent is optional and not required for Claude 4 models. Don't throw new it's not found in AdditionalProperties.
  2. Use ProtectedData for the "Signature" of the reasoning content so that it round trips. See: Add TextReasoningContent.ProtectedData dotnet/extensions#6784. Requires a bump in dependency patch version.
  3. In GetStreamingResponseAsync, the final ReasoningContentBlockDelta may not have text, but it will have Signature and possibly RedactedContent

Motivation and Context

These fix a scenario where thinking + tool use fails because the reasoning content sent back with the tool response is invalid.

Testing

Manual testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

1. The `RedactedContent` property of `TextReasoningContent` is optional and not required for Claude 4 models. Don't throw new it's not found in `AdditionalProperties`.
2. Use `ProtectedData` for the "Signature" of the reasoning content so that it round trips. See: dotnet/extensions#6784
3. In `GetStreamingResponseAsync`, the final `ReasoningContentBlockDelta` may not have text, but it will have `Signature` and possibly `RedactedContent`

These fix a scenario where thinking + tool use fails because the reasoning content sent back with the tool response is invalid.
@jdaigle jdaigle force-pushed the BedrockChatClient-ReasoningContent-Fixes branch from 3d9b7c8 to e44196c Compare October 24, 2025 20:53
@jdaigle jdaigle changed the base branch from main to development October 24, 2025 20:54
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