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

langchain[minor]: Upgrade ambiguous root_validator to @pre_init #24895

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

eyurtsev
Copy link
Collaborator

@eyurtsev eyurtsev commented Jul 31, 2024

The @pre_init validator is a temporary solution for base models. It has similar (but not identical) semantics to @root_validator(), but it works strictly as a pre-init validator.

It'll work as expected as long as the pydantic model type hints were correct.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tormath1 Mathieu Tortuyaux
Copy link

vercel bot commented Jul 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2024 6:41pm

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. langchain Related to the langchain package Ɑ: memory Related to memory module Ɑ: parsing Related to output parser module Ɑ: retriever Related to retriever module 🤖:improvement Medium size change to existing code to handle new use-cases labels Jul 31, 2024
@eyurtsev eyurtsev added the 0.3 prep Work done for 0.3 prep label Jul 31, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 31, 2024
@eyurtsev eyurtsev enabled auto-merge (squash) July 31, 2024 18:45
@eyurtsev eyurtsev merged commit 69c656a into master Jul 31, 2024
53 checks passed
@eyurtsev eyurtsev deleted the eugene/migrate_langchain_to_preinit branch July 31, 2024 18:46
olgamurraft pushed a commit to olgamurraft/langchain that referenced this pull request Aug 16, 2024
…chain-ai#24895)

The @pre_init validator is a temporary solution for base models. It has
similar (but not identical) semantics to @root_validator(), but it works
strictly as a pre-init validator.

It'll work as expected as long as the pydantic model type hints were
correct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.3 prep Work done for 0.3 prep 🤖:improvement Medium size change to existing code to handle new use-cases langchain Related to the langchain package Ɑ: memory Related to memory module Ɑ: parsing Related to output parser module Ɑ: retriever Related to retriever module size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant