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

Compatibility with pydantic v2.10+ #613

Closed
yeesian opened this issue Nov 22, 2024 · 9 comments · Fixed by #696
Closed

Compatibility with pydantic v2.10+ #613

yeesian opened this issue Nov 22, 2024 · 9 comments · Fixed by #696

Comments

@yeesian
Copy link

yeesian commented Nov 22, 2024

Details in #610 (comment)

@Viicos
Copy link

Viicos commented Nov 22, 2024

I've opened googleapis/python-aiplatform#4701.

@ostefano
Copy link
Contributor

ostefano commented Jan 8, 2025

Hi @yeesian , I see that python-aiplatform v1.76.0 has been released (thank you btw 🙏).

Does that mean we could remove the pydantic constraint and bump langchain-google-*?

@yeesian
Copy link
Author

yeesian commented Jan 8, 2025

Does that mean we could remove the pydantic constraint and bump langchain-google-*?

I tried (in an adhoc fashion using pip to force install the latest version of pydantic) and it worked for me (with google-cloud-aiplatform==1.76, but not 1.75).

If you're willing, can you give it a shot and let me know if it worked for you too?

If so, I think the upper bound in

pydantic = ">=2.9,<2.10"
can be lifted @lkuligin

@ostefano
Copy link
Contributor

ostefano commented Jan 8, 2025

@yeesian is there a specific test I can run to verify everything works as expected or instantiating VertexAiEmbedding (by invoking the API retrieving the embedding) would the best approach?

@ostefano
Copy link
Contributor

@yeesian @lkuligin I am done running all our integration tests, and everything seems to be working all right when using google-cloud-aiplatform==1.76 and pydantic==2.10.4.

[tool.uv]
package = true
override-dependencies = [
    # Package 'google-cloud-aiplatform' is not compatible with modern pydantic >2.10
    #   see https://github.com/langchain-ai/langchain-google/issues/613
    #   see https://github.com/googleapis/python-aiplatform/pull/4701
    # However version '1.76' should be compatible even though the dependency has not been bumped yet
    # Here we force it so we can test it
    #   see https://github.com/langchain-ai/langchain-google/issues/613#issuecomment-2578383795
    "google-cloud-aiplatform==1.76",
    "pydantic==2.10.4",
]

Can we lift the upper bound here https://github.com/langchain-ai/langchain-google/blob/main/libs/vertexai/pyproject.toml and do a new release?

@NuniTelo
Copy link

Hi! We are having this issue even with pydantic v1. Is there any way to fix it? We are stuck at the moment.

@ostefano
Copy link
Contributor

Hi! We are having this issue even with pydantic v1. Is there any way to fix it? We are stuck at the moment.

Unlikely the lower bound can be adjusted since pydantic v2 seems to be the minimum supported version ">=2.9,<2.10".

@ostefano
Copy link
Contributor

ostefano commented Jan 15, 2025

@lkuligin added PR here to ease the process: #696

@ostefano
Copy link
Contributor

Just noticed that #693 has also been opened.

Modulo the updated google-cloud-aiplatform>=1.76.0, both PRs do the same.

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 a pull request may close this issue.

4 participants