-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Error when importing ChatOutputParser: no validator found for <class 're.Pattern'> #8158
Comments
@SpaceDandy13 How did you resolve the problem eventually? I keep getting this error. |
I just use the old version. |
@SpaceDandy13 which version did you use, please can you share the version number, even I am getting similar error. I have tried couple of older versions. |
Was getting same issue right now with v. 0.0.142 |
Changing the version to pydantic==1.10.8 worked for me using a flask api in pythonanywhere |
I am still getting this error even when installing pydantic 1.10.8 I was wondering if there is anything else I should do? |
I had the exact same issue and was working with Jupyter Notebook. |
After downgrading to 1.10.12 this error went away for me. Using poetry:
|
Hi, @SpaceDandy13, I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue involves a runtime error when importing the ChatOutputParser module due to a missing validator for the re.Pattern class. It seems that the problem has been resolved by downgrading or upgrading the pydantic package to version 1.10.8. Additionally, switching IDEs or downgrading to pydantic version 1.10.12 has also resolved the issue for some users. Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you for your understanding and cooperation. |
System Info
from langchain.agents.chat.output_parser import ChatOutputParser
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/init.py", line 6, in
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/init.py", line 10, in
from langchain.agents.agent_toolkits import (
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/agent_toolkits/init.py", line 6, in
from langchain.agents.agent_toolkits.csv.base import create_csv_agent
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/agent_toolkits/csv/base.py", line 4, in
from langchain.agents.agent_toolkits.pandas.base import create_pandas_dataframe_agent
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/agent_toolkits/pandas/base.py", line 18, in
from langchain.agents.types import AgentType
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/types.py", line 5, in
from langchain.agents.chat.base import ChatAgent
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/chat/base.py", line 6, in
from langchain.agents.chat.output_parser import ChatOutputParser
File "/home/ubuntu/chatpdf/Backend/backenv/lib/python3.10/site-packages/langchain/agents/chat/output_parser.py", line 12, in
class ChatOutputParser(AgentOutputParser):
File "pydantic/main.py", line 229, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 491, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 421, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 542, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 804, in pydantic.fields.ModelField.populate_validators
File "pydantic/validators.py", line 723, in find_validators
RuntimeError: no validator found for <class 're.Pattern'>, see
arbitrary_types_allowed
in ConfigWho can help?
No response
Information
Related Components
Reproduction
from langchain.agents.chat.output_parser import ChatOutputParser
Expected behavior
Import corrrectly.
The text was updated successfully, but these errors were encountered: