Class: OllamaChat::ModelHandling::ModelMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_chat/model_handling.rb

Overview

A simple data structure representing metadata about a model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#capabilities ⇒ Array<String> (readonly)

the capabilities supported by the model

Returns:

  • (Array<String>) —

    the current value of capabilities



31
32
33
# File 'lib/ollama_chat/model_handling.rb', line 31

def capabilities
  @capabilities
end

#families ⇒ Array<String> (readonly)

the families of the model

Returns:

  • (Array<String>) —

    the current value of families



31
32
33
# File 'lib/ollama_chat/model_handling.rb', line 31

def families
  @families
end

#name ⇒ String (readonly)

the name of the model

Returns:

  • (String) —

    the current value of name



31
32
33
# File 'lib/ollama_chat/model_handling.rb', line 31

def name
  @name
end

#system ⇒ String (readonly)

the system prompt associated with the model

Returns:

  • (String) —

    the current value of system



31
32
33
# File 'lib/ollama_chat/model_handling.rb', line 31

def system
  @system
end

#thinking ⇒ Hash? (readonly)

the thinking payload (values and default) from Ollama ≥ 0.34.3, or nil when the server or model does not expose it

Returns:

  • (Hash, nil) —

    the current value of thinking



31
32
33
# File 'lib/ollama_chat/model_handling.rb', line 31

def thinking
  @thinking
end

Instance Method Details

#can?(capability) ⇒ true, false

Checks if the given capability is included in the object's capabilities.

Parameters:

  • capability (String) —

    the capability to check for

Returns:

  • (true, false) —

    true if the capability is present, false otherwise



38
39
40
# File 'lib/ollama_chat/model_handling.rb', line 38

def can?(capability)
  Array(capabilities).member?(capability)
end