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.