Commit a805656
Bedrock streaming minimal (#496)
* feat: implement message initialization for bedrock chat
* fix: AWS Bedrock streaming tool calls - minimal implementation
Addresses the core AWS SDK document marshaler/unmarshaler limitation
identified in streaming mode where AsFunctionCalls() returns empty arguments.
Essential changes only:
- Add args field to bedrockToolPart for pre-parsed streaming arguments
- Update AsFunctionCalls() with fallback logic (streaming -> unmarshaling)
- Add tool state tracking and JSON parsing in ContentBlockStop handler
- Extend streaming response structures to pass parsed arguments
- Update conversation history to include completed tools
Fixes: Empty tool arguments in streaming mode due to AWS SDK internal types
Root cause: Cannot create documentUnmarshaler instances for streaming case
* revert: remove unnecessary Initialize() implementation
Revert the full Initialize() implementation back to original stub
to keep only essential streaming tool call fixes.
Changes:
- Revert Initialize() from full implementation to error stub
- Remove unnecessary message conversion logic
- Keep only core streaming tool call fixes (6 essential changes)
This maintains the minimal fix approach focused solely on the
AWS SDK document marshaler/unmarshaler limitation.
* feat: complete AWS Bedrock streaming implementation with tool calls
- Implement proper Initialize() method for conversation history
- Add addContentsToHistory() for better content processing
- Refactor Send() and SendStreaming() to use shared content processing
- Fix tool use block creation with proper Input document
- Add support for FunctionCallResult in conversation history
* docs: update AWS Bedrock benchmark results to show perfect scores
Both Claude 3.7 Sonnet and Claude Sonnet 4 achieved 10/10 (100%) success rate on standardized Kubernetes benchmark tasks, demonstrating excellent performance with native tool calling implementation.
* fix: resolve tool error handling infinite retry loops
- Fix README.md benchmark table ordering (gemini first, remove bold)
- Implement dynamic status detection in Bedrock integration
- Check Result.error and Result.status fields for failure indicators
- Set ToolResultStatusError when errors detected
- Fix MCP client to return structured error data instead of Go errors
- Preserve error content in JSON format for proper LLM processing
- Prevents conversion of business logic failures to execution errors
This resolves the issue where all tool results were hardcoded as success,
causing LLMs to retry failed operations indefinitely until max iterations.
---------
Co-authored-by: Shreyas Mocherla <shreyas.mocherla@nirmata.com>1 parent 668a758 commit a805656
3 files changed
Lines changed: 247 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | 449 | | |
451 | | - | |
| 450 | + | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
0 commit comments