Class: OllamaAgent::Providers::ModelDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_agent/providers/model_descriptor.rb

Overview

Represents properties, limits, and capabilities of an LLM.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#capabilitiesObject (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_sizeObject (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

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 7

def name
  @name
end

#providerObject (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_gbObject (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

#statusObject (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

Returns:

  • (Boolean)


28
29
30
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 28

def reasoning?
  @capabilities.include?(:reasoning)
end

#subscription_required?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 36

def subscription_required?
  @subscription_required
end

#thinking?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 32

def thinking?
  @capabilities.include?(:thinking)
end

#to_sObject



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

Returns:

  • (Boolean)


20
21
22
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 20

def tools?
  @capabilities.include?(:tools)
end

#vision?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ollama_agent/providers/model_descriptor.rb', line 24

def vision?
  @capabilities.include?(:vision)
end