From ab3e0f08fc720d6738f5b0831a7d91c6ce88d251 Mon Sep 17 00:00:00 2001 From: Tiago Santana <54704492+SantanaTiago@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:18:10 +0000 Subject: [PATCH] fix target-settings model validator Signed-off-by: Tiago Santana <54704492+SantanaTiago@users.noreply.github.com> --- deepsearch/documents/core/models.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/deepsearch/documents/core/models.py b/deepsearch/documents/core/models.py index 1ea3bdaa..97ae8290 100644 --- a/deepsearch/documents/core/models.py +++ b/deepsearch/documents/core/models.py @@ -184,10 +184,7 @@ class TargetSettings(BaseModel): add_annotations: Optional[bool] = None @model_validator(mode="after") - @classmethod - def check_raw_or_ann(cls, values): - if (values.get("add_raw_pages") is None) and ( - values.get("add_annotations") is None - ): + def check_raw_or_ann(self): + if self.add_raw_pages is None and self.add_annotations is None: raise ValueError("either 'add_raw_pages' or 'add_annotations' is required") - return values + return self