mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 02:05:11 +08:00
fix: adding chainfrontendnode
This commit is contained in:
committed by
Gabriel Luiz Freitas Almeida
parent
611b4d6709
commit
cfd4a229ea
@ -1,9 +1,10 @@
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, List, Optional, Type
|
||||
|
||||
from langflow.custom.customs import get_custom_nodes
|
||||
from langflow.interface.base import LangChainTypeCreator
|
||||
from langflow.interface.custom_lists import chain_type_to_cls_dict
|
||||
from langflow.settings import settings
|
||||
from langflow.template.nodes import ChainFrontendNode
|
||||
from langflow.utils.util import build_template_from_class
|
||||
|
||||
# Assuming necessary imports for Field, Template, and FrontendNode classes
|
||||
@ -12,6 +13,10 @@ from langflow.utils.util import build_template_from_class
|
||||
class ChainCreator(LangChainTypeCreator):
|
||||
type_name: str = "chains"
|
||||
|
||||
@property
|
||||
def frontend_node_class(self) -> Type[ChainFrontendNode]:
|
||||
return ChainFrontendNode
|
||||
|
||||
@property
|
||||
def type_to_loader_dict(self) -> Dict:
|
||||
if self.type_dict is None:
|
||||
|
||||
@ -289,3 +289,13 @@ class MemoryFrontendNode(FrontendNode):
|
||||
field.field_type = "int"
|
||||
field.value = 10
|
||||
field.display_name = "Memory Size"
|
||||
|
||||
|
||||
class ChainFrontendNode(FrontendNode):
|
||||
@staticmethod
|
||||
def format_field(field: TemplateField, name: Optional[str] = None) -> None:
|
||||
FrontendNode.format_field(field, name)
|
||||
|
||||
if "key" in field.name:
|
||||
field.password = False
|
||||
field.show = False
|
||||
|
||||
Reference in New Issue
Block a user