Class: InstLLM::Parameter::MistralParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/inst_llm/parameter/mistral_parameters.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  max_tokens: nil,
  stop: nil,
  temperature: nil,
  top_p: nil,
  top_k: nil
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(model:, messages:, **options) ⇒ MistralParameters

Returns a new instance of MistralParameters.



14
15
16
17
18
# File 'lib/inst_llm/parameter/mistral_parameters.rb', line 14

def initialize(model:, messages:, **options)
  @model = model
  @messages = messages
  @options = DEFAULT_OPTIONS.merge(options.slice(*DEFAULT_OPTIONS.keys)).compact
end

Instance Method Details

#to_hashObject



20
21
22
# File 'lib/inst_llm/parameter/mistral_parameters.rb', line 20

def to_hash
  { model_id: @model, body: { prompt: prompt }.merge(@options).to_json }
end