After downgrading from pydantic v2, pydantic settings v2 to v1 its giving below error. Appreciate if you help to resolve the issue.
2023-12-04 15:52:19.982 Uncaught app exception
Traceback (most recent call last):
File "/Users/genai/anaconda3/envs/langchain/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/Users/genai//Study/langchain/chatbot_app.py", line 10, in
from langchain.document_loaders import PyPDFLoader, DirectoryLoader, PDFMinerLoader
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/init.py", line 6, in
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/init.py", line 31, in
from langchain.agents.agent import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/agent.py", line 14, in
from langchain.agents.agent_iterator import AgentExecutorIterator
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/agent_iterator.py", line 21, in
from langchain.callbacks.manager import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/callbacks/init.py", line 10, in
from langchain.callbacks.aim_callback import AimCallbackHandler
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/callbacks/aim_callback.py", line 5, in
from langchain.schema import AgentAction, AgentFinish, LLMResult
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/init.py", line 19, in
from langchain.schema.output import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/output.py", line 50, in
class ChatGeneration(Generation):
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/output.py", line 59, in ChatGeneration
def set_text(cls, values: Dict[str, Any]) -> Dict[str, Any]:
TypeError: root_validator() takes 0 positional arguments but 1 was given
After downgrading from pydantic v2, pydantic settings v2 to v1 its giving below error. Appreciate if you help to resolve the issue.
2023-12-04 15:52:19.982 Uncaught app exception Traceback (most recent call last): File "/Users/genai/anaconda3/envs/langchain/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script exec(code, module.dict) File "/Users/genai//Study/langchain/chatbot_app.py", line 10, in
from langchain.document_loaders import PyPDFLoader, DirectoryLoader, PDFMinerLoader
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/init.py", line 6, in
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/init.py", line 31, in
from langchain.agents.agent import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/agent.py", line 14, in
from langchain.agents.agent_iterator import AgentExecutorIterator
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/agents/agent_iterator.py", line 21, in
from langchain.callbacks.manager import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/callbacks/init.py", line 10, in
from langchain.callbacks.aim_callback import AimCallbackHandler
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/callbacks/aim_callback.py", line 5, in
from langchain.schema import AgentAction, AgentFinish, LLMResult
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/init.py", line 19, in
from langchain.schema.output import (
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/output.py", line 50, in
class ChatGeneration(Generation):
File "/Users/genai//anaconda3/envs/langchain/lib/python3.10/site-packages/langchain/schema/output.py", line 59, in ChatGeneration
def set_text(cls, values: Dict[str, Any]) -> Dict[str, Any]:
TypeError: root_validator() takes 0 positional arguments but 1 was given