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

community[patch]: Update Embeddings root_validators #23295

Closed

Conversation

maang-h
Copy link
Contributor

@maang-h maang-h commented Jun 22, 2024

This PR updates root validators for:

  • Embeddings: BaichuanTextEmbeddings, QianfanEmbeddingsEndpoint, DashScopeEmbeddings, MiniMaxEmbeddings, SparkLLMTextEmbeddings, VolcanoEmbeddings
  • ChatModels: ChatTongyi, VolcEngineMaasBase

Issues: #22819

Copy link

vercel bot commented Jun 22, 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 Jul 2, 2024 1:47pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. community Related to langchain-community Ɑ: embeddings Related to text embedding models module 🤖:improvement Medium size change to existing code to handle new use-cases labels Jun 22, 2024
@maang-h
Copy link
Contributor Author

maang-h commented Jun 24, 2024

@eyurtsev cc

@eyurtsev eyurtsev self-assigned this Jul 2, 2024
@@ -91,16 +96,25 @@ def validate_environment(cls, values: Dict) -> Dict:
try:
import qianfan

default_values = {
name: field.default
for name, field in cls.__fields__.items()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's hold off on doing this in more places since it also introduces incompatibility with pydantic 1

I'm exploring resolving this using a decorator that automatically populates defaults: #23841

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, then I'll close this pr.

@eyurtsev
Copy link
Collaborator

eyurtsev commented Jul 8, 2024

@maang-h merged the other PR! Going to close this one! Again thanks so much for helping out with this. (We may still need to do this work in the future to get rid of the custom decorator, but for now this paves the way to try and do the pydantic 2 migration.)

@eyurtsev eyurtsev closed this Jul 8, 2024
@maang-h
Copy link
Contributor Author

maang-h commented Jul 9, 2024

@maang-h merged the other PR! Going to close this one! Again thanks so much for helping out with this. (We may still need to do this work in the future to get rid of the custom decorator, but for now this paves the way to try and do the pydantic 2 migration.)

i see.

@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 community Related to langchain-community Ɑ: embeddings Related to text embedding models module 🤖:improvement Medium size change to existing code to handle new use-cases size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants