Skip to content

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Jun 19, 2025

  • Fix isEmpty() check in ConverseApiUtils to properly handle null partialJson
  • Add workaround for streaming tool calls with empty arguments by defaulting to {}
  • Add parameterized tests for multiple Bedrock models (Nova Pro and Claude Sonnet)
  • Update AWS SDK and Bedrock runtime versions to 2.31.65

Fixes #1878

- Fix isEmpty() check in ConverseApiUtils to properly handle null partialJson
- Add workaround for streaming tool calls with empty arguments by defaulting to {}
- Add parameterized tests for multiple Bedrock models (Nova Pro and Claude Sonnet)
- Update AWS SDK and Bedrock runtime versions to 2.31.65

Fixes spring-projects#1878

Signed-off-by: Christian Tzolov <[email protected]>
Signed-off-by: Christian Tzolov <[email protected]>
void squashIntoContentBlock() {
this.toolUseEntries.add(new ToolUseEntry(this.index, this.id, this.name, this.partialJson, this.usage));
// Workaround to handle streaming tool calling with no input arguments.
String json = StringUtils.hasText(this.partialJson) ? this.partialJson : "{}";
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should report this as a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. this appears to be an Anthropic Model's inconsistency b/w the call and stream json payload for parameterless tools.
The behavior is is consistent for all Anthropic models.

@markpollack markpollack self-assigned this Jun 19, 2025
@tzolov
Copy link
Contributor Author

tzolov commented Jun 20, 2025

merged at 8107612

@tzolov tzolov closed this Jun 20, 2025
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/Converse Chat Model Does not Properly Stream Tools When Using Suppliers vs Functions

2 participants