module RubyLLM::Browser

Policy-bound browser tools for RubyLLM agents.

The host application owns identity, authorization, consent and the backend backend; this namespace owns URL/source policy, bounded results and provenance, operation and session lifecycle, budgets and one-use action approvals.

Constants

VERSION

The Gem version. Development happens ahead of any public release: the packaged version is not a RubyGems publication claim.

Public Class Methods

clock() click to toggle source
# File lib/ruby_llm/browser.rb, line 85
def clock
  configuration.clock
end
configuration() click to toggle source

Process-wide defaults (see {Configuration}).

# File lib/ruby_llm/browser.rb, line 62
def configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source

Yields the shared configuration.

RubyLLM::Browser.configure do |config|
  config.max_result_bytes = 32_768
end
# File lib/ruby_llm/browser.rb, line 71
def configure
  yield configuration if block_given?
  configuration
end
logger() click to toggle source
# File lib/ruby_llm/browser.rb, line 81
def logger
  configuration.logger
end
reset_configuration!() click to toggle source

Restores the process-wide defaults. Primarily a test helper.

# File lib/ruby_llm/browser.rb, line 77
def reset_configuration!
  @configuration = Configuration.new
end
tools(context:, schema:) click to toggle source

Builds the read-only tool pair for a host-supplied context and schema.

chat.with_tools(*RubyLLM::Browser.tools(context: context, schema: schema))

No operation is dispatched. Act is never included. Constructor validation applies here; the host policy validates schema contents when Extract runs. @return [Array<Inspect, Extract>] fresh instances sharing the supplied context

# File lib/ruby_llm/browser.rb, line 57
def tools(context:, schema:)
  [ Inspect.new(context: context), Extract.new(context: context, schema: schema) ]
end