Class: RSpec::Llama::OpenaiModelConfiguration
- Inherits:
-
Object
- Object
- RSpec::Llama::OpenaiModelConfiguration
- Defined in:
- lib/rspec/llama/model_configurations/openai_model_configuration.rb
Constant Summary collapse
- DEFAULT_MODEL =
'gpt-3.5-turbo'- DEFAULT_TEMPERATURE =
0.5
Instance Attribute Summary collapse
-
#additional_options ⇒ Object
readonly
Returns the value of attribute additional_options.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize(model: DEFAULT_MODEL, temperature: DEFAULT_TEMPERATURE, **additional_options) ⇒ OpenaiModelConfiguration
constructor
Initializes a new configuration for the OpenAI model.
-
#to_h ⇒ Hash
Converts the configuration into a hash format for making API requests.
Constructor Details
#initialize(model: DEFAULT_MODEL, temperature: DEFAULT_TEMPERATURE, **additional_options) ⇒ OpenaiModelConfiguration
Initializes a new configuration for the OpenAI model.
32 33 34 35 36 |
# File 'lib/rspec/llama/model_configurations/openai_model_configuration.rb', line 32 def initialize(model: DEFAULT_MODEL, temperature: DEFAULT_TEMPERATURE, **) @model = model @temperature = temperature @additional_options = end |
Instance Attribute Details
#additional_options ⇒ Object (readonly)
Returns the value of attribute additional_options.
9 10 11 |
# File 'lib/rspec/llama/model_configurations/openai_model_configuration.rb', line 9 def @additional_options end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
9 10 11 |
# File 'lib/rspec/llama/model_configurations/openai_model_configuration.rb', line 9 def model @model end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
9 10 11 |
# File 'lib/rspec/llama/model_configurations/openai_model_configuration.rb', line 9 def temperature @temperature end |
Instance Method Details
#to_h ⇒ Hash
Converts the configuration into a hash format for making API requests.
43 44 45 |
# File 'lib/rspec/llama/model_configurations/openai_model_configuration.rb', line 43 def to_h { model:, temperature:, ** }.compact end |