module RubyLLM::Providers::Bedrock::Capabilities

def context_window_for(model_id)

Returns:
  • (Integer) - the context window size in tokens

Parameters:
  • model_id (String) -- the model identifier
def context_window_for(model_id)
  case model_id
  when /anthropic\.claude-2/ then 100_000
  else 200_000
  end
end

def default_input_price

Returns:
  • (Float) - the default price per million tokens
def default_input_price
  0.1
end

def default_output_price

Returns:
  • (Float) - the default price per million tokens
def default_output_price
  0.2
end

def format_display_name(model_id)

Returns:
  • (String) - the formatted display name

Parameters:
  • model_id (String) -- the model identifier
def format_display_name(model_id)
  model_id.then { |id| humanize(id) }
end

def humanize(id)

Returns:
  • (String) - the humanized model name

Parameters:
  • id (String) -- the model identifier
def humanize(id)
  id.tr('-', ' ')
    .split('.')
    .last
    .split
    .map(&:capitalize)
    .join(' ')
end

def input_price_for(model_id)

Returns:
  • (Float) - the price per million tokens for input

Parameters:
  • model_id (String) -- the model identifier
def input_price_for(model_id)
  PRICES.dig(model_family(model_id), :input) || default_input_price
end

def max_tokens_for(_model_id)

Returns:
  • (Integer) - the maximum output tokens

Parameters:
  • model_id (String) -- the model identifier
def max_tokens_for(_model_id)
  4_096
end

def model_family(model_id)

Returns:
  • (Symbol) - the model family identifier

Parameters:
  • model_id (String) -- the model identifier
def model_family(model_id)
  MODEL_FAMILIES.find { |pattern, _family| model_id.match?(pattern) }&.last || :other
end

def model_type(_model_id)

Returns:
  • (String) - the model type (chat, embedding, image, audio)

Parameters:
  • model_id (String) -- the model identifier
def model_type(_model_id)
  'chat'
end

def output_price_for(model_id)

Returns:
  • (Float) - the price per million tokens for output

Parameters:
  • model_id (String) -- the model identifier
def output_price_for(model_id)
  PRICES.dig(model_family(model_id), :output) || default_output_price
end

def supports_audio?(_model_id)

Returns:
  • (Boolean) - true if the model supports audio

Parameters:
  • model_id (String) -- the model identifier
def supports_audio?(_model_id)
  false
end

def supports_chat?(model_id)

Returns:
  • (Boolean) - true if the model supports chat

Parameters:
  • model_id (String) -- the model identifier
def supports_chat?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_functions?(model_id)

Returns:
  • (Boolean) - true if the model supports functions

Parameters:
  • model_id (String) -- the model identifier
def supports_functions?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_images?(model_id)

Returns:
  • (Boolean) - true if the model supports images

Parameters:
  • model_id (String) -- the model identifier
def supports_images?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_json_mode?(model_id)

Returns:
  • (Boolean) - true if the model supports JSON mode

Parameters:
  • model_id (String) -- the model identifier
def supports_json_mode?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_streaming?(model_id)

Returns:
  • (Boolean) - true if the model supports streaming

Parameters:
  • model_id (String) -- the model identifier
def supports_streaming?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_structured_output?(model_id)

Returns:
  • (Boolean) - true if the model supports structured output

Parameters:
  • model_id (String) -- the model identifier
def supports_structured_output?(model_id)
  model_id.match?(/anthropic\.claude/)
end

def supports_vision?(model_id)

Returns:
  • (Boolean) - true if the model supports vision

Parameters:
  • model_id (String) -- the model identifier
def supports_vision?(model_id)
  model_id.match?(/anthropic\.claude/)
end