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

Depend on pydantic directly instead of langchain #48

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Jun 8, 2024

Looks like langchain is currently used as a proxy for importing pydantic_v1.

So we can probably depend on pydantic directly and update the imports, to avoid having to depend on langchain.

Copy link
Contributor

github-actions bot commented Jun 8, 2024

Binder 👈 Launch a Binder on branch jtpio/jupyter-chat/langchain-dep

@jtpio jtpio added the maintenance Packaging, tests label Jun 8, 2024
@@ -30,7 +30,7 @@ dependencies = [
"jupyterlab~=4.0",
"traitlets>=5.0",
"deepmerge>=1.0",
"langchain"
"pydantic>=2"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring >=2 as per: https://docs.pydantic.dev/latest/migration/#continue-using-pydantic-v1-features

The Pydantic V2 package also continues to provide access to the Pydantic V1 API by importing through pydantic.v1. For example, you can use the BaseModel class from Pydantic V1 instead of the Pydantic V2 pydantic.BaseModel class:

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jtpio

@brichet brichet merged commit ed3d92e into jupyterlab:main Jun 10, 2024
10 of 11 checks passed
@jtpio jtpio deleted the langchain-dep branch June 10, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Packaging, tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants