Class: InstLLM::Parameter::MistralParameters
- Inherits:
-
Object
- Object
- InstLLM::Parameter::MistralParameters
- 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
-
#initialize(model:, messages:, **options) ⇒ MistralParameters
constructor
A new instance of MistralParameters.
- #to_hash ⇒ Object
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:, **) @model = model @messages = @options = DEFAULT_OPTIONS.merge(.slice(*DEFAULT_OPTIONS.keys)).compact end |
Instance Method Details
#to_hash ⇒ Object
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 |