30 lines
1.4 KiB
Python
30 lines
1.4 KiB
Python
# Copyright (c) 2025 Patrick Motsch
|
|
# File node definitions - create files from context (e.g. from AI nodes).
|
|
|
|
from modules.shared.i18nRegistry import t
|
|
|
|
FILE_NODES = [
|
|
{
|
|
"id": "file.create",
|
|
"category": "file",
|
|
"label": t("Datei erstellen"),
|
|
"description": t("Erstellt eine Datei aus Kontext (Text/Markdown von KI)."),
|
|
"parameters": [
|
|
{"name": "outputFormat", "type": "str", "required": True, "frontendType": "select",
|
|
"frontendOptions": {"options": ["docx", "pdf", "txt", "html", "md"]},
|
|
"description": t("Ausgabeformat"), "default": "docx"},
|
|
{"name": "title", "type": "str", "required": False, "frontendType": "text",
|
|
"description": t("Dokumenttitel")},
|
|
{"name": "context", "type": "Any", "required": False, "frontendType": "contextBuilder",
|
|
"description": t("Daten aus vorherigen Schritten"), "default": "",
|
|
"graphInherit": {"port": 0, "kind": "primaryTextRef"}},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["AiResult", "TextResult", "Transit", "FormPayload", "LoopItem", "ActionResult"]}},
|
|
"outputPorts": {0: {"schema": "DocumentList"}},
|
|
"meta": {"icon": "mdi-file-plus-outline", "color": "#2196F3", "usesAi": False},
|
|
"_method": "file",
|
|
"_action": "create",
|
|
},
|
|
]
|