diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index 353298cbd..4d65070bf 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -29,7 +29,7 @@ class CustomComponent(Component, extra=Extra.allow): def build_config(self): return self.field_config - def _class_template_validation(self, code: str) -> bool: + def _class_template_validation(self, code: str): TYPE_HINT_LIST = ["Optional", "Prompt", "PromptTemplate", "LLMChain"] if not code: @@ -52,7 +52,7 @@ class CustomComponent(Component, extra=Extra.allow): raise HTTPException(status_code=400, detail=error_detail) def is_check_valid(self) -> bool: - return self._class_template_validation(self.code) + return self._class_template_validation(self.code) if self.code else False def get_code_tree(self, code: str): return super().get_code_tree(code) diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 1420479a4..46fa781d6 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -1,3 +1,4 @@ +from typing import Any from langflow.interface.agents.base import agent_creator from langflow.interface.chains.base import chain_creator from langflow.interface.custom.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES @@ -89,7 +90,7 @@ def add_new_custom_field( template, field_name: str, field_type: str, - field_value: str, + field_value: Any, field_required: bool, field_config: dict, ):