mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-07-18 10:45:37 -04:00
649d2f5b67
- 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.