mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-24 06:11:11 -05:00
feat(api): unify Bedrock provider using Runtime API
Problem: The current Bedrock implementation uses the Bedrock SDK, which requires separate handling for different model types and doesn't provide a unified streaming interface. Solution: Integrate the Bedrock Runtime API to provide a single, unified interface for all Bedrock models (Claude and Nova) using the ConverseStream API. This eliminates the need for separate handlers while maintaining all existing functionality. Key Changes: - Refactored AwsBedrockHandler to use @aws-sdk/client-bedrock-runtime - Enhanced bedrock-converse-format.ts to handle all content types and properly transform between Anthropic and Bedrock formats - Maintained cross-region inference support with proper region prefixing - Added support for prompt caching configuration - Improved AWS credentials handling to better support default providers - Added proper error handling and token tracking for all response types Dependencies: - Added @aws-sdk/client-bedrock-runtime for unified API access - Removed @anthropic-ai/bedrock-sdk dependency Testing: - Verified message format conversion for all content types - Tested cross-region inference functionality - Validated streaming responses for both Claude and Nova models This change simplifies the codebase by providing a single, consistent interface for all Bedrock models while maintaining full compatibility with existing features.
This commit is contained in:
1
package-lock.json
generated
1
package-lock.json
generated
@@ -11,6 +11,7 @@
|
||||
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
||||
"@anthropic-ai/sdk": "^0.26.0",
|
||||
"@anthropic-ai/vertex-sdk": "^0.4.1",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.706.0",
|
||||
"@google/generative-ai": "^0.18.0",
|
||||
"@types/clone-deep": "^4.0.4",
|
||||
"@types/pdf-parse": "^1.1.4",
|
||||
|
||||
Reference in New Issue
Block a user