Class: Ragents::Configuration
- Inherits:
-
Object
- Object
- Ragents::Configuration
- Defined in:
- lib/ragents.rb
Overview
Configuration class for Ragents
Instance Attribute Summary collapse
-
#default_model ⇒ Object
Returns the value of attribute default_model.
-
#default_provider ⇒ Object
Returns the value of attribute default_provider.
-
#max_iterations ⇒ Object
Returns the value of attribute max_iterations.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#provider(model: nil) ⇒ Object
Configure and register a provider.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
71 72 73 74 75 76 |
# File 'lib/ragents.rb', line 71 def initialize @default_provider = nil @default_model = "gpt-4o" @max_iterations = 10 @timeout = 120 end |
Instance Attribute Details
#default_model ⇒ Object
Returns the value of attribute default_model.
69 70 71 |
# File 'lib/ragents.rb', line 69 def default_model @default_model end |
#default_provider ⇒ Object
Returns the value of attribute default_provider.
69 70 71 |
# File 'lib/ragents.rb', line 69 def default_provider @default_provider end |
#max_iterations ⇒ Object
Returns the value of attribute max_iterations.
69 70 71 |
# File 'lib/ragents.rb', line 69 def max_iterations @max_iterations end |
#timeout ⇒ Object
Returns the value of attribute timeout.
69 70 71 |
# File 'lib/ragents.rb', line 69 def timeout @timeout end |
Instance Method Details
#provider(model: nil) ⇒ Object
Configure and register a provider
80 81 82 83 84 85 |
# File 'lib/ragents.rb', line 80 def provider(model: nil) model ||= @default_model provider = Providers::RubyLLM.new(model: model) Ragents.register_provider(:default, provider) provider end |