Skip to content

The agent engineering platform.

community[patch]: Remove more @allow_reuse=True validators (#25236)

Eugene Yurtsevbd6c31617e1b
diff --git a/libs/community/langchain_community/chat_models/minimax.py b/libs/community/langchain_community/chat_models/minimax.py
index 0b88c2f6c4..b8b47ae838 100644
--- a/libs/community/langchain_community/chat_models/minimax.py
+++ b/libs/community/langchain_community/chat_models/minimax.py
@@ -387,7 +387,7 @@ class MiniMaxChat(BaseChatModel):
class Config:
allow_population_by_field_name = True
- @root_validator(pre=True, allow_reuse=True)
+ @root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that api key and python package exists in environment."""
values["minimax_api_key"] = convert_to_secret_str(
diff --git a/libs/community/langchain_community/document_loaders/github.py b/libs/community/langchain_community/document_loaders/github.py
index e2d4e0fb92..df53ed16c9 100644
--- a/libs/community/langchain_community/document_loaders/github.py
+++ b/libs/community/langchain_community/document_loaders/github.py
@@ -21,7 +21,7 @@ class BaseGitHubLoader(BaseLoader, BaseModel, ABC):
github_api_url: str = "https://api.github.com"
"""URL of GitHub API"""
- @root_validator(pre=True, allow_reuse=True)
+ @root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate that access token exists in environment."""
values["access_token"] = get_from_dict_or_env(
diff --git a/libs/community/langchain_community/embeddings/clova.py b/libs/community/langchain_community/embeddings/clova.py
index 3443363dd3..1e4cecc0ed 100644
--- a/libs/community/langchain_community/embeddings/clova.py
+++ b/libs/community/langchain_community/embeddings/clova.py
@@ -56,7 +56,7 @@ class ClovaEmbeddings(BaseModel, Embeddings):
class Config:
extra = "forbid"
- @root_validator(pre=True, allow_reuse=True)
+ @root_validator(pre=True)
def validate_environment(cls, values: Dict) -> Dict:
"""Validate api key exists in environment."""
values["clova_emb_api_key"] = convert_to_secret_str(
diff --git a/libs/community/langchain_community/llms/minimax.py b/libs/community/langchain_community/llms/minimax.py
index 08b1ec3899..18a71cfdab 100644
--- a/libs/community/langchain_community/llms/minimax.py
+++ b/libs/community/langchain_community/llms/minimax.py
@@ -31,7 +31,7 @@ class _MinimaxEndpointClient(BaseModel):
api_key: SecretStr
api_url: str
- @root_validator(pre=True, allow_reuse=True)
+ @root_validator(pre=True)
def set_api_url(cls, values: Dict[str, Any]) -> Dict[str, Any]:
if "api_url" not in values:
host = values["host"]
diff --git a/libs/community/langchain_community/utilities/powerbi.py b/libs/community/langchain_community/utilities/powerbi.py
index 924e0668d7..0390ffcab0 100644
--- a/libs/community/langchain_community/utilities/powerbi.py
+++ b/libs/community/langchain_community/utilities/powerbi.py
@@ -48,7 +48,7 @@ class PowerBIDataset(BaseModel):
"""Fix the table names."""
return [fix_table_name(table) for table in table_names]
- @root_validator(pre=True, allow_reuse=True)
+ @root_validator(pre=True)
def token_or_credential_present(cls, values: Dict[str, Any]) -> Dict[str, Any]:
"""Validate that at least one of token and credentials is present."""
if "token" in values or "credential" in values: