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
# File lib/ruby_llm/browser.rb, line 85 def clock configuration.clock end
Process-wide defaults (see {Configuration}).
# File lib/ruby_llm/browser.rb, line 62 def configuration @configuration ||= Configuration.new end
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
# File lib/ruby_llm/browser.rb, line 81 def logger configuration.logger end
Restores the process-wide defaults. Primarily a test helper.
# File lib/ruby_llm/browser.rb, line 77 def reset_configuration! @configuration = Configuration.new end
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