Class: RubyLLM::Text::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby_llm/text/configuration.rb', line 12

def initialize
  @temperature = 0.3
  @summarize_model = nil
  @translate_model = nil
  @extract_model = nil
  @classify_model = nil
  @grammar_model = nil
  @sentiment_model = nil
  @key_points_model = nil
  @rewrite_model = nil
  @answer_model = nil
end

Instance Attribute Details

#answer_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def answer_model
  @answer_model
end

#classify_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def classify_model
  @classify_model
end

#extract_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def extract_model
  @extract_model
end

#grammar_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def grammar_model
  @grammar_model
end

#key_points_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def key_points_model
  @key_points_model
end

#rewrite_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def rewrite_model
  @rewrite_model
end

#sentiment_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def sentiment_model
  @sentiment_model
end

#summarize_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def summarize_model
  @summarize_model
end

#temperature ⇒ Object

Default temperature for text operations



10
11
12
# File 'lib/ruby_llm/text/configuration.rb', line 10

def temperature
  @temperature
end

#translate_model ⇒ Object

Method-specific model overrides (optional) If not set, falls back to RubyLLM.config.default_model



6
7
8
# File 'lib/ruby_llm/text/configuration.rb', line 6

def translate_model
  @translate_model
end

Instance Method Details

#model_for(method_name) ⇒ Object



25
26
27
# File 'lib/ruby_llm/text/configuration.rb', line 25

def model_for(method_name)
  instance_variable_get("@#{method_name}_model") || RubyLLM.config.default_model
end