You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Non-functional Code Examples:
search=DuckDuckGoSearchResults(backend="news", max_results=2)
search.invoke("Obama") # Returns the default 4 resultswrapper=DuckDuckGoSearchAPIWrapper(region="de-de", time="d", max_results=2)
search=DuckDuckGoSearchResults(api_wrapper=wrapper, source="news", max_results=2)
search.invoke("Obama") # Also returns the default 4 results
Error Message and Stack Trace (if applicable)
No response
Description
Hi everyone.
I've been using the DuckDuckGoSearchResults tool to perform internet searches, and I noticed that the max_results argument is not limiting the number of results as expected when used as shown in this part of the documentation: DuckDuckGoSearchResults Documentation.
However, after checking the API reference for the DuckDuckGoSearchResults class, I found that max_results is the field name and there is an alias for this field called num_results which makes it work.
This isn't a critical bug, but I think it is a mismatch between the documentation and the actual code. I'm happy to update it if necessary, but I would like to confirm if I'm correct and what exactly should be updated—whether the documentation to reflect the use of num_results or the tool's data model to accept input via the field name.
Checked other resources
Example Code
Non-functional Code Examples:
Error Message and Stack Trace (if applicable)
No response
Description
Hi everyone.
I've been using the
DuckDuckGoSearchResults
tool to perform internet searches, and I noticed that themax_results
argument is not limiting the number of results as expected when used as shown in this part of the documentation: DuckDuckGoSearchResults Documentation.However, after checking the API reference for the
DuckDuckGoSearchResults
class, I found thatmax_results
is the field name and there is an alias for this field callednum_results
which makes it work.This isn't a critical bug, but I think it is a mismatch between the documentation and the actual code. I'm happy to update it if necessary, but I would like to confirm if I'm correct and what exactly should be updated—whether the documentation to reflect the use of
num_results
or the tool's data model to accept input via the field name.Thanks
System Info
OS: Ubuntu 24.04 LTS
Python 3.11.9
The text was updated successfully, but these errors were encountered: