pydantic.errors.PydanticUserError: If you use `@root_validator`

报错

使用langchain时,import langchain时报错内容如下:

python 复制代码
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.
 
For further information visit https://errors.pydantic.dev/2.7/u/root-validator-pre-skip

解决

pydantic的版本问题,将pydantic库的版本降低到1.10.13,pydantic_core等相关依赖库的版本也会自动降低。

python 复制代码
pip install pydantic==1.10.13 -i  https://pypi.tuna.tsinghua.edu.cn/simple
相关推荐
背太阳的牧羊人1 天前
RAG检索中使用一个 长上下文重排序器(Long Context Reorder) 对检索到的文档进行进一步的处理和排序,优化输出顺序
开发语言·人工智能·python·langchain·rag
Java知识技术分享1 天前
使用LangChain构建第一个ReAct Agent
python·react.js·ai·语言模型·langchain
圆内~搁浅2 天前
langchain本地知识库问答机器人集成本地知识库
数据库·langchain·机器人
Neo很努力3 天前
【deepseek】本地部署+RAG知识库挂载+对话测试
自然语言处理·chatgpt·langchain·aigc·llama
merlin-mm3 天前
langchain应用-agent
langchain
朴拙数科4 天前
Langchain vs. LlamaIndex:哪个在集成MongoDB并分析资产负债表时效果更好?
数据库·mongodb·langchain
静静的喝酒7 天前
langchain学习笔记之消息存储在内存中的实现方法
langchain·消息存储·内存存储
Rickie7 天前
DeepSeek-V3 解读:优化效率与规模
langchain·rag·deepseek
少林码僧7 天前
1.5 企业级AI大模型四阶技术全景解析:从Prompt到Pre-training的进化路径
人工智能·gpt·chatgpt·langchain·prompt
Clang's Blog10 天前
使用 LangChain 对接硅基流动(SiliconFlow)API:构建一个智能对话系统
langchain