Skip to main content

llama-index tools integrating DuckDuckGo search

Project description

DuckDuckGo Search Tool

This tool enables agents to search and retrieve results from the DuckDuckGo search engine. It utilizes the duckduckgo_search package, which either fetches instant query answers from DuckDuckGo or conducts a full search and parses the results.

Usage

This tool has a more extensive example usage documented in a Jupyter notebook here

Here's an example usage of the DuckDuckGoSearchToolSpec.

from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = DuckDuckGoSearchToolSpec()

agent = FunctionAgent(
    tools=DuckDuckGoSearchToolSpec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("What's going on with the superconductor lk-99"))
print(await agent.run("what are the latest developments in machine learning"))

Available tool functions:

  • duckduckgo_instant_search: Make a query to DuckDuckGo api to receive an instant answer.

  • duckduckgo_full_search: Make a query to DuckDuckGo search to receive a full search results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_duckduckgo-0.4.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_tools_duckduckgo-0.4.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_duckduckgo-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_duckduckgo-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f76e82cbef88733cb75ed05c760a33402c1161920b14aa5fd673e72ffc9bf490
MD5 2f2fa69aec2fe5c567a1e53e3cf72174
BLAKE2b-256 54c22d6f51a0ca650eff79ea4518a558484842bff12cc3e16b7d2b71c5bb218f

See more details on using hashes here.

File details

Details for the file llama_index_tools_duckduckgo-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_duckduckgo-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 380efcc46200f972019b116d6723909279b2e2d210feb54d54a42406c2ff6e43
MD5 f2e3590248b61dd662eee543893db437
BLAKE2b-256 a2cd8cc3bbdc123833dbbde2f871e7d12d53927956a1a12702882b121287994a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page