- Notifications
You must be signed in to change notification settings - Fork2.4k
Open
Description
Query Regarding DuckDuckGo Search API Version Compatibility Issues
Title: DuckDuckGo Search API Compatibility Issues Causing "keywords is mandatory" Error
Description:
I'm using theknowledge_storm
library for knowledge retrieval, which integrates DuckDuckGo search functionality, but I'm encountering the following error:
duckduckgo_search.DDGS : INFO : Error to search using html backend: keywords is mandatory ... duckduckgo_search.exceptions.DuckDuckGoSearchException: keywords is mandatory
From the error logs, it appears that the search request is not correctly passing the keyword parameter, ultimately leading to:
AttributeError: 'DuckDuckGoSearchException' object has no attribute 'message'
Environment Details:
- Python Environment: Anaconda
- Relevant Libraries:
knowledge_storm
duckduckgo_search
Observed Issues:
- The code attempts to use
ddgs.text()
for searching. - A deprecation warning appears:
backend='api' is deprecated, using backend='auto'
. - Both
html
andlite
backends fail with the same error. - The final exception thrown is
keywords is mandatory
.
Questions:
- Version Compatibility: Could this be related to the
duckduckgo_search
library version? Which version is currently recommended? - Backend Selection: Should I explicitly set the search backend? Which one is more stable (
html
,lite
, orapi
)? - Error Handling Issue: Is the missing
message
attribute inDuckDuckGoSearchException
a bug in the library or a usage problem? - Alternative Solutions: Are there recommended configurations or alternative approaches to resolve this?
What I've Tried:
- Verified that the query parameters are not empty.
- Checked the
duckduckgo_search
documentation, but version differences make it unclear.
Any guidance on correct configuration or version compatibility would be greatly appreciated!
(If relevant, I'm running this in a Windows environment with Python 3.x.)
Additional Notes:
- If there’s a known workaround or a more stable fork of
duckduckgo_search
, please suggest it. - Should I consider using an alternative search API (e.g., SerpAPI, Google Custom Search) instead?
Thanks in advance for your help!
Metadata
Metadata
Assignees
Labels
No labels