Class: OllamaAgent::Providers::ModelDescriptor
- Inherits:
-
Object
- Object
- OllamaAgent::Providers::ModelDescriptor
- Defined in:
- lib/ollama_agent/providers/model_descriptor.rb
Overview
Represents properties, limits, and capabilities of an LLM.
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#context_size ⇒ Object
readonly
Returns the value of attribute context_size.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#size_gb ⇒ Object
readonly
Returns the value of attribute size_gb.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(name:, provider:, context_size: 8192, capabilities: [:chat], size_gb: nil, status: "available", subscription_required: false) ⇒ ModelDescriptor
constructor
A new instance of ModelDescriptor.
- #reasoning? ⇒ Boolean
- #subscription_required? ⇒ Boolean
- #thinking? ⇒ Boolean
- #to_s ⇒ Object
- #tools? ⇒ Boolean
- #vision? ⇒ Boolean
Constructor Details
#initialize(name:, provider:, context_size: 8192, capabilities: [:chat], size_gb: nil, status: "available", subscription_required: false) ⇒ ModelDescriptor
Returns a new instance of ModelDescriptor.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 9 def initialize(name:, provider:, context_size: 8192, capabilities: [:chat], size_gb: nil, status: "available", subscription_required: false) @name = name.to_s @provider = provider.to_s @context_size = context_size.to_i @capabilities = Array(capabilities).map(&:to_sym) @size_gb = size_gb&.to_f @status = status.to_s @subscription_required = subscription_required end |
Instance Attribute Details
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def capabilities @capabilities end |
#context_size ⇒ Object (readonly)
Returns the value of attribute context_size.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def context_size @context_size end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def name @name end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def provider @provider end |
#size_gb ⇒ Object (readonly)
Returns the value of attribute size_gb.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def size_gb @size_gb end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7 def status @status end |
Instance Method Details
#reasoning? ⇒ Boolean
28 29 30 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 28 def reasoning? @capabilities.include?(:reasoning) end |
#subscription_required? ⇒ Boolean
36 37 38 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 36 def subscription_required? @subscription_required end |
#thinking? ⇒ Boolean
32 33 34 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 32 def thinking? @capabilities.include?(:thinking) end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 40 def to_s "#<#{self.class.name} name=#{@name} provider=#{@provider} context=#{@context_size} caps=#{@capabilities.inspect}>" end |
#tools? ⇒ Boolean
20 21 22 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 20 def tools? @capabilities.include?(:tools) end |
#vision? ⇒ Boolean
24 25 26 |
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 24 def vision? @capabilities.include?(:vision) end |