diff --git a/api/app/core/workflow/adapters/dify/converter.py b/api/app/core/workflow/adapters/dify/converter.py index 023091a3..467beb07 100644 --- a/api/app/core/workflow/adapters/dify/converter.py +++ b/api/app/core/workflow/adapters/dify/converter.py @@ -764,6 +764,10 @@ class DifyConverter(BaseConverter): node_data = node["data"] result = NoteNodeConfig.model_construct( author=node_data.get("author", ""), - text=node_data.get("text", "") + text=node_data.get("text", ""), + width=node_data.get("width", 80), + height=node_data.get("height", 80), + theme=node_data.get("theme", "blue"), + show_author=node_data.get("showAuthor", True) ).model_dump() return result diff --git a/api/app/core/workflow/adapters/dify/dify_adapter.py b/api/app/core/workflow/adapters/dify/dify_adapter.py index c9aa7ca9..10397ad0 100644 --- a/api/app/core/workflow/adapters/dify/dify_adapter.py +++ b/api/app/core/workflow/adapters/dify/dify_adapter.py @@ -59,7 +59,7 @@ class DifyAdapter(BasePlatformAdapter, DifyConverter): support_node_types=list(self.NODE_TYPE_MAPPING.keys()) ) - def map_node_type(self, platform_node_type) -> str: + def map_node_type(self, platform_node_type) -> NodeType: return self.NODE_TYPE_MAPPING.get(platform_node_type, NodeType.UNKNOWN) @property @@ -184,7 +184,7 @@ class DifyAdapter(BasePlatformAdapter, DifyConverter): except Exception as e: logger.debug(f"convert node error - {e}", exc_info=True) - def _convert_node_config(self, node_type: str, node: dict): + def _convert_node_config(self, node_type: NodeType, node: dict): try: node_data = node["data"] converter = self.get_node_convert(node_type) diff --git a/api/app/core/workflow/nodes/notes/config.py b/api/app/core/workflow/nodes/notes/config.py index d7bfa383..42b4a1ab 100644 --- a/api/app/core/workflow/nodes/notes/config.py +++ b/api/app/core/workflow/nodes/notes/config.py @@ -4,5 +4,9 @@ from app.core.workflow.nodes.base_config import BaseNodeConfig class NoteNodeConfig(BaseNodeConfig): - author: str = Field(..., description="author") - text: str = Field(..., description="note context") + author: str = Field(default="", description="author") + text: str = Field(default="", description="note content") + width: int = Field(default=80) + height: int = Field(default=80) + theme: str = Field(default="blue") + show_author: bool = Field(default=True)