Class: Raix::Configuration

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

Overview

The Configuration class holds the configuration options for the Raix gem.

Constant Summary collapse

DEFAULT_MAX_TOKENS =
1000
DEFAULT_MODEL =
"meta-llama/llama-3-8b-instruct:free"
DEFAULT_TEMPERATURE =
0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Initializes a new instance of the Configuration class with default values.



34
35
36
37
38
# File 'lib/raix.rb', line 34

def initialize
  self.temperature = DEFAULT_TEMPERATURE
  self.max_tokens = DEFAULT_MAX_TOKENS
  self.model = DEFAULT_MODEL
end

Instance Attribute Details

#max_tokensObject

The max_tokens option determines the maximum number of tokens to generate.



17
18
19
# File 'lib/raix.rb', line 17

def max_tokens
  @max_tokens
end

#modelObject

The model option determines the model to use for text generation. This option is normally set in each class that includes the ChatCompletion module.



21
22
23
# File 'lib/raix.rb', line 21

def model
  @model
end

#openai_clientObject

The openai_client option determines the OpenAI client to use for communication.



27
28
29
# File 'lib/raix.rb', line 27

def openai_client
  @openai_client
end

#openrouter_clientObject

The openrouter_client option determines the default client to use for communicatio.



24
25
26
# File 'lib/raix.rb', line 24

def openrouter_client
  @openrouter_client
end

#temperatureObject

The temperature option determines the randomness of the generated text. Higher values result in more random output.



14
15
16
# File 'lib/raix.rb', line 14

def temperature
  @temperature
end