class Riffer::Providers::AmazonBedrock
Amazon Bedrock provider for Claude and other foundation models. Requires the aws-sdk-bedrockruntime gem.
Constants
- ANTHROPIC_MODEL_PATTERN
-
Matches Anthropic models on Bedrock β bare (
anthropic.claude-...) and cross-region (us.anthropic.claude-...) ids. - FINISH_REASONS
Public Class Methods
Source
# File lib/riffer/providers/amazon_bedrock.rb, line 44 def initialize super depends_on "aws-sdk-bedrockruntime" end
Calls superclass method
Source
# File lib/riffer/providers/amazon_bedrock.rb, line 38 def self.semconv_provider_name "aws.bedrock" end
The GenAI semconv well-known provider name.
Source
# File lib/riffer/providers/amazon_bedrock.rb, line 29 def self.skills_adapter(model = nil) return Riffer::Skills::XmlAdapter if model && ANTHROPIC_MODEL_PATTERN.match?(model) Riffer::Skills::MarkdownAdapter end
Returns the skill adapter for the Bedrock model β XML for Anthropic models (which Bedrock hosts alongside other vendorsβ), else Markdown.
Public Instance Methods
Source
# File lib/riffer/providers/amazon_bedrock.rb, line 51 def file_delivery(file) file.url&.start_with?("s3://") ? :url : :bytes end