Class: VibeSort::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/vibe_sort/configuration.rb

Overview

Configuration class for VibeSort Holds API key and temperature settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, temperature: 0.0) ⇒ Configuration

Initialize a new Configuration

Parameters:

  • api_key (String)

    OpenAI API key

  • temperature (Float) (defaults to: 0.0)

    Temperature for the model (0.0 to 2.0)

Raises:

  • (ArgumentError)

    if api_key is nil or empty



14
15
16
17
18
19
# File 'lib/vibe_sort/configuration.rb', line 14

def initialize(api_key:, temperature: 0.0)
  raise ArgumentError, "API key cannot be nil or empty" if api_key.nil? || api_key.empty?

  @api_key = api_key
  @temperature = temperature
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



7
8
9
# File 'lib/vibe_sort/configuration.rb', line 7

def api_key
  @api_key
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



7
8
9
# File 'lib/vibe_sort/configuration.rb', line 7

def temperature
  @temperature
end