class RubyLLM::Browser::Configuration
Process-wide defaults. Per-call behaviour belongs on {Context}, {Policy} and the backend; this object only holds values that are safe to share.
Requiring the Gem never reads credentials or environment variables; configuration is explicit.
Constants
- DEFAULT_MAX_RESULT_BYTES
Attributes
backend[RW]
Reserved host configuration slot. Context still requires an explicit backend; setting this never enables a fallback or changes an existing tool’s backend.
clock[R]
default_budget[R]
logger[W]
max_result_bytes[R]
Public Class Methods
new()
click to toggle source
# File lib/ruby_llm/browser/configuration.rb, line 21 def initialize @backend = nil @logger = nil @clock = -> { Time.now.utc } @default_budget = Budget.new @max_result_bytes = DEFAULT_MAX_RESULT_BYTES end
Public Instance Methods
clock=(callable)
click to toggle source
# File lib/ruby_llm/browser/configuration.rb, line 36 def clock=(callable) unless callable.respond_to?(:call) raise InvalidInput, "clock must respond to #call and return a Time" end @clock = callable end
default_budget=(budget)
click to toggle source
# File lib/ruby_llm/browser/configuration.rb, line 44 def default_budget=(budget) raise InvalidInput, "default_budget must be a RubyLLM::Browser::Budget" unless budget.is_a?(Budget) @default_budget = budget end
logger()
click to toggle source
The logger used for audit lines. Falls back to RubyLLM’s logger when present.
# File lib/ruby_llm/browser/configuration.rb, line 30 def logger @logger || default_logger end
max_result_bytes=(value)
click to toggle source
# File lib/ruby_llm/browser/configuration.rb, line 50 def max_result_bytes=(value) unless value.is_a?(Integer) && value.positive? raise InvalidInput, "max_result_bytes must be a positive integer" end @max_result_bytes = value end
now()
click to toggle source
Current UTC time from the configured clock.
# File lib/ruby_llm/browser/configuration.rb, line 59 def now clock.call end