class RubyLLM::Browser::Tool
Base class for the Gem’s RubyLLM tools.
A tool is a thin, policy-free adapter. The host injects exactly one trusted {Context}; the tool forwards model-supplied arguments to an {Engine}, and the engine enforces egress qualification, destination/schema/action policy, budgets, operation lifecycle and result redaction. A tool never invents an actor, a backend, a schema or an approval, and it never turns a typed failure into an untyped exception that would abort the chat.
Model-facing names are declared explicitly so they stay stable across releases.
Attributes
context[R]
Public Class Methods
new(context:)
click to toggle source
@param context [Context] the host-supplied, trusted execution context
Calls superclass method
# File lib/ruby_llm/browser/tool.rb, line 30 def initialize(context:) super() @context = context!(context) @engine = Engine.new(context: @context) end
tool_name(value = nil)
click to toggle source
Declares or returns the stable, model-facing tool name.
tool_name "browser_inspect"
# File lib/ruby_llm/browser/tool.rb, line 20 def tool_name(value = nil) return @tool_name if value.nil? @tool_name = value end