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, and temperature settings
Constant Summary collapse
- PROVIDERS =
%i[openai anthropic gemini groq spacexai].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#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: :openai, model: nil) ⇒ Configuration
constructor
Initialize a new Configuration.
Constructor Details
#initialize(api_key:, temperature: 0.0, provider: :openai, model: nil) ⇒ Configuration
Initialize a new Configuration
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vibe_sort/configuration.rb', line 19 def initialize(api_key:, temperature: 0.0, provider: :openai, model: nil) raise ArgumentError, "API key cannot be nil or empty" if api_key.nil? || api_key.empty? @provider = provider.to_s.to_sym raise ArgumentError, "Unknown provider: #{provider.inspect} (supported: #{PROVIDERS.join(", ")})" unless PROVIDERS.include?(@provider) @api_key = api_key @temperature = temperature @model = model 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 |
#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 |