Skip to content

Commit

Permalink
update root_validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 3, 2024
1 parent e9a7c79 commit 261229a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/ibm/langchain_ibm/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def lc_secrets(self) -> Dict[str, str]:
"instance_id": "WATSONX_INSTANCE_ID",
}

@root_validator()
@root_validator(pre=False, skip_on_failure=False)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that credentials and python package exists in environment."""
values["url"] = convert_to_secret_str(
Expand Down
2 changes: 1 addition & 1 deletion libs/ibm/langchain_ibm/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Config:
extra = Extra.forbid
arbitrary_types_allowed = True

@root_validator()
@root_validator(pre=False, skip_on_failure=False)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that credentials and python package exists in environment."""
if isinstance(values.get("watsonx_client"), APIClient):
Expand Down
2 changes: 1 addition & 1 deletion libs/ibm/langchain_ibm/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def lc_secrets(self) -> Dict[str, str]:
"instance_id": "WATSONX_INSTANCE_ID",
}

@root_validator()
@root_validator(pre=False, skip_on_failure=False)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that credentials and python package exists in environment."""
if isinstance(values.get("watsonx_model"), (ModelInference, Model)):
Expand Down

0 comments on commit 261229a

Please sign in to comment.