133 lines
5.2 KiB
Python
133 lines
5.2 KiB
Python
# Copyright (c) 2025 Patrick Motsch
|
|
# AI node definitions - map to methodAi actions.
|
|
|
|
AI_NODES = [
|
|
{
|
|
"id": "ai.prompt",
|
|
"category": "ai",
|
|
"label": "Prompt",
|
|
"description": "Prompt eingeben und KI führt aus",
|
|
"parameters": [
|
|
{"name": "aiPrompt", "type": "string", "required": True, "frontendType": "textarea",
|
|
"description": "KI-Prompt"},
|
|
{"name": "outputFormat", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["text", "json", "emailDraft"]},
|
|
"description": "Ausgabeformat", "default": "text"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "AiResult"}},
|
|
"meta": {"icon": "mdi-robot", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "process",
|
|
},
|
|
{
|
|
"id": "ai.webResearch",
|
|
"category": "ai",
|
|
"label": "Web-Recherche",
|
|
"description": "Recherche im Web",
|
|
"parameters": [
|
|
{"name": "prompt", "type": "string", "required": True, "frontendType": "textarea",
|
|
"description": "Recherche-Anfrage"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "AiResult"}},
|
|
"meta": {"icon": "mdi-magnify", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "webResearch",
|
|
},
|
|
{
|
|
"id": "ai.summarizeDocument",
|
|
"category": "ai",
|
|
"label": "Dokument zusammenfassen",
|
|
"description": "Dokumentinhalt zusammenfassen",
|
|
"parameters": [
|
|
{"name": "summaryLength", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["short", "medium", "long"]},
|
|
"description": "Kurz, mittel oder lang", "default": "medium"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["DocumentList", "Transit"]}},
|
|
"outputPorts": {0: {"schema": "AiResult"}},
|
|
"meta": {"icon": "mdi-file-document-outline", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "summarizeDocument",
|
|
},
|
|
{
|
|
"id": "ai.translateDocument",
|
|
"category": "ai",
|
|
"label": "Dokument übersetzen",
|
|
"description": "Dokument in Zielsprache übersetzen",
|
|
"parameters": [
|
|
{"name": "targetLanguage", "type": "string", "required": True, "frontendType": "select",
|
|
"frontendOptions": {"options": ["en", "de", "fr", "it", "es", "pt", "nl"]},
|
|
"description": "Zielsprache"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["DocumentList", "Transit"]}},
|
|
"outputPorts": {0: {"schema": "AiResult"}},
|
|
"meta": {"icon": "mdi-translate", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "translateDocument",
|
|
},
|
|
{
|
|
"id": "ai.convertDocument",
|
|
"category": "ai",
|
|
"label": "Dokument konvertieren",
|
|
"description": "Dokument in anderes Format konvertieren",
|
|
"parameters": [
|
|
{"name": "targetFormat", "type": "string", "required": True, "frontendType": "select",
|
|
"frontendOptions": {"options": ["pdf", "docx", "txt", "html", "md"]},
|
|
"description": "Zielformat"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["DocumentList", "Transit"]}},
|
|
"outputPorts": {0: {"schema": "DocumentList"}},
|
|
"meta": {"icon": "mdi-file-convert", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "convertDocument",
|
|
},
|
|
{
|
|
"id": "ai.generateDocument",
|
|
"category": "ai",
|
|
"label": "Dokument generieren",
|
|
"description": "Dokument aus Prompt generieren",
|
|
"parameters": [
|
|
{"name": "prompt", "type": "string", "required": True, "frontendType": "textarea",
|
|
"description": "Generierungs-Prompt"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "DocumentList"}},
|
|
"meta": {"icon": "mdi-file-plus", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "generateDocument",
|
|
},
|
|
{
|
|
"id": "ai.generateCode",
|
|
"category": "ai",
|
|
"label": "Code generieren",
|
|
"description": "Code aus Beschreibung generieren",
|
|
"parameters": [
|
|
{"name": "prompt", "type": "string", "required": True, "frontendType": "textarea",
|
|
"description": "Code-Generierungs-Prompt"},
|
|
{"name": "language", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["python", "javascript", "typescript", "java", "csharp", "go"]},
|
|
"description": "Programmiersprache", "default": "python"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "AiResult"}},
|
|
"meta": {"icon": "mdi-code-tags", "color": "#9C27B0"},
|
|
"_method": "ai",
|
|
"_action": "generateCode",
|
|
},
|
|
]
|