duckduckgo_search_tool
langroid/agent/tools/duckduckgo_search_tool.py
A tool to trigger a DuckDuckGo search for a given query, and return the top results with
their titles, links, summaries. Since the tool is stateless (i.e. does not need
access to agent state), it can be enabled for any agent, without having to define a
special method inside the agent: agent.enable_message(DuckduckgoSearchTool)
DuckduckgoSearchTool
¶
Bases: ToolMessage
handle()
¶
Conducts a search using DuckDuckGo based on the provided query and number of results by triggering a duckduckgo_search.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string containing the titles, links, and summaries of each search result, separated by two newlines. |