feat(dotAI): Dot AI LangChain4J - Amazon Bedrock#35242
feat(dotAI): Dot AI LangChain4J - Amazon Bedrock#35242ihoffmann-dot wants to merge 15 commits intodot-ai-langchain-azure-openaifrom
Conversation
|
Claude finished @ihoffmann-dot's task in 1m 30s —— View job PR Review: feat(dotAI) - Amazon Bedrock
Several issues worth addressing before merge: 1. Resource leak — AWS SDK clients are never closed
2.
|
|
Claude finished @ihoffmann-dot's task in 54s —— View job I'll analyze this and get back to you. |
…a BedrockStreamingChatModel
Summary
Adds AWS Bedrock as a supported provider. Bedrock is a managed platform that
proxies multiple model families (Anthropic, Amazon Titan, Cohere, Meta, etc.)
via a unified Converse API — a single integration covers all of them.
langchain4j-bedrockdependencybedrockcase toLangChain4jModelFactoryswitchbuildBedrockChatModelusingBedrockRuntimeClientwith explicit or IAM role credentialsbuildBedrockEmbeddingModelwith automatic Titan/Cohere dispatch by model ID prefixembeddingInputTypefield toProviderConfig(Cohere-specific; default:search_document)buildBedrockImageModelthrowsUnsupportedOperationException(no LangChain4J support)LangChain4jModelFactoryTestConfiguration
{ "chat": { "provider": "bedrock", "region": "us-east-1", "accessKeyId": "...", "secretAccessKey": "...", "model": "anthropic.claude-3-5-sonnet-20241022-v2:0", "maxTokens": 16384, "temperature": 1.0 }, "embeddings": { "provider": "bedrock", "region": "us-east-1", "accessKeyId": "...", "secretAccessKey": "...", "model": "amazon.titan-embed-text-v2:0" } }Notes
accessKeyId/secretAccessKeyare omitted, credentials resolve viaDefaultCredentialsProvider(IAM role, environment, ~/.aws/credentials).cohere. →BedrockCohereEmbeddingModel; all others →BedrockTitanEmbeddingModel.embeddingInputTypeis Cohere-only. Usesearch_documentwhen indexing content,search_querywhen embedding a search query. Titan silently ignores this field.UnsupportedOperationException.Related Issue
This PR fixes #35183
EPIC: dotAI Multi-Provider Support #33970