diff --git a/src/backend/langflow/template/base.py b/src/backend/langflow/template/base.py deleted file mode 100644 index 8b1378917..000000000 --- a/src/backend/langflow/template/base.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/backend/langflow/template/fields.py b/src/backend/langflow/template/fields.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/backend/langflow/template/frontend_node/base.py b/src/backend/langflow/template/frontend_node/base.py index cb762f28e..a64195813 100644 --- a/src/backend/langflow/template/frontend_node/base.py +++ b/src/backend/langflow/template/frontend_node/base.py @@ -3,7 +3,7 @@ from typing import List, Optional from pydantic import BaseModel -from langflow.template.constants import FORCE_SHOW_FIELDS +from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS from langflow.template.field.base import TemplateField from langflow.template.template.base import Template from langflow.utils import constants diff --git a/src/backend/langflow/template/constants.py b/src/backend/langflow/template/frontend_node/constants.py similarity index 100% rename from src/backend/langflow/template/constants.py rename to src/backend/langflow/template/frontend_node/constants.py diff --git a/src/backend/langflow/template/frontend_node/prompts.py b/src/backend/langflow/template/frontend_node/prompts.py index 7d7b1cde2..8738f1795 100644 --- a/src/backend/langflow/template/frontend_node/prompts.py +++ b/src/backend/langflow/template/frontend_node/prompts.py @@ -2,7 +2,11 @@ from typing import Optional from langchain.agents.mrkl import prompt -from langflow.template.constants import DEFAULT_PROMPT, HUMAN_PROMPT, SYSTEM_PROMPT +from langflow.template.frontend_node.constants import ( + DEFAULT_PROMPT, + HUMAN_PROMPT, + SYSTEM_PROMPT, +) from langflow.template.field.base import TemplateField from langflow.template.frontend_node.base import FrontendNode from langflow.template.template.base import Template diff --git a/src/backend/langflow/template/frontend_node/utilities.py b/src/backend/langflow/template/frontend_node/utilities.py index 77d01a23e..615d7d12f 100644 --- a/src/backend/langflow/template/frontend_node/utilities.py +++ b/src/backend/langflow/template/frontend_node/utilities.py @@ -1,3 +1,4 @@ +import ast import json from typing import Optional @@ -12,7 +13,7 @@ class UtilitiesFrontendNode(FrontendNode): # field.field_type could be "Literal['news', 'search', 'places', 'images'] # we need to convert it to a list if "Literal" in field.field_type: - field.options = eval(field.field_type.replace("Literal", "")) + field.options = ast.literal_eval(field.field_type.replace("Literal", "")) field.is_list = True field.field_type = "str" diff --git a/src/backend/langflow/template/nodes.py b/src/backend/langflow/template/nodes.py deleted file mode 100644 index 8b1378917..000000000 --- a/src/backend/langflow/template/nodes.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/backend/langflow/utils/util.py b/src/backend/langflow/utils/util.py index 0c9a18335..293d31154 100644 --- a/src/backend/langflow/utils/util.py +++ b/src/backend/langflow/utils/util.py @@ -6,7 +6,7 @@ from typing import Dict, Optional from docstring_parser import parse # type: ignore -from langflow.template.constants import FORCE_SHOW_FIELDS +from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS from langflow.utils import constants