Class: Ragents::Configuration

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

Overview

Configuration class for Ragents

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_modelObject

Returns the value of attribute default_model.



69
70
71
# File 'lib/ragents.rb', line 69

def default_model
  @default_model
end

#default_providerObject

Returns the value of attribute default_provider.



69
70
71
# File 'lib/ragents.rb', line 69

def default_provider
  @default_provider
end

#max_iterationsObject

Returns the value of attribute max_iterations.



69
70
71
# File 'lib/ragents.rb', line 69

def max_iterations
  @max_iterations
end

#timeoutObject

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

Parameters:

  • model (String) (defaults to: nil)

    The model to use (e.g., “gpt-4o”, “claude-sonnet-4-20250514”)



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