Module: Legion::Extensions::Llm::Bedrock::Provider::Capabilities
- Defined in:
- lib/legion/extensions/llm/bedrock/provider.rb
Overview
Capability predicates inferred from Bedrock model IDs and API modalities.
Class Method Summary collapse
- .chat?(model) ⇒ Boolean
- .embeddings?(model) ⇒ Boolean
- .functions?(model) ⇒ Boolean
- .model_id(model) ⇒ Object
- .streaming?(model) ⇒ Boolean
- .vision?(model) ⇒ Boolean
Class Method Details
.chat?(model) ⇒ Boolean
55 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 55 def chat?(model) = !(model) |
.embeddings?(model) ⇒ Boolean
59 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 59 def (model) = model_id(model).match?(/embed|embedding/) |
.functions?(model) ⇒ Boolean
58 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 58 def functions?(model) = chat?(model) |
.model_id(model) ⇒ Object
61 62 63 64 65 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 61 def model_id(model) return model.fetch('model', model.fetch('id', '')) if model.is_a?(Hash) model.respond_to?(:id) ? model.id.to_s : model.to_s end |
.streaming?(model) ⇒ Boolean
56 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 56 def streaming?(model) = chat?(model) |
.vision?(model) ⇒ Boolean
57 |
# File 'lib/legion/extensions/llm/bedrock/provider.rb', line 57 def vision?(model) = model_id(model).match?(/(claude-3|llama3-2-(11|90)b)/) |