Class: Assistant::WebSearchToolBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/services/assistant/web_search_tool_builder.rb

Overview

Builds the web_search RubyLLM::Tool for finding pages on the public web.

The search itself is delegated to Heatwave::WebSearch (Oxylabs parsed
Google SERP). This tool returns organic results only — titles, URLs, and
snippets for relevance triage; reading a result is the fetch_url tool's
job (Heatwave::Crawler), so the pair composes: search finds, fetch reads.

Usage (via ChatToolBuilder):
tools = Assistant::WebSearchToolBuilder.tools

Class Method Summary collapse

Class Method Details

.toolsArray<RubyLLM::Tool>

Returns the web_search tool(s).

Returns:

  • (Array<RubyLLM::Tool>)

    the web_search tool(s)



17
18
19
20
21
22
# File 'app/services/assistant/web_search_tool_builder.rb', line 17

def tools
  @tools ||= [build_web_search_tool]
rescue StandardError => e
  Rails.logger.warn("[WebSearchToolBuilder] Failed to build web_search tools: #{e.message}")
  []
end