Class: InstLLM::Parameter::Llama3Parameters
- Inherits:
-
Object
- Object
- InstLLM::Parameter::Llama3Parameters
- Defined in:
- lib/inst_llm/parameter/llama3_parameters.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ max_gen_len: nil, temperature: nil, top_p: nil, }.freeze
Instance Method Summary collapse
-
#initialize(model:, messages: [], **options) ⇒ Llama3Parameters
constructor
A new instance of Llama3Parameters.
- #to_hash ⇒ Object
Constructor Details
#initialize(model:, messages: [], **options) ⇒ Llama3Parameters
Returns a new instance of Llama3Parameters.
14 15 16 17 18 |
# File 'lib/inst_llm/parameter/llama3_parameters.rb', line 14 def initialize(model:, messages: [], **) @model = model @messages = .map { || () } @options = DEFAULT_OPTIONS.merge(.slice(*DEFAULT_OPTIONS.keys)).compact end |
Instance Method Details
#to_hash ⇒ Object
20 21 22 |
# File 'lib/inst_llm/parameter/llama3_parameters.rb', line 20 def to_hash { model_id: @model, body: { prompt: prompt(@messages) }.merge(@options).to_json } end |