Thanks to visit codestin.com
Credit goes to github.com

Skip to content

langchain packages compatibility of pydantic #9648

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

Closed
1 task done
dishantsharma1988 opened this issue Jun 12, 2024 · 1 comment
Closed
1 task done

langchain packages compatibility of pydantic #9648

dishantsharma1988 opened this issue Jun 12, 2024 · 1 comment
Labels
bug V2 Bug related to Pydantic V2 pending Is unconfirmed

Comments

@dishantsharma1988
Copy link

Initial Checks

  • I confirm that I'm using Pydantic V2

Description

need a small help from you regarding the version compatibility of packages on my machine . I am having below version of packages installed and facing below error while trying to execute. Can you help me please resolve this issue. Would really appreciate your help.

packages :

pydantic (2.7.3)
langchain ( 0.2.3)
langchain-community (0.2.4)
langchain-core (0.2.5)
langsmith(0.1.76)

Exception:

File "/opt/python3.12/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in run_script
exec(code, module.dict)
File "/home/hayek/ops_assistant/SOP_Validator.py", line 3, in
from langchain.chat_models import AzureChatOpenAI
File "/opt/python3.12/lib/python3.12/site-packages/langchain/chat_models/init.py", line 24, in
from langchain.chat_models.base import init_chat_model
File "/opt/python3.12/lib/python3.12/site-packages/langchain/chat_models/base.py", line 5, in
from langchain_core.language_models.chat_models import (
File "/opt/python3.12/lib/python3.12/site-packages/langchain_core/language_models/init.py", line 25, in
from langchain_core.language_models.base import (
File "/opt/python3.12/lib/python3.12/site-packages/langchain_core/language_models/base.py", line 75, in
class BaseLanguageModel(
File "/opt/python3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 286, in new
cls.try_update_forward_refs()
File "/opt/python3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "/opt/python3.12/lib/python3.12/site-packages/pydantic/v1/typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "/opt/python3.12/lib/python3.12/site-packages/pydantic/v1/typing.py", line 520, in update_field_forward_refs
field.type
= evaluate_forwardref(field.type_, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python3.12/lib/python3.12/site-packages/pydantic/v1/typing.py", line 66, in evaluate_forwardref
return cast(Any, type_)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Example Code

No response

Python, Pydantic & OS Version

[hayek@illin3691 ~]$ python3 -c "import pydantic.version; print(pydantic.version.version_info())"
             pydantic version: 2.7.3
        pydantic-core version: 2.18.4
          pydantic-core build: profile=release pgo=true
                 install path: /opt/python3.12/lib/python3.12/site-packages/pydantic
               python version: 3.12.4 (main, Jun  8 2024, 01:32:03) [GCC 8.5.0 20210514 (Red Hat 8.5.0-16)]
                     platform: Linux-4.18.0-425.3.1.el8.x86_64-x86_64-with-glibc2.28
             related packages: typing_extensions-4.12.2
                       commit: unknown
@dishantsharma1988 dishantsharma1988 added bug V2 Bug related to Pydantic V2 pending Is unconfirmed labels Jun 12, 2024
@samuelcolvin
Copy link
Member

You haven't actually include the error here, but looking at the path, this is probably a duplicate of #9607 and #9607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V2 Bug related to Pydantic V2 pending Is unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants