A tool that performs a web search and returns results. Uses DuckDuckGo's HTML search results by default.
Format
A tool definition created with ellmer::tool().
Details
This tool searches the web using DuckDuckGo and returns a list of results with titles, URLs, and snippets. For more sophisticated search needs, consider using a dedicated search API.
Examples
if (FALSE) { # \dontrun{
agent <- Agent$new(
chat = ellmer::chat("openai/gpt-4o"),
tools = list(tool_web_search),
permissions = Permissions$new(web = TRUE)
)
} # }