Class: Brute::Completion::RubyLLM::Tool

Inherits:
Object
  • Object
show all
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

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)

#descriptionObject



42
# File 'lib/brute/completion/ruby_llm.rb', line 42

def description     = @adapter.description

#nameObject



41
# File 'lib/brute/completion/ruby_llm.rb', line 41

def name            = @adapter.name

#parametersObject



44
# File 'lib/brute/completion/ruby_llm.rb', line 44

def parameters      = {}

#params_schemaObject



43
# File 'lib/brute/completion/ruby_llm.rb', line 43

def params_schema   = @adapter.to_h[:parameters]

#provider_paramsObject



45
# File 'lib/brute/completion/ruby_llm.rb', line 45

def provider_params = {}