class RubyLLM::Providers::Bedrock
AWS Bedrock Converse API integration.
Public Class Methods
Source
# File lib/ruby_llm/providers/bedrock.rb, line 56 def configuration_options %i[bedrock_api_key bedrock_secret_key bedrock_region bedrock_session_token bedrock_api_base] end
# File lib/ruby_llm/providers/bedrock.rb, line 60 def configuration_requirements %i[bedrock_api_key bedrock_secret_key bedrock_region] end
Public Instance Methods
Source
# File lib/ruby_llm/providers/bedrock.rb, line 13 def api_base @config.bedrock_api_base || "https://bedrock-runtime.#{bedrock_region}.amazonaws.com" end
# File lib/ruby_llm/providers/bedrock.rb, line 22 def complete(messages, tools:, temperature:, model:, params: {}, headers: {}, schema: nil, thinking: nil, tool_prefs: nil, &) normalized_params = normalize_params(params, model:) super( messages, tools: tools, tool_prefs: tool_prefs, temperature: temperature, model: model, params: normalized_params, headers: headers, schema: schema, thinking: thinking, & ) end
rubocop:disable Metrics/ParameterLists
Calls superclass method
RubyLLM::Provider#complete
Source
# File lib/ruby_llm/providers/bedrock.rb, line 50 def list_models response = signed_get(models_api_base, models_url) parse_list_models_response(response, slug, capabilities) end
Source
# File lib/ruby_llm/providers/bedrock.rb, line 41 def parse_error(response) return if response.body.nil? || response.body.empty? body = try_parse_json(response.body) return body if body.is_a?(String) body['message'] || body['Message'] || body['error'] || body['__type'] || super end
rubocop:enable Metrics/ParameterLists
Calls superclass method
RubyLLM::Provider#parse_error