Commit Graph

2 Commits

Author SHA1 Message Date
Dmitry Ng 649d2f5b67 fix: normalize multiple tool calls in Bedrock Converse API
- Refactored message normalization in convertMessages to properly handle all variants of multi-tool-call scenarios
- Introduced aiMessageAccumulator to consolidate consecutive AI messages with text, reasoning, and multiple tool calls into a single assistant message
- Introduced toolResultAccumulator to consolidate consecutive tool result messages into a single user message
- Fixed ValidationException when users structure message chains differently (6 possible variants now supported)
- Added comprehensive test TestConverseAPIMultipleToolCallsVariants covering all 6 user-facing message chain patterns
- Added unit tests for message accumulators and conversion logic to ensure robustness
- Updated existing test recordings to reflect normalized message structure

This ensures the Bedrock Converse API receives properly formatted messages regardless of how users structure their multi-turn conversations with tool calls.
2026-03-15 17:10:04 +03:00
Dmitry Ng 1c3dd0fca4 feat: update AWS SDK dependencies and enhance caching support
- Upgraded various AWS SDK dependencies in go.mod and go.sum files to their latest versions, improving compatibility and performance.
- Introduced automatic caching support for specific Anthropic models, optimizing token usage and reducing costs.
- Refactored message processing to include caching logic, ensuring seamless integration with existing functionalities.
- Removed deprecated models from tests and updated test cases to validate new caching features and model support.
2026-03-04 01:08:38 +03:00