Class: OllamaChat::Database::Models::ModelOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_chat/database/models/model_options.rb

Overview

Sequel model for persisting model-specific configurations as a JSON blob. Each record is uniquely identified by its model name.

Instance Method Summary collapse

Instance Method Details

#created_at=(value) ⇒ Time?

Returns The timestamp when these options were first recorded.

Returns:

  • (Time, nil)

    The timestamp when these options were first recorded.



# File 'lib/ollama_chat/database/models/model_options.rb', line 18

#id=(value) ⇒ Integer

Returns The primary key for the model options entry.

Returns:

  • (Integer)

    The primary key for the model options entry.



# File 'lib/ollama_chat/database/models/model_options.rb', line 18

#model_name=(value) ⇒ String

Returns The unique name of the Ollama model these options apply to.

Returns:

  • (String)

    The unique name of the Ollama model these options apply to.



# File 'lib/ollama_chat/database/models/model_options.rb', line 18

#options=(value) ⇒ String

Returns A JSON-serialized string containing the model-specific configuration options.

Returns:

  • (String)

    A JSON-serialized string containing the model-specific configuration options.



# File 'lib/ollama_chat/database/models/model_options.rb', line 18

#updated_at=(value) ⇒ Time?

Returns The timestamp of the last update to these options.

Returns:

  • (Time, nil)

    The timestamp of the last update to these options.



# File 'lib/ollama_chat/database/models/model_options.rb', line 18

#validateObject

Validates the model options.

Ensures that both the ‘model_name` and `options` are present.



11
12
13
14
15
16
# File 'lib/ollama_chat/database/models/model_options.rb', line 11

def validate
  super
  validates_presence :model_name
  validates_unique :model_name
  validates_presence :options
end