From c83060ed58b64000e29ccd7dffaa574ff4d3ff2b Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 25 Jul 2023 14:21:43 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(base.py):=20import=20CLASSES?= =?UTF-8?q?=5FTO=5FREMOVE=20constant=20from=20constants=20module=20to=20fi?= =?UTF-8?q?x=20NameError=20=F0=9F=94=80=20chore(constants.py):=20add=20CLA?= =?UTF-8?q?SSES=5FTO=5FREMOVE=20constant=20to=20store=20classes=20to=20be?= =?UTF-8?q?=20removed=20from=20base.py=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/template/frontend_node/base.py | 7 ++++--- src/backend/langflow/template/frontend_node/constants.py | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index 6241e709e..d6d9f911a 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -5,13 +5,14 @@ from typing import List, Optional from pydantic import BaseModel, Field from langflow.template.frontend_node.formatter import field_formatters -from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS +from langflow.template.frontend_node.constants import ( + CLASSES_TO_REMOVE, + FORCE_SHOW_FIELDS, +) from langflow.template.field.base import TemplateField from langflow.template.template.base import Template from langflow.utils import constants -CLASSES_TO_REMOVE = ["Serializable", "BaseModel", "object"] - class FieldFormatters(BaseModel): formatters = { diff --git a/src/backend/langflow/template/frontend_node/constants.py b/src/backend/langflow/template/frontend_node/constants.py index 295995586..670fcb3fb 100644 --- a/src/backend/langflow/template/frontend_node/constants.py +++ b/src/backend/langflow/template/frontend_node/constants.py @@ -62,3 +62,6 @@ You can change this to use other APIs like JinaChat, LocalAI and Prem. INPUT_KEY_INFO = """The variable to be used as Chat Input when more than one variable is available.""" OUTPUT_KEY_INFO = """The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)""" + + +CLASSES_TO_REMOVE = ["Serializable", "BaseModel", "object"]