Class: VibeSort::Configuration
- Inherits:
-
Object
- Object
- VibeSort::Configuration
- Defined in:
- lib/vibe_sort/configuration.rb
Overview
Configuration class for VibeSort Holds provider, API key, model, temperature, and extra request parameters
Constant Summary collapse
- PROVIDERS =
%i[openai anthropic gemini groq spacexai openrouter].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#extra_params ⇒ Object
readonly
Returns the value of attribute extra_params.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize(api_key:, temperature: 0.0, provider: nil, model: nil, extra_params: {}) ⇒ Configuration
constructor
Initialize a new Configuration.
Constructor Details
#initialize(api_key:, temperature: 0.0, provider: nil, model: nil, extra_params: {}) ⇒ Configuration
Initialize a new Configuration
23 24 25 26 27 28 29 30 31 |
# File 'lib/vibe_sort/configuration.rb', line 23 def initialize(api_key:, temperature: 0.0, provider: nil, model: nil, extra_params: {}) raise ArgumentError, "API key cannot be nil or empty" if api_key.nil? || api_key.empty? @provider = resolve_provider(provider, api_key) @api_key = api_key @temperature = temperature @model = model @extra_params = extra_params end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/vibe_sort/configuration.rb', line 9 def api_key @api_key end |
#extra_params ⇒ Object (readonly)
Returns the value of attribute extra_params.
9 10 11 |
# File 'lib/vibe_sort/configuration.rb', line 9 def extra_params @extra_params end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
9 10 11 |
# File 'lib/vibe_sort/configuration.rb', line 9 def model @model end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
9 10 11 |
# File 'lib/vibe_sort/configuration.rb', line 9 def provider @provider end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
9 10 11 |
# File 'lib/vibe_sort/configuration.rb', line 9 def temperature @temperature end |