community[patch]: Update @root_validators to use explicit pre=True or pre=False (#23737)

This commit is contained in:
Eugene Yurtsev
2024-07-02 10:47:21 -04:00
committed by GitHub
parent b664dbcc36
commit 46ff0f7a3c
6 changed files with 15 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ class CohereEmbeddings(BaseModel, Embeddings):
extra = Extra.forbid
@root_validator()
@root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that api key and python package exists in environment."""
cohere_api_key = get_from_dict_or_env(