Class: CircuitBreaker::Executors::LLM::SearchTool

Inherits:
Tool
  • Object
show all
Defined in:
lib/circuit_breaker/executors/llm/tools.rb

Overview

Example built-in tools

Instance Attribute Summary

Attributes inherited from Tool

#description, #name, #parameters

Instance Method Summary collapse

Methods inherited from Tool

#to_h

Constructor Details

#initializeSearchTool

Returns a new instance of SearchTool.



58
59
60
61
62
63
64
65
66
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 58

def initialize
  super(
    name: 'search',
    description: 'Search for information on a given topic',
    parameters: {
      query: { type: 'string', description: 'The search query' }
    }
  )
end

Instance Method Details

#execute(query:) ⇒ Object



68
69
70
71
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 68

def execute(query:)
  # Implement actual search logic here
  { results: "Search results for: #{query}" }
end