Class: Riffer::Providers::AmazonBedrock
- Defined in:
- lib/riffer/providers/amazon_bedrock.rb
Overview
Amazon Bedrock provider for Claude and other foundation models.
Requires the aws-sdk-bedrockruntime gem to be installed.
See docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html
Instance Method Summary collapse
-
#initialize(api_token: nil, region: nil, **options) ⇒ AmazonBedrock
constructor
Initializes the Amazon Bedrock provider.
Methods inherited from Base
Methods included from Messages::Converter
Constructor Details
#initialize(api_token: nil, region: nil, **options) ⇒ AmazonBedrock
Initializes the Amazon Bedrock provider.
- api_token
-
String or nil - Bearer token for API authentication
- region
-
String or nil - AWS region
- options
-
Hash - additional options passed to Aws::BedrockRuntime::Client
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/riffer/providers/amazon_bedrock.rb', line 16 def initialize(api_token: nil, region: nil, **) depends_on "aws-sdk-bedrockruntime" api_token ||= Riffer.config.amazon_bedrock.api_token region ||= Riffer.config.amazon_bedrock.region @client = if api_token && !api_token.empty? Aws::BedrockRuntime::Client.new( region: region, token_provider: Aws::StaticTokenProvider.new(api_token), auth_scheme_preference: ["httpBearerAuth"], ** ) else Aws::BedrockRuntime::Client.new(region: region, **) end end |