Mojentic.LLM.Tools.WebSearchTool (Mojentic v1.2.0)

Copy Markdown View Source

Tool for searching the web using DuckDuckGo.

This tool searches DuckDuckGo's lite endpoint and returns organic search results. It does not require an API key, making it a free alternative to paid search APIs.

Examples

alias Mojentic.LLM.Tools.WebSearchTool

tool = WebSearchTool.new()
{:ok, results} = WebSearchTool.run(tool, %{"query" => "Elixir programming"})
# => {:ok, [%{title: "...", url: "...", snippet: "..."}]}

Configuration

You can optionally configure the HTTP client for testing:

tool = WebSearchTool.new(http_client: MyHTTPClient)

Summary

Functions

Creates a new WebSearchTool instance.

Functions

new(opts \\ [])

Creates a new WebSearchTool instance.

Options

  • :http_client - Optional HTTP client module for testing (defaults to HTTPoison or configured client)