Class: Assistant::WebFetchToolBuilder
- Inherits:
-
Object
- Object
- Assistant::WebFetchToolBuilder
- Defined in:
- app/services/assistant/web_fetch_tool_builder.rb
Overview
Builds the fetch_url RubyLLM::Tool for retrieving web page content.
The fetch itself is delegated to Heatwave::Crawler (mode: :auto):
direct HTTP → dedicated Amazon scrape → Oxylabs render → Oxylabs
residential, with main-content (readability) extraction to Markdown
before the 60K content cap. PDF URLs are handled here because they are
LLM-specific: the bytes are handed to Claude for full-text extraction.
Usage (via ChatToolBuilder):
tools = Assistant::WebFetchToolBuilder.tools
Class Method Summary collapse
-
.tools ⇒ Array<RubyLLM::Tool>
The fetch_url tool(s).
Class Method Details
.tools ⇒ Array<RubyLLM::Tool>
Returns the fetch_url tool(s).
18 19 20 21 22 23 |
# File 'app/services/assistant/web_fetch_tool_builder.rb', line 18 def tools @tools ||= [build_fetch_url_tool] rescue StandardError => e Rails.logger.warn("[WebFetchToolBuilder] Failed to build web_fetch tools: #{e.}") [] end |