Class: Brute::Completion::RubyLLM::Tool
- Inherits:
-
Object
- Object
- Brute::Completion::RubyLLM::Tool
- Defined in:
- lib/brute/completion/ruby_llm.rb
Overview
A Brute tool adapter wearing the interface ruby_llm's providers read off a RubyLLM::Tool: name, description, and a params_schema (they fall back to #parameters only when that is nil), plus #provider_params to deep-merge into the declaration. Brute's own ToolPipeline runs the tool, so this mostly has to describe it — #call is here for a caller that hands the same list to ruby_llm's dispatch.
Instance Method Summary collapse
- #call(args) ⇒ Object
- #description ⇒ Object
-
#initialize(adapter) ⇒ Tool
constructor
A new instance of Tool.
- #name ⇒ Object
- #parameters ⇒ Object
- #params_schema ⇒ Object
- #provider_params ⇒ Object
Constructor Details
#initialize(adapter) ⇒ Tool
Returns a new instance of Tool.
37 38 39 |
# File 'lib/brute/completion/ruby_llm.rb', line 37 def initialize(adapter) @adapter = adapter end |
Instance Method Details
#call(args) ⇒ Object
46 |
# File 'lib/brute/completion/ruby_llm.rb', line 46 def call(args) = @adapter.call(args) |
#description ⇒ Object
42 |
# File 'lib/brute/completion/ruby_llm.rb', line 42 def description = @adapter.description |
#name ⇒ Object
41 |
# File 'lib/brute/completion/ruby_llm.rb', line 41 def name = @adapter.name |
#parameters ⇒ Object
44 |
# File 'lib/brute/completion/ruby_llm.rb', line 44 def parameters = {} |
#params_schema ⇒ Object
43 |
# File 'lib/brute/completion/ruby_llm.rb', line 43 def params_schema = @adapter.to_h[:parameters] |
#provider_params ⇒ Object
45 |
# File 'lib/brute/completion/ruby_llm.rb', line 45 def provider_params = {} |