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[patch]: update agent and chains modules root_validators #23256

Merged
merged 17 commits into from
Jun 26, 2024

Conversation

Zizo-Vi
Copy link
Contributor

@Zizo-Vi Zizo-Vi commented Jun 21, 2024

Description: update agent and chains modules Pydantic root_validators.
Issue: the issue #22819

Copy link

vercel bot commented Jun 21, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 1:23am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. Ɑ: agent Related to agents module 🤖:improvement Medium size change to existing code to handle new use-cases labels Jun 21, 2024
@Zizo-Vi
Copy link
Contributor Author

Zizo-Vi commented Jun 21, 2024

@eyurtsev Please review, thx!

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 21, 2024
@Zizo-Vi Zizo-Vi changed the title agent: update agent root_validators agent/chains[patch]: update agent and chains modules root_validators Jun 21, 2024
@eyurtsev eyurtsev self-assigned this Jun 21, 2024
Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

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

Hi @wenmengzhou thanks for the contribution!

Could you review the semantics of pre=True. When pre=True, the code cannot assume that any keys exist in values even ones that have default values. I pointed two places that will crash with a KeyError.

@Zizo-Vi
Copy link
Contributor Author

Zizo-Vi commented Jun 21, 2024

Hi @wenmengzhou thanks for the contribution!

Could you review the semantics of pre=True. When pre=True, the code cannot assume that any keys exist in values even ones that have default values. I pointed two places that will crash with a KeyError.

Hi @eyurtsev, thx for pointing out this issue, I will fix it!

@Zizo-Vi
Copy link
Contributor Author

Zizo-Vi commented Jun 21, 2024

@eyurtsev please review again, thanks!

@Zizo-Vi Zizo-Vi requested a review from eyurtsev June 21, 2024 15:40
@ccurme ccurme added the langchain Related to the langchain package label Jun 21, 2024
Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

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

@wenngong I'm going to push a few changes to this PR right now.

Thanks for the work! If you're doing more changes, could you keep a PR to no more than ~5 root validators. It'll help to get the PR reviewed and merged quickly!

libs/langchain/langchain/agents/agent.py Show resolved Hide resolved
libs/langchain/langchain/agents/agent.py Show resolved Hide resolved
libs/langchain/langchain/agents/agent.py Show resolved Hide resolved
libs/langchain/langchain/agents/agent.py Outdated Show resolved Hide resolved
libs/langchain/langchain/chains/sequential.py Show resolved Hide resolved
libs/langchain/langchain/chains/combine_documents/stuff.py Outdated Show resolved Hide resolved
libs/langchain/langchain/chains/moderation.py Show resolved Hide resolved
libs/langchain/langchain/chains/sequential.py Outdated Show resolved Hide resolved
libs/langchain/langchain/chains/base.py Show resolved Hide resolved
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jun 25, 2024
@eyurtsev eyurtsev changed the title agent/chains[patch]: update agent and chains modules root_validators langchain[patch]: update agent and chains modules root_validators Jun 25, 2024
@eyurtsev eyurtsev enabled auto-merge (squash) June 25, 2024 13:56
@Zizo-Vi
Copy link
Contributor Author

Zizo-Vi commented Jun 25, 2024

@wenngong I'm going to push a few changes to this PR right now.

Thanks for the work! If you're doing more changes, could you keep a PR to no more than ~5 root validators. It'll help to get the PR reviewed and merged quickly!

@eyurtsev Thanks! I will follow your suggestion.

auto-merge was automatically disabled June 25, 2024 15:00

Head branch was pushed to by a user without write access

@Zizo-Vi
Copy link
Contributor Author

Zizo-Vi commented Jun 26, 2024

@ccurme we can merge this pr now, Thx!

@eyurtsev eyurtsev merged commit 3bf1d98 into langchain-ai:master Jun 26, 2024
73 checks passed
@eyurtsev eyurtsev added the 0.3 prep Work done for 0.3 prep label Jul 31, 2024
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 Ɑ: agent Related to agents module 🤖:improvement Medium size change to existing code to handle new use-cases langchain Related to the langchain package lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants