-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
DuckDuckGoSearchRun leads to AttributeError: 'FieldInfo' object has no attribute 'run' #27184
Comments
Hi! I represent a team of Computer Science students who are looking to gain experience working with large software systems. We would like to claim this issue to work on. |
Hi @m-henneke, we have started looking into the issue and we are unable to replicate this issue on the latest version. We are on langchain version 0.3.3, langchain-community version 0.3.2 and duckduckgo-search version 6.3.0. Could you try updating to these versions and see if you are still getting the same error? |
Hi @JamieHvizdos, thanks for your suggestion. DDG-search works again with langchain 0.3.3 and langchain-community 0.3.2! As a side note for others, there may have been a problem with my langchain-core installation (possibly 0.3.9) as shown above in the package info. Not sure if this caused the problem, but I had to create a new env to upgrade the packages.
|
any update on this? |
I have the same issue as well. |
Also, I was receiving this warning: LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain.pydantic_v1 module was a compatibility shim for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly. For example, replace imports like: So I did this in the tool.py inside langchain_experimental-> tools -> python and it worked fine. |
Checked other resources
Example Code
from langchain_community.tools import DuckDuckGoSearchRun
tool = DuckDuckGoSearchRun()
tool.invoke("Size of Eifel tower")
Error Message and Stack Trace (if applicable)
Traceback (most recent call last):
File "/opt/conda/envs/my_env/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
tool.invoke("Size of Eifel tower")
File "/opt/conda/envs/my_env/lib/python3.11/site-packages/langchain_core/tools/base.py", line 397, in invoke
return self.run(tool_input, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/my_env/lib/python3.11/site-packages/langchain_core/tools/base.py", line 586, in run
raise error_to_raise
File "/opt/conda/envs/my_env/lib/python3.11/site-packages/langchain_core/tools/base.py", line 555, in run
response = context.run(self._run, *tool_args, **tool_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/my_env/lib/python3.11/site-packages/langchain_community/tools/ddg_search/tool.py", line 73, in _run
return self.api_wrapper.run(query)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FieldInfo' object has no attribute 'run'
Description
I'm trying to run a DuckDuckGo-search using langchaing_community.
Since updating to the latest pypi versions (langchain==0.3.2 and langchain_community==0.3.1), this error is returned.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: