Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duckduckgo_search UserWarning: 'api' backend is deprecated, using backend='auto' #28957

Open
5 tasks done
qaiwiz opened this issue Dec 29, 2024 · 1 comment
Open
5 tasks done

Comments

@qaiwiz
Copy link

qaiwiz commented Dec 29, 2024

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

from langchain_community.tools import DuckDuckGoSearchRun
search = DuckDuckGoSearchRun()
search.invoke("Obama's first name?")

Error Message and Stack Trace (if applicable)

/root/python3.10/lib/python3.11/site-packages/langchain_community/utilities/duckduckgo_search.py:64: UserWarning: 'api' backend is deprecated, using backend='auto'
ddgs_gen = ddgs.text(
Obama's father, Barack Obama, Sr., was a teenage goatherd in rural Kenya, won a scholarship to study in the United States, and eventually became a senior economist in the Kenyan government.Obama's mother, S. Ann Dunham, grew up in Kansas, Texas, and Washington state before her family settled in Honolulu.In 1960 she and Barack Sr. met in a ...

Description

I am using duckduckgo_search to give internet access to llm. It is working fine, but there is error which can be easily removed. It only suffice to change:

backend: str = "api"
"""
Options: api, html, lite

to

backend: str = "auto"
"""
Options: auto, html, lite

System Info

python -m langchain_core.sys_info

System Information

OS: Linux
OS Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01)
Python Version: 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0]

Package Information

langchain_core: 0.3.28
langchain: 0.3.13
langchain_community: 0.3.13
langsmith: 0.2.6
langchain_openai: 0.2.14
langchain_text_splitters: 0.3.4

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.11.11
async-timeout: Installed. No version info available.
dataclasses-json: 0.6.7
httpx: 0.28.1
httpx-sse: 0.4.0
jsonpatch: 1.33
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.4
openai: 1.58.1
orjson: 3.10.12
packaging: 24.2
pydantic: 2.10.4
pydantic-settings: 2.7.0
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.36
tenacity: 9.0.0
tiktoken: 0.8.0
typing-extensions: 4.12.2
zstandard: Installed. No version info available.

@matemiro
Copy link

It depends on which duckduckgo_search version you use.

There is also new possible value ecosia, which was added in version 7.1.0.
api was deprecated in 7.1.1.

From 7.1.1 all possible options are: auto, html, lite and ecosia.

ccurme pushed a commit that referenced this issue Jan 2, 2025
…to `auto` (#28961)

- **Description:** `DuckDuckGoSearchAPIWrapper` default value for
backend has been changed to avoid User Warning
- **Issue:** #28957
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants