Class: Ollama::Options
- Inherits:
-
Object
- Object
- Ollama::Options
- Extended by:
- JSONLoader
- Includes:
- DTO
- Defined in:
- lib/ollama/options.rb
Overview
A class that encapsulates configuration options for Ollama models.
This class provides a structured way to define and manage various parameters that can be passed to Ollama models during generation or chat operations. It includes type validation to ensure that option values conform to expected data types, making it easier to work with model configurations programmatically.
Constant Summary collapse
- @@types =
{ numa: [ false, true ], num_ctx: Integer, num_batch: Integer, num_gpu: Integer, main_gpu: Integer, low_vram: [ false, true ], f16_kv: [ false, true ], logits_all: [ false, true ], vocab_only: [ false, true ], use_mmap: [ false, true ], use_mlock: [ false, true ], num_thread: Integer, num_keep: Integer, seed: Integer, num_predict: Integer, top_k: Integer, top_p: Float, min_p: Float, tfs_z: Float, typical_p: Float, repeat_last_n: Integer, temperature: Float, repeat_penalty: Float, presence_penalty: Float, frequency_penalty: Float, mirostat: Integer, mirostat_tau: Float, mirostat_eta: Float, penalize_newline: [ false, true ], stop: Array, }
Class Method Summary collapse
-
.[](value) ⇒ self
The [] method creates a new instance of the class using a hash of attributes.
Methods included from JSONLoader
Methods included from DTO
#==, #as_array, #as_array_of_hashes, #as_hash, #as_json, #empty?, #to_json
Class Method Details
.[](value) ⇒ self
The [] method creates a new instance of the class using a hash of attributes.
This class method provides a convenient way to instantiate an object by passing a hash containing the desired attribute values. It converts the hash keys to symbols and forwards them as keyword arguments to the constructor.
attributes
97 98 99 |
# File 'lib/ollama/options.rb', line 97 def self.[](value) new(**value.to_h) end |