Add field serializer for display name in
CustomComponentFrontendNode
This commit is contained in:
parent
628855c50d
commit
61673d7bf9
1 changed files with 7 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from typing import Optional
|
|||
from langflow.template.field.base import TemplateField
|
||||
from langflow.template.frontend_node.base import FrontendNode
|
||||
from langflow.template.template.base import Template
|
||||
from pydantic import field_serializer
|
||||
|
||||
DEFAULT_CUSTOM_COMPONENT_CODE = """from langflow import CustomComponent
|
||||
from typing import Optional, List, Dict, Union
|
||||
|
|
@ -66,3 +67,9 @@ class CustomComponentFrontendNode(FrontendNode):
|
|||
)
|
||||
description: Optional[str] = None
|
||||
base_classes: list[str] = []
|
||||
|
||||
@field_serializer("display_name")
|
||||
def process_display_name(self, display_name: str) -> str:
|
||||
"""Sets the display name of the frontend node."""
|
||||
|
||||
return display_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue