Class: Ask::Tools::WebSearch

Inherits:
Ask::Tool
  • Object
show all
Defined in:
lib/ask/web_search/tool.rb

Overview

The native agent tool for web search — the Ask::Tool framing of the library. Consumed WITHOUT MCP by agent frameworks (ask-agent's tool: :web_search, ask-app-server, llm-proxy) that resolve tools from the Ask::Tools registry. A pure adapter: the capability (search, parsing, formatting) lives in Ask::WebSearch, and this file loads only when ask-tools is present (see lib/ask/web_search.rb).

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.searxng_urlObject



14
15
16
# File 'lib/ask/web_search/tool.rb', line 14

def self.searxng_url
  Ask::WebSearch.searxng_url
end

.searxng_url=(url) ⇒ Object



18
19
20
# File 'lib/ask/web_search/tool.rb', line 18

def self.searxng_url=(url)
  Ask::WebSearch.searxng_url = url
end

Instance Method Details

#execute(query:) ⇒ Object



32
33
34
# File 'lib/ask/web_search/tool.rb', line 32

def execute(query:)
  Ask::Result.ok(data: Ask::WebSearch.search(query))
end