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

Update requirements.txt for pydantic fix (langchain report) #40

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

sandys
Copy link
Contributor

@sandys sandys commented Aug 31, 2023

based on this bug report langchain-ai/langchain#8158, we have to pin the version of pydantic.
if not, it continuously gives the following error

user@Arrakis:~/Code/arakoo/gpt-migrate/gpt_migrate$ python main.py --targetlang nodejs --sourcedir /home/user/Code/arakoo/EdgeChains/FlySpring/  --targetdir java
Traceback (most recent call last):
  File "/home/user/Code/arakoo/gpt-migrate/gpt_migrate/main.py", line 7, in <module>
    from ai import AI
  File "/home/user/Code/arakoo/gpt-migrate/gpt_migrate/ai.py", line 1, in <module>
    from langchain.chat_models import ChatOpenAI
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/__init__.py", line 6, in <module>
    from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/__init__.py", line 40, in <module>
    from langchain.agents.agent_toolkits import (
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/agent_toolkits/__init__.py", line 13, in <module>
    from langchain.agents.agent_toolkits.csv.base import create_csv_agent
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/agent_toolkits/csv/base.py", line 4, in <module>
    from langchain.agents.agent_toolkits.pandas.base import create_pandas_dataframe_agent
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/agent_toolkits/pandas/base.py", line 18, in <module>
    from langchain.agents.types import AgentType
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/types.py", line 5, in <module>
    from langchain.agents.chat.base import ChatAgent
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/chat/base.py", line 4, in <module>
    from langchain.agents.chat.output_parser import ChatOutputParser
  File "/home/user/Code/miniconda3/lib/python3.10/site-packages/langchain/agents/chat/output_parser.py", line 12, in <module>
    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 Config

based on this bug report
@joshpxyne joshpxyne merged commit 0235359 into joshpxyne:main Sep 7, 2023
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

Successfully merging this pull request may close these issues.

2 participants