mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 23:13:31 +00:00
community[patch]: root validator set explicit pre=False or pre=True (#23764)
See issue: https://github.com/langchain-ai/langchain/issues/22819
This commit is contained in:
@@ -51,7 +51,7 @@ class DALMFilter(BaseModel):
|
||||
value: str
|
||||
_is_metadata: bool = False
|
||||
|
||||
@root_validator()
|
||||
@root_validator(pre=True)
|
||||
def set_meta(cls, values: Dict) -> Dict:
|
||||
"""document and name are reserved arcee keys. Anything else is metadata"""
|
||||
values["_is_meta"] = values.get("field_name") not in ["document", "name"]
|
||||
|
Reference in New Issue
Block a user