class Riffer::Providers::AmazonBedrock
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
Constants
- BEDROCK_FORMAT_MAP
Public Class Methods
Source
# File lib/riffer/providers/amazon_bedrock.rb, line 13 def initialize(api_token: nil, region: nil, **options) 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"], **options ) else Aws::BedrockRuntime::Client.new(region: region, **options) end end
Initializes the Amazon Bedrock provider.
: (?api_token: String?, ?region: String?, **untyped) -> void