Skip to content

Commit c0456de

Browse files
committed
duckduckgo-search is renamed to ddgs
Currently, I am seeing warnings like: ``` /Users/bas.nijholt/agent-cli/.venv/lib/python3.11/site-packages/pydantic_ai/common_tools/duckduckgo.py:68: RuntimeWarning: This package (`duckduckgo_search`) has been renamed to `ddgs`! Use `pip install ddgs` instead. DuckDuckGoSearchTool(client=duckduckgo_client or DDGS(), max_results=max_results).__call__, ```
1 parent d5ff4a1 commit c0456de

File tree

5 files changed

+34
-31
lines changed

5 files changed

+34
-31
lines changed

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pip/uv-add "pydantic-ai-slim[openai]"
5454
* `groq` — installs `groq` [PyPI ↗](https://pypi.org/project/groq){:target="_blank"}
5555
* `mistral` — installs `mistralai` [PyPI ↗](https://pypi.org/project/mistralai){:target="_blank"}
5656
* `cohere` - installs `cohere` [PyPI ↗](https://pypi.org/project/cohere){:target="_blank"}
57-
* `duckduckgo` - installs `duckduckgo-search` [PyPI ↗](https://pypi.org/project/duckduckgo-search){:target="_blank"}
57+
* `duckduckgo` - installs `ddgs` [PyPI ↗](https://pypi.org/project/ddgs){:target="_blank"}
5858
* `tavily` - installs `tavily-python` [PyPI ↗](https://pypi.org/project/tavily-python){:target="_blank"}
5959

6060
See the [models](models/index.md) documentation for information on which optional dependencies are required for each model.

docs/tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ If you'd like to use a tool from LangChain's [community tool library](https://py
732732

733733
You will need to install the `langchain-community` package and any others required by the tool in question.
734734

735-
Here is how you can use the LangChain `DuckDuckGoSearchRun` tool, which requires the `duckduckgo-search` package:
735+
Here is how you can use the LangChain `DuckDuckGoSearchRun` tool, which requires the `ddgs` package:
736736

737737
```python {test="skip"}
738738
from langchain_community.tools import DuckDuckGoSearchRun

pydantic_ai_slim/pydantic_ai/common_tools/duckduckgo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
from pydantic_ai.tools import Tool
1010

1111
try:
12-
from duckduckgo_search import DDGS
12+
try:
13+
from ddgs import DDGS
14+
except ImportError: # Fallback for older versions of ddgs
15+
from duckduckgo_search import DDGS
1316
except ImportError as _import_error:
1417
raise ImportError(
15-
'Please install `duckduckgo-search` to use the DuckDuckGo search tool, '
18+
'Please install `ddgs` to use the DuckDuckGo search tool, '
1619
'you can use the `duckduckgo` optional group — `pip install "pydantic-ai-slim[duckduckgo]"`'
1720
) from _import_error
1821

pydantic_ai_slim/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ groq = ["groq>=0.19.0"]
7070
mistral = ["mistralai>=1.2.5"]
7171
bedrock = ["boto3>=1.37.24"]
7272
# Tools
73-
duckduckgo = ["duckduckgo-search>=7.0.0"]
73+
duckduckgo = ["ddgs>=9.0.0"]
7474
tavily = ["tavily-python>=0.5.0"]
7575
# CLI
7676
cli = ["rich>=13", "prompt-toolkit>=3", "argcomplete>=3.5.0"]

uv.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)