From f79ee7092ad7ce00efeb6d6447bdb38773699675 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 3 Jul 2023 17:35:44 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(validate.py):=20update=20inp?= =?UTF-8?q?ut=5Ftypes=20in=20template=5Ffield=20to=20["Document",=20"BaseO?= =?UTF-8?q?utputParser"]=20for=20better=20accuracy=20=F0=9F=90=9B=20fix(ba?= =?UTF-8?q?se.py):=20remove=20"object"=20from=20CLASSES=5FTO=5FREMOVE=20li?= =?UTF-8?q?st=20to=20prevent=20unnecessary=20removal=20In=20validate.py,?= =?UTF-8?q?=20the=20input=5Ftypes=20in=20the=20template=5Ffield=20for=20th?= =?UTF-8?q?e=20"prompt"=20variable=20is=20updated=20to=20["Document",=20"B?= =?UTF-8?q?aseOutputParser"]=20to=20accurately=20reflect=20the=20expected?= =?UTF-8?q?=20input=20types.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In base.py, the "object" class is removed from the CLASSES_TO_REMOVE list to prevent unnecessary removal of the "object" class from the FrontendNode class inheritance. --- src/backend/langflow/api/v1/validate.py | 2 +- src/backend/langflow/template/frontend_node/base.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/api/v1/validate.py b/src/backend/langflow/api/v1/validate.py index 23fad5711..96900edb7 100644 --- a/src/backend/langflow/api/v1/validate.py +++ b/src/backend/langflow/api/v1/validate.py @@ -43,7 +43,7 @@ def post_validate_prompt(prompt: ValidatePromptRequest): field_type="str", show=True, advanced=False, - input_types=["BaseLoader", "BaseOutputParser"], + input_types=["Document", "BaseOutputParser"], ) prompt.frontend_node.template[variable] = template_field.to_dict() diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index 55773db72..ebe493e08 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -8,7 +8,7 @@ from langflow.template.field.base import TemplateField from langflow.template.template.base import Template from langflow.utils import constants -CLASSES_TO_REMOVE = ["Serializable", "BaseModel"] +CLASSES_TO_REMOVE = ["Serializable", "BaseModel", "object"] class FrontendNode(BaseModel):