doc and keepass

This commit is contained in:
ValueOn AG 2025-10-30 16:20:58 +01:00
parent 6e9d6ff784
commit 6ee07ece1e
10 changed files with 2014 additions and 1449 deletions

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PowerON - Workflow Engine Architektur</title>
<title>PowerON - Workflow Engine Dokumentation</title>
<style>
* {
margin: 0;
@ -82,76 +82,28 @@
margin-bottom: 10px;
}
.workflow-box p {
margin: 8px 0;
}
.mode-box {
background: white;
border: 3px solid #667eea;
.info-box {
background: #d1ecf1;
border: 2px solid #0c5460;
border-radius: 10px;
padding: 20px;
margin: 15px 0;
display: inline-block;
width: 100%;
}
.mode-box h4 {
color: #667eea;
font-size: 1.2em;
margin-bottom: 10px;
}
.flow-arrow {
text-align: center;
font-size: 2em;
color: #667eea;
margin: 10px 0;
}
.action-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.action-card {
background: white;
border: 2px solid #667eea;
.warning-box {
background: #fff3cd;
border: 2px solid #856404;
border-radius: 10px;
padding: 15px;
transition: all 0.3s ease;
margin: 20px 0;
}
.action-card:hover {
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
transform: translateY(-3px);
}
.action-card h4 {
color: #764ba2;
margin-bottom: 10px;
font-size: 1.1em;
}
.method-badge {
display: inline-block;
background: #667eea;
color: white;
padding: 5px 10px;
border-radius: 5px;
font-size: 0.85em;
margin-right: 10px;
margin-bottom: 5px;
}
.example-workflow {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
border: 3px solid #764ba2;
border-radius: 15px;
padding: 25px;
margin: 30px 0;
.success-box {
background: #d4edda;
border: 2px solid #28a745;
border-radius: 10px;
padding: 15px;
margin: 20px 0;
}
.step-box {
@ -163,55 +115,50 @@
box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.step-box h5 {
color: #764ba2;
margin-bottom: 10px;
font-size: 1.1em;
}
.task-tree {
margin-left: 30px;
border-left: 2px dashed #667eea;
padding-left: 20px;
}
.task-item {
background: #f8f9fa;
border: 1px solid #667eea;
border-radius: 5px;
padding: 10px;
margin: 10px 0;
}
.action-item {
background: #e8ebf5;
border: 1px solid #764ba2;
border-radius: 5px;
padding: 8px;
margin: 5px 0;
padding: 12px;
margin: 10px 0;
margin-left: 20px;
font-size: 0.95em;
}
.label-box {
background: #f0f7ff;
border: 2px dashed #667eea;
border-radius: 8px;
padding: 15px;
margin: 15px 0;
font-family: 'Courier New', monospace;
font-size: 0.9em;
}
.legend {
background: #f8f9fa;
border: 2px solid #667eea;
border-radius: 10px;
padding: 20px;
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.legend-item {
display: flex;
align-items: center;
margin: 10px 0;
.feature-card {
background: white;
border: 2px solid #667eea;
border-radius: 10px;
padding: 20px;
transition: all 0.3s ease;
}
.legend-color {
width: 30px;
height: 30px;
border-radius: 5px;
margin-right: 10px;
.feature-card:hover {
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
transform: translateY(-3px);
}
.feature-card h4 {
color: #764ba2;
margin-bottom: 10px;
font-size: 1.2em;
}
code {
@ -235,159 +182,315 @@
background: #fff3cd;
padding: 2px 6px;
border-radius: 3px;
font-weight: bold;
}
.info-box {
background: #d1ecf1;
border: 2px solid #0c5460;
border-radius: 10px;
padding: 15px;
margin: 20px 0;
.flow-diagram {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
margin: 30px 0;
}
.warning-box {
background: #fff3cd;
border: 2px solid #856404;
.flow-box {
background: white;
border: 3px solid #667eea;
border-radius: 10px;
padding: 15px;
margin: 20px 0;
padding: 20px;
width: 80%;
text-align: center;
}
.flow-arrow {
font-size: 2em;
color: #667eea;
}
.connector-badge {
display: inline-block;
background: #667eea;
color: white;
padding: 5px 12px;
border-radius: 20px;
font-size: 0.9em;
margin: 5px;
}
</style>
</head>
<body>
<div class="container">
<h1>PowerON Workflow Engine Architektur</h1>
<h1>PowerON Workflow Engine</h1>
<div class="info-box">
<strong>📖 Dokumentation:</strong> Diese Dokumentation beschreibt die Architektur der Workflow Engine von PowerON. Die Engine ermöglicht es, komplexe Multi-Step Workflows zu erstellen, die Tasks und Actions dynamisch organisieren und ausführen.
<strong>📖 Dokumentation:</strong> Diese Dokumentation beschreibt die PowerON Workflow Engine für Kunden. Die Engine ermöglicht es, komplexe Multi-Step Workflows zu erstellen, die automatisch Dokumente verarbeiten, AI-Analysen durchführen und Ergebnisse über verschiedene Kanäle weiterleiten.
</div>
<h2>1. Workflow-Übersicht</h2>
<h2>1. Workflow-Struktur: Tasks und Actions</h2>
<div class="diagram">
<h3>🏗️ Hierarchische Workflow-Struktur</h3>
<div class="workflow-box">
<h4>🎯 Workflow Manager</h4>
<p><code>@gateway/modules/workflows/workflowManager.py</code></p>
<p>Zentrale Komponente, die alle Workflow-Typen verwaltet und koordiniert.</p>
<p><strong>Routen:</strong> <code>@routeChatPlayground.py</code></p>
<h4>📦 Workflow</h4>
<p>Ein Workflow ist ein vollständiger Geschäftsprozess, der aus mehreren Tasks besteht.</p>
<p><strong>Status:</strong> running, stopped, completed, failed</p>
</div>
<div class="flow-arrow">⬇️</div>
<div class="flow-arrow" style="text-align: center; margin: 20px 0;">⬇️</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;">
<div class="mode-box">
<h4>📋 Actionplan Mode</h4>
<code>@modeActionplan.py</code>
<p style="margin-top: 10px;"><strong>Funktion:</strong></p>
<ul style="font-size: 0.9em;">
<li>Batch-Planung aller Actions</li>
<li>Sequenzielle Ausführung</li>
<li>AI Review nach Task-Abschluss</li>
<li>Automatische Retry-Logik</li>
</ul>
<p style="margin-top: 10px; color: #28a745; font-weight: bold;">✓ Implementiert</p>
<div class="step-box">
<h4>📋 Task 1: Dokumente identifizieren</h4>
<p><strong>Objective:</strong> "Finde alle neuen PDF-Belege im SharePoint-Ordner"</p>
<div class="action-item">
<strong>Action 1.1:</strong> <code>sharepoint.listDocuments</code><br>
<span style="font-size: 0.9em; color: #666;">
Listet alle Dokumente im Ordner auf<br>
<strong>Parameter:</strong> folderPath, connectionReference
</span>
</div>
<div class="mode-box">
<h4>🔄 React Mode</h4>
<code>@modeReact.py</code>
<p style="margin-top: 10px;"><strong>Funktion:</strong></p>
<ul style="font-size: 0.9em;">
<li>Iterative Plan-Act-Observe-Schleife</li>
<li>Dynamische Action-Generierung</li>
<li>Adaptive Learning</li>
<li>Content Validation</li>
</ul>
<p style="margin-top: 10px; color: #28a745; font-weight: bold;">✓ Implementiert</p>
<div class="action-item">
<strong>Action 1.2:</strong> <code>sharepoint.readDocuments</code><br>
<span style="font-size: 0.9em; color: #666;">
Liest die gefundenen Dokumente ein<br>
<strong>Parameter:</strong> documentList (verweis auf Action 1.1), connectionReference
</span>
</div>
</div>
<div class="step-box">
<h4>🤖 Task 2: Daten verarbeiten</h4>
<p><strong>Objective:</strong> "Extrahiere Spesendaten aus PDFs und strukturiere sie"</p>
<div class="mode-box">
<h4>⚙️ Automated Mode</h4>
<code>@modeAutomated.py</code>
<p style="margin-top: 10px;"><strong>Funktion:</strong></p>
<ul style="font-size: 0.9em;">
<li>Fixed Workflow-Definition</li>
<li>Zeitgesteuerte Ausführung</li>
<li>Vordefinierter Fahrplan</li>
<li>Standardisierte Prozesse</li>
</ul>
<p style="margin-top: 10px; color: #ffc107; font-weight: bold;">⚠ Geplant</p>
<div class="action-item">
<strong>Action 2.1:</strong> <code>ai.process</code><br>
<span style="font-size: 0.9em; color: #666;">
Verarbeitet Dokumente mit AI<br>
<strong>Parameter:</strong> aiPrompt, documentList (verweis auf Task 1.2), resultType
</span>
</div>
</div>
<div class="step-box">
<h4>📧 Task 3: Ergebnisse versenden</h4>
<p><strong>Objective:</strong> "Versende Bestätigungsmail mit Übersicht"</p>
<div class="action-item">
<strong>Action 3.1:</strong> <code>outlook.composeAndSendEmailWithContext</code><br>
<span style="font-size: 0.9em; color: #666;">
Sendet E-Mail mit Ergebnissen<br>
<strong>Parameter:</strong> recipientEmail, subject, emailBody, attachments (verweis auf Task 2.1)
</span>
</div>
</div>
</div>
<h2>2. Workflow-Modell</h2>
<div class="diagram">
<h3>🏗️ Hierarchische Struktur</h3>
<div class="task-tree">
<div class="workflow-box">
<h4>📦 Workflow</h4>
<p><strong>Attribute:</strong> ID, Status, Round, Mandate</p>
<p><strong>Zustände:</strong> running, stopped, completed, failed</p>
</div>
<div class="task-item">
<strong>Task 1</strong> - Erste Aufgabe
<p style="font-size: 0.9em; color: #666; margin-top: 5px;">Objective: "Verknüpfung definieren"</p>
<div class="action-item">
Action 1: sharepoint.findDocumentPath<br>
<span style="font-size: 0.85em; color: #666;">Findet Dokumente im SharePoint</span>
</div>
<div class="action-item">
Action 2: sharepoint.readDocuments<br>
<span style="font-size: 0.85em; color: #666;">Liest gefundene Dokumente</span>
</div>
</div>
<div class="task-item">
<strong>Task 2</strong> - Zweite Aufgabe
<p style="font-size: 0.9em; color: #666; margin-top: 5px;">Objective: "Verarbeitung durchführen"</p>
<div class="action-item">
Action 1: ai.process<br>
<span style="font-size: 0.85em; color: #666;">Verarbeitet Dokumente mit AI</span>
</div>
<div class="action-item">
Action 2: sharepoint.uploadDocument<br>
<span style="font-size: 0.85em; color: #666;">Speichert Ergebnisse</span>
</div>
</div>
<div class="task-item">
<strong>Task 3</strong> - Dritte Aufgabe
<p style="font-size: 0.9em; color: #666; margin-top: 5px;">Objective: "Benachrichtigung versenden"</p>
<div class="action-item">
Action 1: outlook.composeAndSendEmailWithContext<br>
<span style="font-size: 0.85em; color: #666;">Sendet E-Mail mit Ergebnis</span>
</div>
</div>
</div>
</div>
<div class="info-box">
<div class="success-box">
<strong>💡 Wichtige Prinzipien:</strong>
<ul>
<li><strong>1 Task = 1..n Actions</strong> - Ein Task kann mehrere Actions enthalten</li>
<li><strong>Dynamisches AI Planning</strong> - Actionplan und React generieren Actions dynamisch mittels AI</li>
<li><strong>Variable Übergabe</strong> - Actions können Ergebnisse von vorherigen Actions als Input nutzen</li>
<li><strong>Context Propagation</strong> - TaskContext überträgt State zwischen Tasks</li>
<li><strong>Dynamisches AI Planning</strong> - Actions werden automatisch durch AI geplant</li>
<li><strong>Flexible Ausführung</strong> - Tasks werden sequenziell ausgeführt</li>
<li><strong>Automatisches Error Handling</strong> - Fehler werden automatisch behandelt und retries durchgeführt</li>
</ul>
</div>
<h2>3. Verfügbare Actions</h2>
<h2>2. Dokument-Container-Labels: Generische Dokumentübergabe</h2>
<div class="diagram">
<h3>🏷️ Container-Label System</h3>
<p style="margin-bottom: 20px;">Dokumente werden zwischen Actions über <strong>Container-Labels</strong> generisch weitergegeben. Dies ermöglicht eine vollständige Flexibilität, ohne dass Actions die genaue Struktur der Dokumente kennen müssen.</p>
<div class="label-box">
<strong>Label-Format:</strong><br>
<code>round{round}_task{task}_action{action}_{descriptive_label}</code><br><br>
<strong>Beispiel:</strong><br>
<code>round1_task1_action1_spesen_pdfs</code><br>
<code>round1_task2_action1_extracted_data</code>
</div>
<div class="step-box">
<h4>📤 Action Output: Dokument erzeugen</h4>
<p>Jede Action kann Dokumente als Ergebnis erzeugen. Diese werden automatisch mit einem <code>resultLabel</code> versehen:</p>
<div class="action-item">
<strong>Action 1:</strong> <code>sharepoint.readDocuments</code><br>
<span style="font-size: 0.9em; color: #666;">
<strong>Output:</strong> Liste von PDF-Dokumenten<br>
<strong>resultLabel:</strong> <code>round1_task1_action1_spesen_pdfs</code><br>
<strong>Dokumente:</strong> [Rechnung_1.pdf, Rechnung_2.pdf, ...]
</span>
</div>
</div>
<div class="flow-arrow" style="text-align: center; margin: 20px 0;">⬇️ Weitergabe via documentList</div>
<div class="step-box">
<h4>📥 Action Input: Dokumente verwenden</h4>
<p>Folge-Actions referenzieren Dokumente über das <code>documentList</code> Parameter mit dem Label:</p>
<div class="action-item">
<strong>Action 2:</strong> <code>ai.process</code><br>
<span style="font-size: 0.9em; color: #666;">
<strong>Parameter:</strong><br>
<code>{</code><br>
<code> "aiPrompt": "Extrahiere Spesendaten...",</code><br>
<code> "documentList": ["docList:msg_123:round1_task1_action1_spesen_pdfs"],</code><br>
<code> "resultType": "json"</code><br>
<code>}</code><br><br>
<strong>System:</strong> Das System löst automatisch das Label auf und lädt die Dokumente
</span>
</div>
</div>
<div class="success-box">
<strong>✅ Vorteile des Container-Label Systems:</strong>
<ul>
<li><strong>Vollständige Entkopplung:</strong> Actions müssen nicht wissen, welche Dokumente genau übergeben werden</li>
<li><strong>Flexible Verkettung:</strong> Dokumente können zwischen beliebig vielen Actions weitergegeben werden</li>
<li><strong>Automatische Verwaltung:</strong> Das System verwaltet Dokumente zentral und löst Labels automatisch auf</li>
<li><strong>Type-Safety:</strong> Labels enthalten Metadaten (Round, Task, Action) für bessere Nachverfolgbarkeit</li>
</ul>
</div>
</div>
<h2>3. Key Features</h2>
<div class="feature-grid">
<div class="feature-card">
<h4>🔒 Neutralizer - Datenschutz</h4>
<p><strong>DSGVO-konformer Daten-Neutralisierer</strong> für alle User-Dokumente:</p>
<ul style="margin-top: 10px; font-size: 0.9em;">
<li>Automatische Neutralisierung personenbezogener Daten</li>
<li>Ersetzung durch Platzhalter ({{person}}, {{date}}, {{city}})</li>
<li>Unterstützt: TXT, JSON, CSV, Excel, Word</li>
<li>Mehrsprachig: DE, EN, FR, IT</li>
<li>Konfigurierbare Namen-Listen für spezifische Neutralisierung</li>
</ul>
<p style="margin-top: 15px; font-size: 0.85em; color: #666;">
<strong>Beispiel:</strong><br>
Original: "Max Mustermann, geboren am 01.01.1980 in Berlin"<br>
Neutralisiert: "{{person}}, geboren am {{date}} in {{city}}"
</p>
</div>
<div class="feature-card">
<h4>🚀 Unlimited AI Calls</h4>
<p><strong>Keine Limits bei AI-Verarbeitung:</strong></p>
<ul style="margin-top: 10px; font-size: 0.9em;">
<li><strong>Datenmenge:</strong> Unbegrenzte Input-Datenvolumen</li>
<li><strong>Dateianzahl:</strong> Unbegrenzte Anzahl an Dateien pro Workflow</li>
<li><strong>Formate:</strong> Alle gängigen Formate unterstützt:
<ul style="margin-left: 20px; margin-top: 5px;">
<li>Dokumente: PDF, DOCX, TXT, MD, HTML</li>
<li>Daten: JSON, CSV, XLSX, XML</li>
<li>Bilder: JPG, PNG, GIF, WebP</li>
<li>Audio/Video: MP3, MP4, WAV</li>
</ul>
</li>
<li><strong>Automatisches Chunking:</strong> Große Dateien werden automatisch in handhabbare Blöcke aufgeteilt</li>
<li><strong>Intelligente Modell-Auswahl:</strong> System wählt automatisch das beste AI-Modell basierend auf Anforderung</li>
</ul>
</div>
<div class="feature-card">
<h4>🔌 Connector-Integration</h4>
<p><strong>Einfache Integration ohne Installation:</strong></p>
<ul style="margin-top: 10px; font-size: 0.9em;">
<li><strong>Microsoft (MSFT):</strong>
<ul style="margin-left: 20px; margin-top: 5px;">
<li>SharePoint (Dokumente lesen/schreiben)</li>
<li>Outlook (E-Mails senden/empfangen)</li>
<li>OneDrive Integration</li>
</ul>
</li>
<li><strong>Google:</strong>
<ul style="margin-left: 20px; margin-top: 5px;">
<li>Google Drive</li>
<li>Gmail</li>
<li>Google Cloud Services</li>
</ul>
</li>
<li><strong>OAuth-basiert:</strong> Einfache Authentifizierung über Browser-Popup</li>
<li><strong>Keine Installation:</strong> Alles läuft über Web-Interface</li>
</ul>
</div>
</div>
<h2>4. Workflow-Vorgehen: Playground → Automatische Ausführung</h2>
<div class="diagram">
<h3>🔄 Zwei-Phasen-Workflow</h3>
<div class="flow-diagram">
<div class="flow-box">
<h4>Phase 1: Playground - Dynamisches Testen</h4>
<p style="margin-top: 10px;">Im <strong>Chat Playground</strong> können Sie Workflows dynamisch testen und modellieren:</p>
<ul style="text-align: left; margin-top: 15px;">
<li><strong>Dynamisches AI Planning:</strong> AI generiert automatisch Tasks und Actions basierend auf Ihrer Beschreibung</li>
<li><strong>Interaktives Testen:</strong> Jeder Schritt wird in Echtzeit ausgeführt und sichtbar gemacht</li>
<li><strong>Anpassungen:</strong> Sie können jederzeit stoppen, anpassen und neu starten</li>
<li><strong>Zwei Modi verfügbar:</strong>
<ul style="margin-left: 20px; margin-top: 5px;">
<li><strong>Actionplan Mode:</strong> Alle Actions werden im Voraus geplant, dann sequenziell ausgeführt</li>
<li><strong>React Mode:</strong> Iterative Plan-Act-Observe-Schleife für adaptive Workflows</li>
</ul>
</li>
</ul>
</div>
<div class="flow-arrow">⬇️</div>
<div class="flow-box">
<h4>Phase 2: Automatische Ausführung</h4>
<p style="margin-top: 10px;">Nach erfolgreichem Testen können Sie den Workflow als <strong>fixe Definition</strong> speichern:</p>
<ul style="text-align: left; margin-top: 15px;">
<li><strong>Workflow-Definition:</strong> Getesteter Workflow wird als Template gespeichert</li>
<li><strong>Event Handler:</strong> Workflow kann über Event Handler ausgelöst werden:
<ul style="margin-left: 20px; margin-top: 5px;">
<li>Zeitgesteuert (z.B. täglich um 08:00 Uhr)</li>
<li>Event-basiert (z.B. bei neuen E-Mails)</li>
<li>API-Trigger (z.B. über Webhook)</li>
</ul>
</li>
<li><strong>Automatische Ausführung:</strong> Workflow läuft vollständig automatisch ohne menschliches Eingreifen</li>
<li><strong>Error Handling:</strong> Automatische Retries und Fehlerbenachrichtigungen</li>
</ul>
</div>
</div>
<div class="success-box" style="margin-top: 30px;">
<strong>📋 Beispiel-Workflow: Spesenverarbeitung</strong>
<div style="margin-top: 15px;">
<p><strong>Playground-Phase:</strong></p>
<ol style="margin-left: 20px;">
<li>Beschreibung: "Lese täglich PDF-Spesenbelege aus SharePoint, extrahiere Daten mit AI, und versende Bestätigungsmail"</li>
<li>AI erstellt automatisch Task-Plan: 3 Tasks mit entsprechenden Actions</li>
<li>Sie testen interaktiv jeden Schritt</li>
<li>Sie passen bei Bedarf an (z.B. zusätzliche Validierung)</li>
</ol>
<p style="margin-top: 20px;"><strong>Automatisierungs-Phase:</strong></p>
<ol style="margin-left: 20px;">
<li>Workflow wird als Template gespeichert</li>
<li>Event Handler wird konfiguriert: "Täglich um 08:00 Uhr ausführen"</li>
<li>Workflow läuft automatisch, liest neue Belege, verarbeitet sie, und versendet E-Mails</li>
<li>Sie erhalten Logs und Benachrichtigungen bei Erfolg oder Fehlern</li>
</ol>
</div>
</div>
</div>
<h2>5. Verfügbare Actions</h2>
<div class="diagram">
<h3>🤖 Method: AI</h3>
<div class="action-grid">
<div class="action-card">
<span class="method-badge">ai</span>
<h4>process</h4>
<div class="feature-grid">
<div class="feature-card">
<h4><span class="connector-badge">ai</span> process</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>aiPrompt (required)</li>
@ -397,9 +500,8 @@
<p style="margin-top: 10px;">AI-Textverarbeitung mit optionalen Input-Dokumenten</p>
</div>
<div class="action-card">
<span class="method-badge">ai</span>
<h4>webResearch</h4>
<div class="feature-card">
<h4><span class="connector-badge">ai</span> webResearch</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>searchQuery (required)</li>
@ -408,9 +510,8 @@
<p style="margin-top: 10px;">Web-Recherche mit AI-gestützter Zusammenfassung</p>
</div>
<div class="action-card">
<span class="method-badge">ai</span>
<h4>generateImage</h4>
<div class="feature-card">
<h4><span class="connector-badge">ai</span> generateImage</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>imagePrompt (required)</li>
@ -421,10 +522,9 @@
</div>
<h3 style="margin-top: 40px;">📁 Method: SharePoint</h3>
<div class="action-grid">
<div class="action-card">
<span class="method-badge">sharepoint</span>
<h4>findDocumentPath</h4>
<div class="feature-grid">
<div class="feature-card">
<h4><span class="connector-badge">sharepoint</span> findDocumentPath</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>connectionReference (required)</li>
@ -435,9 +535,8 @@
<p style="margin-top: 10px;">Sucht Dokumente und Ordner in SharePoint</p>
</div>
<div class="action-card">
<span class="method-badge">sharepoint</span>
<h4>readDocuments</h4>
<div class="feature-card">
<h4><span class="connector-badge">sharepoint</span> readDocuments</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>documentList (required)</li>
@ -446,9 +545,8 @@
<p style="margin-top: 10px;">Liest Dokumente aus SharePoint</p>
</div>
<div class="action-card">
<span class="method-badge">sharepoint</span>
<h4>uploadDocument</h4>
<div class="feature-card">
<h4><span class="connector-badge">sharepoint</span> uploadDocument</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>documentData (required)</li>
@ -458,9 +556,8 @@
<p style="margin-top: 10px;">Lädt Dokumente in SharePoint hoch</p>
</div>
<div class="action-card">
<span class="method-badge">sharepoint</span>
<h4>listDocuments</h4>
<div class="feature-card">
<h4><span class="connector-badge">sharepoint</span> listDocuments</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>folderPath (required)</li>
@ -472,10 +569,9 @@
</div>
<h3 style="margin-top: 40px;">📧 Method: Outlook</h3>
<div class="action-grid">
<div class="action-card">
<span class="method-badge">outlook</span>
<h4>readEmails</h4>
<div class="feature-grid">
<div class="feature-card">
<h4><span class="connector-badge">outlook</span> readEmails</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>connectionReference (required)</li>
@ -486,9 +582,8 @@
<p style="margin-top: 10px;">Liest E-Mails aus einem Postfach</p>
</div>
<div class="action-card">
<span class="method-badge">outlook</span>
<h4>searchEmails</h4>
<div class="feature-card">
<h4><span class="connector-badge">outlook</span> searchEmails</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>connectionReference (required)</li>
@ -497,9 +592,8 @@
<p style="margin-top: 10px;">Sucht E-Mails mit spezifischen Kriterien</p>
</div>
<div class="action-card">
<span class="method-badge">outlook</span>
<h4>composeAndSendEmailWithContext</h4>
<div class="feature-card">
<h4><span class="connector-badge">outlook</span> composeAndSendEmailWithContext</h4>
<p><strong>Parameter:</strong></p>
<ul style="font-size: 0.9em;">
<li>connectionReference (required)</li>
@ -513,122 +607,27 @@
</div>
</div>
<h2>4. Beispiel-Workflow: Spesenverarbeitung</h2>
<div class="example-workflow">
<h3>🎯 Use Case: Automatische Spesenverarbeitung</h3>
<p><strong>Szenario:</strong> Ein Kunde lädt PDF-Spesenbelege in einen SharePoint-Ordner. Der Workflow liest täglich die neuen Belege, verarbeitet sie über die Microsoft-Verbindung, aktualisiert das Buchhaltungssystem und sendet eine Bestätigungsmail.</p>
<div class="step-box">
<h5>📍 Step 1: Trigger (Automated Mode)</h5>
<p style="font-size: 0.9em; color: #666;">Zeitgesteuerte tägliche Ausführung (z.B. 08:00 Uhr)</p>
<p><strong>Workflow ID:</strong> <code>workflow_spesen_daily</code></p>
<p><strong>Mode:</strong> <span class="highlight">Automated</span> (fix vordefiniert)</p>
</div>
<div class="step-box">
<h5>📋 Task 1: Dokumente identifizieren</h5>
<p style="font-size: 0.9em; color: #666; margin-bottom: 10px;">Objective: "Finde alle neuen PDF-Belege im Spesen-Ordner"</p>
<div class="action-item">
<strong>Action 1.1:</strong> <code>sharepoint.listDocuments</code><br>
<span style="font-size: 0.85em; color: #666;">
Parameters: <code>{</code><br>
<code> "folderPath": "/Spesen/2024",</code><br>
<code> "connectionReference": "user_msft_connection",</code><br>
<code> "includeSubfolders": false</code><br>
<code>}</code>
</span>
<p style="font-size: 0.85em; color: #28a745; margin-top: 5px;">✓ Ergebnis: Liste aller PDF-Dateien</p>
</div>
<div class="action-item">
<strong>Action 1.2:</strong> <code>sharepoint.readDocuments</code><br>
<span style="font-size: 0.85em; color: #666;">
Parameters: <code>{</code><br>
<code> "documentList": ["docList:msg_123:Rechnung_1.pdf", "docList:msg_123:Rechnung_2.pdf"],</code><br>
<code> "connectionReference": "user_msft_connection"</code><br>
<code>}</code>
</span>
<p style="font-size: 0.85em; color: #28a745; margin-top: 5px;">✓ Ergebnis: PDF-Inhalte für AI-Verarbeitung</p>
</div>
</div>
<div class="step-box">
<h5>🤖 Task 2: Daten extrahieren und verarbeiten</h5>
<p style="font-size: 0.9em; color: #666; margin-bottom: 10px;">Objective: "Extrahiere Spesendaten aus PDFs und strukturiere sie"</p>
<div class="action-item">
<strong>Action 2.1:</strong> <code>ai.process</code><br>
<span style="font-size: 0.85em; color: #666;">
Parameters: <code>{</code><br>
<code> "aiPrompt": "Extrahiere alle Ausgaben aus den Spesenbelegen. Erstelle eine strukturierte JSON-Liste mit: Datum, Betrag, Kategorie, Verwendungszweck.",</code><br>
<code> "documentList": ["docList:msg_124:pdf_content"],</code><br>
<code> "resultType": "json"</code><br>
<code>}</code>
</span>
<p style="font-size: 0.85em; color: #28a745; margin-top: 5px;">✓ Ergebnis: Strukturierte Spesendaten (JSON)</p>
</div>
</div>
<div class="step-box">
<h5>📊 Task 3: Buchhaltung aktualisieren</h5>
<p style="font-size: 0.9em; color: #666; margin-bottom: 10px;">Objective: "Übertrage Spesendaten ins Buchhaltungssystem"</p>
<div class="action-item">
<strong>Action 3.1:</strong> <code>sharepoint.uploadDocument</code><br>
<span style="font-size: 0.85em; color: #666;">
Parameters: <code>{</code><br>
<code> "documentData": {"content": "{\"transactions\": [...]}", "mimeType": "application/json"},</code><br>
<code> "targetPath": "/Buchhaltung/Spesen/processed/2024-01-15.json",</code><br>
<code> "connectionReference": "trust_accounting_system"</code><br>
<code>}</code>
</span>
<p style="font-size: 0.85em; color: #28a745; margin-top: 5px;">✓ Ergebnis: Aktualisierte Buchhaltung</p>
</div>
</div>
<div class="step-box">
<h5>📧 Task 4: Bestätigung senden</h5>
<p style="font-size: 0.9em; color: #666; margin-bottom: 10px;">Objective: "Versende Bestätigungsmail mit Übersicht"</p>
<div class="action-item">
<strong>Action 4.1:</strong> <code>outlook.composeAndSendEmailWithContext</code><br>
<span style="font-size: 0.85em; color: #666;">
Parameters: <code>{</code><br>
<code> "connectionReference": "user_msft_connection",</code><br>
<code> "recipientEmail": "user@company.com",</code><br>
<code> "subject": "Spesenverarbeitung abgeschlossen - 15.01.2024",</code><br>
<code> "emailBody": "Guten Tag,\n\nIhre Spesenbelege wurden verarbeitet...",</code><br>
<code> "attachments": ["docList:msg_125:summary.pdf"]</code><br>
<code>}</code>
</span>
<p style="font-size: 0.85em; color: #28a745; margin-top: 5px;">✓ Ergebnis: E-Mail erfolgreich versendet</p>
</div>
</div>
<div style="background: #d4edda; border: 2px solid #28a745; border-radius: 10px; padding: 15px; margin-top: 20px;">
<h5 style="color: #155724;">✓ Workflow abgeschlossen</h5>
<p style="margin-top: 10px;"><strong>Status:</strong> completed</p>
<p><strong>Verarbeitet:</strong> 5 Actions in 4 Tasks</p>
<p><strong>Dauer:</strong> ~2 Minuten</p>
<p><strong>Ergebnis:</strong> Spesenbelege verarbeitet, Buchhaltung aktualisiert, Bestätigung versendet</p>
</div>
</div>
<h2>5. Technische Architektur</h2>
<h2>6. Technische Architektur</h2>
<div class="diagram">
<div class="workflow-box">
<h4>🔧 Core Components</h4>
<p style="margin-top: 10px;"><strong>Processing Core:</strong></p>
<p style="margin-top: 10px;"><strong>Workflow Management:</strong></p>
<ul style="font-size: 0.95em;">
<li><code>workflowManager.py</code> - Zentrale Workflow-Koordination</li>
<li><code>workflowProcessor.py</code> - Hauptprozessor mit Mode-Delegation</li>
<li><code>actionExecutor.py</code> - Führt Actions aus</li>
<li><code>messageCreator.py</code> - Erstellt Workflow-Nachrichten</li>
<li><code>taskPlanner.py</code> - Plant Tasks</li>
<li><code>validator.py</code> - Validiert Actions</li>
</ul>
<p style="margin-top: 15px;"><strong>Processing Modes:</strong></p>
<ul style="font-size: 0.95em;">
<li><code>modeActionplan.py</code> - Batch-Planung aller Actions</li>
<li><code>modeReact.py</code> - Iterative Plan-Act-Observe-Schleife</li>
</ul>
<p style="margin-top: 15px;"><strong>Adaptive Features:</strong></p>
<ul style="font-size: 0.95em;">
<li><code>intentAnalyzer.py</code> - Analysiert User-Intents</li>
@ -639,33 +638,14 @@
</div>
</div>
<div class="legend">
<h3>📊 Legende</h3>
<div class="legend-item">
<div class="legend-color" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);"></div>
<span><strong>Workflow/Mode Box:</strong> Hauptkomponenten der Engine</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: white; border: 2px solid #667eea;"></div>
<span><strong>Task Box:</strong> Einzelne Aufgabe im Workflow</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #e8ebf5; border: 1px solid #764ba2;"></div>
<span><strong>Action Card:</strong> Konkrete Action-Ausführung</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #d4edda; border: 2px solid #28a745;"></div>
<span><strong>Success Box:</strong> Erfolgreich abgeschlossener Schritt</span>
</div>
</div>
<div class="warning-box" style="margin-top: 30px;">
<strong>⚠️ Wichtige Hinweise:</strong>
<ul>
<li><strong>Automated Mode</strong> ist noch nicht implementiert, die Architektur dafür ist aber bereits dokumentiert</li>
<li><strong>Variable Übergabe</strong> zwischen Actions erfolgt über <code>documentList</code> Parameter mit References</li>
<li><strong>Connection References</strong> müssen vom User konfiguriert sein (Microsoft OAuth)</li>
<li><strong>Dokument-Referenzen</strong> erfolgen über <code>documentList</code> Parameter mit Container-Labels</li>
<li><strong>Connection References</strong> müssen vom User konfiguriert sein (Microsoft/Google OAuth)</li>
<li><strong>Error Handling</strong> erfolgt über Retry-Logik in den Modes</li>
<li><strong>Neutralizer</strong> wird automatisch auf alle User-Uploads angewendet</li>
<li><strong>AI Calls</strong> haben keine Limits - System wählt automatisch passende Modelle</li>
</ul>
</div>

View file

@ -0,0 +1,464 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PowerON Gateway Übersicht</title>
<!-- Single source of truth for favicon -->
<link rel="icon" type="image/png" href="https://poweron.swiss/poweron-favicon.png">
<style>
/* ===== Inlined from wiki/templates/poweron-styles.css for standalone rendering ===== */
/* PowerON - KI für Unternehmen | CSS Stylesheet */
/* latin-ext */
@font-face {
font-family: 'DM Sans';
font-style: italic;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDV36TGc5pg.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'DM Sans';
font-style: italic;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDV30TGc.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6h9Q.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K4.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6h9Q.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K4.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6h9Q.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'DM Sans';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/dmsans/v17/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K4.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Base minimal subset from poweron-styles for standalone */
body { background-color: #ffffff; font-family: DM Sans, sans-serif; color: #111827; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 2rem; }
h1, h2, h3, h4 { font-weight: 700; }
a { color: inherit; text-decoration: none; }
</style>
<style>
body { background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%); color: #1f2937; padding: 24px; }
:root { --po-red:#B91C1C; --po-red-600:#991B1B; --po-navy:#0F172A; --po-muted:#6B7280; --po-border:#e5e7eb; }
.container { max-width: 1280px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 12px 32px rgba(17,24,39,0.08); }
h1 { margin: 0 0 8px 0; color: var(--po-navy); font-size: 28px; }
h2 { margin: 28px 0 12px 0; color: var(--po-navy); font-size: 22px; border-left: 4px solid var(--po-red); padding-left: 10px; }
h3 { margin: 18px 0 8px 0; color: var(--po-navy); font-size: 18px; }
p { line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card { background: #ffffff; border: 2px solid #cbd5e1; border-radius: 16px; padding: 18px; box-shadow: 0 14px 34px rgba(15,23,42,0.10); }
.diagram { background: #ffffff; border: 2px solid #cbd5e1; border-radius: 16px; padding: 20px; overflow: hidden; box-shadow: 0 16px 36px rgba(15,23,42,0.10); }
.legend { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; font-size: 13px; }
.row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.box { background: #ffffff; border: 2px solid #cbd5e1; border-radius: 14px; padding: 12px 14px; min-width: 200px; flex: 1; box-shadow: 0 4px 12px rgba(15,23,42,0.06); }
.box.header { background: #f8fafc; border-color: #94a3b8; box-shadow: 0 8px 18px rgba(15,23,42,0.10); }
.diagram h3 { position: relative; padding-bottom: 6px; margin-bottom: 8px; }
.diagram h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; background: var(--po-red); border-radius: 2px; }
.arrow { display:none; }
.box.has-next { position: relative; }
.box.has-next::after { content: attr(data-arrow); position: absolute; right: -14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--po-red); }
.box.has-next[data-arrow=""]::after { content: "→"; }
.tag { display: inline-block; background: #fff1f2; color: var(--po-red); border: 1px solid #fecaca; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 6px 0 0; font-weight: 600; }
.note { background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; border-radius: 10px; padding: 12px; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.15); }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color: #b91c1c; font-size: 13px; }
ul { margin: 8px 0 8px 22px; }
.muted { color: #6b7280; }
.pill { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px 0; }
.tab-link { text-decoration: none; background: #ffffff; color: var(--po-navy); border: 1px solid var(--po-border); padding: 10px 14px; border-radius: 999px; font-size: 14px; transition: all .2s ease; box-shadow: 0 4px 10px rgba(15,23,42,0.04); }
.tab-link:hover { border-color: #fecaca; background: #fff1f2; color: var(--po-red); }
.tab-link.active { background: var(--po-red); color: #fff; border-color: var(--po-red); box-shadow: 0 8px 18px rgba(185,28,28,0.25); }
.tab-content { display: none; }
.tab-content.active { display: block; }
/* Brand header */
.brand-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--po-border); border-radius: 12px; background: linear-gradient(90deg, #ffffff, #f8fafc); box-shadow: 0 6px 18px rgba(17,24,39,0.05); margin-bottom: 16px; }
.brand-header img { height: 28px; }
.brand-header .title { font-size: 18px; font-weight: 700; color: var(--po-navy); }
.cta { display:inline-block; background: var(--po-red); color:#fff; border:1px solid var(--po-red); padding:10px 14px; border-radius:10px; font-weight:700; box-shadow: 0 8px 18px rgba(185,28,28,0.25); text-decoration:none; }
.cta:hover { background: var(--po-red-600); border-color: var(--po-red-600); }
/* Callout */
.callout { border: 2px solid #cbd5e1; border-radius: 14px; padding: 16px; box-shadow: 0 10px 28px rgba(15,23,42,0.08); background: #ffffff; }
.callout.primary { border-color: var(--po-red); background: #fff1f2; }
.callout .tag { background:#fee2e2; border-color:#fecaca; color:var(--po-red); }
</style>
<meta name="description" content="Schematische Architektur-Übersichten für Gateway-Integration, Neutralizer-LLM, Backend-gesteuertes UI und Dokument-Renderer.">
</head>
<body>
<div class="container">
<div class="brand-header">
<img src="https://poweron.swiss/poweron-logo-updated.png" alt="PowerON">
<div class="title">Neutralisiert. Vernetzt. Automatisiert.</div>
</div>
<h1>PowerON Gateway Übersicht</h1>
<div class="tabs">
<a class="tab-link" href="#tab-overview">Kurzübersicht</a>
<a class="tab-link" href="#tab-neutralizer">Thema: LLMNeutralizer</a>
<a class="tab-link" href="#tab-ui">Thema: BackendUI</a>
<a class="tab-link" href="#tab-renderers">Thema: DokumentRenderer</a>
<a class="tab-link" href="#tab-collab">Zuständigkeiten & Zusammenarbeit</a>
<a class="tab-link" href="#tab-next">Nächste Schritte</a>
</div>
<div id="tab-overview" class="tab-content">
<h2>Kurzübersicht: Was unsere App macht</h2>
<div class="callout primary" style="margin-bottom:14px;">
<p><strong>Kontext:</strong> PowerON stellt eine sichere, unternehmensfähige KIArbeitsumgebung bereit, in der Daten zuerst datenschutzkonform aufbereitet und dann mit modernen Workflows verarbeitet werden. Die Plattform verbindet bestehende Systeme wie Microsoft 365 oder Google Workspace ohne lokale Installation.</p>
<p><strong>Zweck & Ziel:</strong> Teams sollen schnell vom Experimentieren im Playground zu wiederholbaren, automatisierten Abläufen gelangen mit klaren Schnittstellen, einheitlichen Datenformaten und hoher Sicherheit. So wird aus einzelnen UseCases ein skalierbarer, betriebssicherer KIStack.</p>
</div>
<div class="card">
<p>Im Kern:</p>
<ul>
<li>Playground als sichere KI-Workstation (Neutralizer, OAuth-Connectors, Voice-First optional).</li>
<li>Unlimitierte Verarbeitung mit intelligentem Chunking; Workflows dynamisch testen (Playground) und später automatisieren.</li>
<li>Integration von MSFT/Google-Diensten; Standardisierte JSON-Ausgabe inkl. eingebetteter Medien.</li>
</ul>
</div>
<div class="grid" style="margin-top: 16px;">
<div class="diagram">
<h3>🔒 Playground als sichere KIWorkstation</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="→"><strong>User</strong><br><span class="muted">Browser / Voice</span></div>
<div class="box has-next" data-arrow="→"><strong>Playground</strong><br><span class="tag">Neutralizer</span> <span class="tag">OAuth</span> <span class="tag">Voice</span></div>
<div class="box header"><strong>Gateway</strong><br><span class="muted">KIModelle, Workflows</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li><span class="tag">Neutralizer</span> ersetzt sensible Daten vor KIVerarbeitung.</li>
<li><span class="tag">OAuth</span> verbindet sicher MSFT/GoogleKonten ohne lokale Installation.</li>
<li><span class="tag">Voice</span> optional: Spracheingabe/-ausgabe für schnellere Interaktion.</li>
</ul>
</div>
</div>
<div class="diagram">
<h3>♾️ Unlimitierte Verarbeitung & dynamische Workflows</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="→"><strong>Große Dateien</strong><br><span class="muted">PDF, DOCX, XLSX, …</span></div>
<div class="box has-next" data-arrow="→"><strong>Intelligentes Chunking</strong><br><span class="muted">Aufteilen + Parallelisieren</span></div>
<div class="box header"><strong>Workflow</strong><br><span class="muted">Playground testen → Automatisieren</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li>Chunks erlauben <strong>unlimitierte Datenmengen</strong> und viele Dateien ohne TokenLimits.</li>
<li>Workflows werden im Playground <strong>interaktiv modelliert</strong> und danach <strong>per Event</strong> automatisiert.</li>
</ul>
</div>
</div>
<div class="diagram">
<h3>🔌 MSFT/GoogleIntegration & standardisierte JSONAusgabe</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="↔"><strong>MSFT</strong><br><span class="muted">SharePoint, Outlook, OneDrive</span></div>
<div class="box header has-next" data-arrow="→"><strong>Google</strong><br><span class="muted">Drive, Gmail, Cloud</span></div>
<div class="box has-next" data-arrow="→"><strong>Gateway</strong><br><span class="tag">JSON</span> <span class="tag">media[]</span> <span class="tag">parts[]</span></div>
<div class="box header"><strong>Renderer</strong><br><span class="muted">DOCX/XLSX/PPTX/HTML</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li>Einheitliches <strong>JSONFormat</strong> mit eingebetteten Medien (Bilder/Video) für alle Pipelines.</li>
<li>Nahtloses Lesen/Schreiben aus MSFT/GoogleDiensten über OAuthConnectors.</li>
</ul>
</div>
</div>
</div>
</div>
<div id="tab-neutralizer" class="tab-content">
<h2>Thema: LLM-Neutralizer (internes LLM als Datenschutz-Engine)</h2>
<div class="callout primary" style="margin-bottom:12px;">
<p><strong>Kontext:</strong> In vielen Unternehmen verhindert Datenschutz die produktive Nutzung von KI. Der Neutralizer setzt vor der Verarbeitung personenbezogene und sensible Informationen kontrolliert auf Platzhalter und dokumentiert die Ersetzungen optional.</p>
<p><strong>Zweck & Ziel:</strong> Sicherer KIEinsatz mit unternehmenseigenen Daten ohne Risiko für Personenbezug und Compliance. Der Neutralizer bildet die Brücke zwischen Rohdaten und Modellaufrufen und schafft damit die Grundlage, KI in regulierten Umfeldern zuverlässig zu betreiben.</p>
</div>
<div class="card" style="margin:12px 0;">
<h3 style="margin-top:0;">🔧 PartnerBedarf (Kernthema)</h3>
<p>Benötigt wird ein <strong>internes LLM</strong> als Neutralizer, angebunden über eine private API in der Schweiz. Prinzip: Klartext rein, neutralisierter Text raus ohne Persistenz und ohne Nutzung der Inhalte fürs ModellTraining.</p>
<p>So bleiben Daten im eigenen Perimeter, während die Workflows mit neutralisierten Inhalten weiterarbeiten können.</p>
</div>
<div class="diagram">
<div class="row">
<div class="box header"><strong>Kunde (Intranet)</strong><br><span class="tag">Schweizer Umgebung</span> <span class="tag">Geschützt</span></div>
<div class="arrow"></div>
<div class="box"><strong>PowerON Gateway</strong><br><span class="tag">/api/neutralization/process</span><br><span class="muted">Konvertiert Eingaben in Text (JSON/CSV/Plain)</span></div>
<div class="arrow"></div>
<div class="box"><strong>LLM Neutralizer API (Partner)</strong><br><span class="tag">POST /api/neutralizer/anonymize</span><br><span class="muted">Erwartet: text payload</span></div>
<div class="arrow"></div>
<div class="box"><strong>PowerON Gateway</strong><br><span class="muted">Ergebnis validieren, Masken anwenden</span></div>
<div class="arrow"></div>
<div class="box header"><strong>Weiterverarbeitung</strong><br><span class="tag">Workflow</span> <span class="tag">AI</span></div>
</div>
<div class="legend" style="margin-top: 12px;">
<strong>Partner-Bedarf:</strong>
<ul>
<li>Bereitstellung eines internen API-Endpunkts: <code>POST /api/neutralizer/anonymize</code></li>
<li>Input: <code>{ text: string, language?: "de|en|fr|it", policyId?: string }</code></li>
<li>Output: <code>{ text: string, entities?: [{type:"person", value:"{{person}}", offset:123}] }</code></li>
<li>SLAs/Timeouts, Auth (Token/Mutual TLS), Logging-Minimierung (DSGVO)</li>
</ul>
<div class="note">Wir liefern alle Daten als Text (strukturiert: JSON/CSV, unstrukturiert: Plain Text). Das LLM ersetzt Namen und sensible Muster gemäß Policy.</div>
</div>
</div>
</div>
<div id="tab-ui" class="tab-content">
<h2>Thema: Backend-gesteuertes UI (Renderer für View/Edit)</h2>
<div class="callout primary" style="margin-bottom:12px;">
<p><strong>Kontext:</strong> Formulare, Tabellen und Ansichten werden vollständig aus PydanticDatenmodellen abgeleitet. Labels, Datentypen, Pflichtfelder und RenderingRegeln liegen im Backend und steuern das Frontend ohne Hardcoding.</p>
<p><strong>Zweck & Ziel:</strong> Änderungen an Datenstrukturen sollen sofort in der UI sichtbar werden konsistent, mehrsprachig und validiert. So entsteht ein wartungsarmes, generisches Frontend, das schnell an neue UseCases adaptierbar ist.</p>
</div>
<div class="diagram">
<div class="row">
<div class="box header"><strong>Gateway Backend</strong><br><span class="tag">/api/ui/schema</span><br><span class="muted">liefert UI-Schema</span></div>
<div class="arrow"></div>
<div class="box"><strong>UI Runtime</strong><br><span class="tag">Renderer</span> <span class="tag">Form</span> <span class="tag">Table</span></div>
<div class="arrow"></div>
<div class="box header"><strong>Benutzer</strong><br><span class="muted">paginiert, sortierbar, inline edit</span></div>
</div>
<div class="card" style="margin-top: 12px;">
<h3>Stand heute</h3>
<ul>
<li>Ein <strong>bestehendes Frontend</strong> ist verfügbar und kann gezeigt werden.</li>
<li>Die <strong>Steuerung erfolgt vollständig modellgetrieben</strong> über Pydantic-Datenmodelle (Labels/Sprachtexte, Datentypen, Rendering-Anweisungen, Listenelemente, Readonly/Required, Optionen).</li>
<li>Modelle tragen UI-Metadaten (z.B. <code>frontend_type</code>, <code>frontend_readonly</code>, <code>frontend_required</code>) und mehrsprachige Labels (z.B. via <code>register_model_labels</code>).</li>
</ul>
</div>
<div class="grid" style="margin-top: 12px;">
<div class="card">
<h3>Schema (Beispiel)</h3>
<pre style="white-space: pre-wrap; font-size: 12px; background: #0b1021; color: #e5e7eb; padding: 10px; border-radius: 8px;">{
"components": [
{ "type": "table", "id": "docList", "columns": [
{"key": "name", "label": "Name"},
{"key": "size", "label": "Grösse"},
{"key": "mime", "label": "MIME"}
], "dataUrl": "/api/docs?pg={page}&ps={size}", "pageSize": 25, "editable": false },
{ "type": "form", "id": "metaForm", "fields": [
{"key": "title", "label": "Titel", "component": "text"},
{"key": "tags", "label": "Tags", "component": "chips"}
], "submitUrl": "/api/docs/meta" }
]
}</pre>
</div>
<div class="card">
<h3>Partner-Bedarf</h3>
<ul>
<li>Generischer Table/Form-Renderer mit Pagination, Sortieren, Filtern, Inline-Validierung (Erweiterungen auf bestehender Runtime).</li>
<li>Reine Schema-Steuerung vom Backend (kein Hardcoding im Frontend).</li>
<li>Komponenten: Table, Form, Tabs, Detail-Drawer, JSON-Viewer.</li>
<li><strong>Generelle Hilfe für "schlaue UI-Komponenten"</strong> (Auto-Layout, responsive Tabellen mit Virtualisierung, kontextsensitive Toolbars, A11y, Undo/Redo, Offline-Fähigkeit, i18n).</li>
<li>Design-System/Themeing und A11y.</li>
</ul>
<span class="pill">Backend-driven UI</span> <span class="pill">Schema v1</span> <span class="pill">No hard state coupling</span>
</div>
</div>
</div>
</div>
<div id="tab-renderers" class="tab-content">
<h2>Thema: Dokument-Renderers (Word/Excel/PowerPoint/HTML)</h2>
<div class="callout primary" style="margin-bottom:12px;">
<p><strong>Kontext:</strong> Ergebnisse werden in ein standardisiertes JSON mit TextParts und eingebetteten Medien überführt. Darauf aufbauend generieren Renderer markenkonforme Ausgaben für DOCX, XLSX, PPTX oder HTML.</p>
<p><strong>Zweck & Ziel:</strong> Fachinhalte sollen nahtlos in hochwertige Dokumente überführt werden mit Vorlagen, Diagrammen und LayoutRegeln. Dadurch lassen sich Reports, Angebote oder Präsentationen reproduzierbar und automatisiert erzeugen.</p>
</div>
<div class="diagram">
<div class="row">
<div class="box header"><strong>Standardisiertes JSON</strong><br><span class="tag">content.parts[]</span> <span class="tag">media[] (img/video)</span></div>
<div class="arrow"></div>
<div class="box"><strong>Template Engine</strong><br><span class="muted">Mapping/Layouts</span></div>
<div class="arrow"></div>
<div class="box"><strong>Renderer</strong><br><span class="tag">docx</span> <span class="tag">xlsx</span> <span class="tag">pptx</span> <span class="tag">html</span></div>
<div class="arrow"></div>
<div class="box header"><strong>Output</strong><br><span class="muted">Datei + Vorschau + Metadaten</span></div>
</div>
<div class="grid" style="margin-top: 12px;">
<div class="card">
<h3>JSON (vereinheitlicht)</h3>
<pre style="white-space: pre-wrap; font-size: 12px; background: #0b1021; color: #e5e7eb; padding: 10px; border-radius: 8px;">{
"title": "Quartalsbericht Q2",
"parts": [
{"type":"heading","level":1,"text":"Executive Summary"},
{"type":"paragraph","text":"…"},
{"type":"table","columns":["Monat","Umsatz"],"rows":[["Apr",123000],["Mai",136500],["Jun",141200]]},
{"type":"image","ref":"media:logo"}
],
"media": [{"id":"logo","mime":"image/png","data":"base64…"}]
}</pre>
</div>
<div class="card">
<h3>Partner-Bedarf</h3>
<ul>
<li>High-Quality-Renderer für <strong>DOCX/XLSX/PPTX/HTML</strong> mit Corporate-Design (Vorlagen, Master, Styles).</li>
<li>Leistungsfähige Tabellen (Pivot/Layout), Diagramme, Bilder/Videos, Seitenumbrüche.</li>
<li>API-Schnittstelle im Gateway: <code>POST /api/render/{format}</code> mit JSON-Input.</li>
<li>Optional: Streaming-Generierung, Vorschau-Bild, Fehlerreporting pro Part.</li>
</ul>
<span class="pill">Template mapping</span> <span class="pill">Branding</span> <span class="pill">Previews</span>
</div>
</div>
</div>
</div>
<div id="tab-collab" class="tab-content">
<h2>Zuständigkeiten & Zusammenarbeit (High-Level)</h2>
<div class="callout primary" style="margin-bottom:12px;">
<p><strong>Kontext:</strong> PowerON liefert die Plattform, Workflows und Konnektoren; der Partner bringt LLMNeutralizerKompetenz, UIKomponenten und DokumentRenderer ein. Beide Seiten arbeiten über klar definierte APIVerträge zusammen.</p>
<p><strong>Zweck & Ziel:</strong> Schnelle, risikoarme Implementierung mit geteilten Verantwortlichkeiten: funktionsfähige MVPKette, nachvollziehbare Qualität und ein Weg zur Skalierung in den Regelbetrieb.</p>
</div>
<div class="grid">
<div class="card">
<h3>PowerON liefert</h3>
<ul>
<li>Gateway-APIs, Workflow-Engine, Neutralizer-Adapter, Standard-JSON-Ausgabe.</li>
<li>Connectors (MSFT/Google), Sicherheit (Auth, Mandanten, Audit).</li>
<li>Backend-UI-Schema, Beispiel-Workflows und Tests.</li>
</ul>
</div>
<div class="card">
<h3>Partner liefert</h3>
<ul>
<li>LLM Neutralizer API (intern, CH) inkl. Policies & Tuning.</li>
<li>Frontend-Renderer (Table/Form) gemäss Backend-Schema.</li>
<li>Dokument-Renderer für DOCX/XLSX/PPTX/HTML inkl. Corporate-Design.</li>
</ul>
</div>
<div class="card">
<h3>Offene Punkte</h3>
<ul>
<li>SLAs, Throughput/Batching, Timeouts für LLM-Endpunkt.</li>
<li>Schema-Versionierung und Komponenten-Lifecycle.</li>
<li>Branding-Vorlagen, Performance-Budgets der Renderer.</li>
</ul>
</div>
</div>
</div>
<div id="tab-next" class="tab-content">
<h2>Nächste Schritte</h2>
<div class="callout primary" style="margin-bottom:12px;">
<p><strong>Kontext:</strong> Nach der thematischen Einordnung werden die nächsten Schritte strukturiert vorbereitet von der technischen Klärung über einen belastbaren PoC bis hin zum Integrationsplan.</p>
<p><strong>Zweck & Ziel:</strong> Innerhalb weniger Wochen eine überprüfbare Lösung zeigen, Erkenntnisse in einen MVPBacklog überführen und mit definierten Meilensteinen produktionsreif werden.</p>
</div>
<div class="card" style="margin-bottom:14px;">
<ol>
<li>Technisches Alignment-Meeting (6090min) zu Endpunkten, Auth, Datenformaten.</li>
<li>Proof-of-Concept: a) Neutralizer-Call, b) UI-Renderer (Table/Form), c) DOCX-Renderer.</li>
<li>Integrationsplan (MVP Umfang, Milestones, Qualitätskriterien).</li>
</ol>
</div>
<div class="grid">
<div class="diagram">
<h3>🧭 Schritt 1: Alignment</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="→"><strong>Kickoff</strong><br><span class="muted">Ziele & Scope</span></div>
<div class="box has-next" data-arrow="→"><strong>API & Auth</strong><br><span class="muted">Endpoint, OAuth/mTLS</span></div>
<div class="box header"><strong>Datenformat</strong><br><span class="muted">Text/JSON/CSV</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li>Abgleich zu NeutralizerContract, Logging/SLAs, Datenschutz.</li>
</ul>
</div>
</div>
<div class="diagram">
<h3>🧪 Schritt 2: ProofofConcept</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="→"><strong>Neutralizer</strong><br><span class="muted">POST /anonymize</span></div>
<div class="box has-next" data-arrow="→"><strong>UIRenderer</strong><br><span class="muted">Table/Form Schema</span></div>
<div class="box header"><strong>DOCXRenderer</strong><br><span class="muted">Template ↔ JSON</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li>Nachweis: Qualität, Latenz, Fehlerfälle, BeispielDaten.</li>
</ul>
</div>
</div>
<div class="diagram">
<h3>🛠️ Schritt 3: Integrationsplan</h3>
<div class="row" style="margin-top:10px;">
<div class="box header has-next" data-arrow="→"><strong>MVP</strong><br><span class="muted">Umfang & Backlog</span></div>
<div class="box has-next" data-arrow="→"><strong>Milestones</strong><br><span class="muted">Sprints & Deliverables</span></div>
<div class="box header"><strong>Qualität</strong><br><span class="muted">KPIs, Tests, Betrieb</span></div>
</div>
<div class="legend" style="margin-top:10px;">
<ul>
<li>AbnahmeKriterien, Supportwege, GoLiveCheckliste.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
(function() {
function activate(hash) {
var links = document.querySelectorAll('.tab-link');
var tabs = document.querySelectorAll('.tab-content');
links.forEach(l => l.classList.remove('active'));
tabs.forEach(t => t.classList.remove('active'));
var target = document.querySelector(hash || '#tab-overview') || document.querySelector('#tab-overview');
if (target) { target.classList.add('active'); }
var link = Array.from(links).find(a => a.getAttribute('href') === (hash || '#tab-overview'));
if (link) { link.classList.add('active'); }
}
window.addEventListener('hashchange', function() { activate(location.hash); });
document.addEventListener('DOMContentLoaded', function() { activate(location.hash); });
})();
</script>
</html>

View file

@ -0,0 +1,322 @@
# All Call Sites for `callAiDocuments()``subCoreAi.callAiDocuments()`
This document lists all places in the codebase where `callAiDocuments()` is called, which ultimately routes through `mainServiceAi.callAiDocuments()` to `subCoreAi.callAiDocuments()`.
---
## Call Chain
```
Call Site → services.ai.callAiDocuments()
→ mainServiceAi.callAiDocuments()
→ subCoreAi.callAiDocuments()
```
---
## 1. MethodAi.process() - First Call Site
**File**: `gateway/modules/workflows/methods/methodAi.py`
**Line**: 114-119
**Context**: General AI processing method for workflow actions
```python
result = await self.services.ai.callAiDocuments(
prompt=aiPrompt,
documents=chatDocuments if chatDocuments else None,
options=options,
outputFormat=output_format
)
```
**Purpose**:
- Processes user prompts with optional documents
- Returns formatted output in specified format
- Used for general AI document generation tasks
**Parameters**:
- `prompt`: AI prompt (from `aiPrompt`)
- `documents`: Optional list of chat documents
- `options`: AI call options
- `outputFormat`: Desired output format
---
## 2. MethodAi.generateImage() - Second Call Site
**File**: `gateway/modules/workflows/methods/methodAi.py`
**Line**: 282-287
**Context**: Image generation workflow action
```python
result = await self.services.ai.callAiDocuments(
prompt=promptJson,
documents=None,
options=options,
outputFormat="base64"
)
```
**Purpose**:
- Generates images using AI
- Passes prompt as JSON string
- Returns base64 encoded image data
**Parameters**:
- `prompt`: JSON string containing image generation prompt
- `documents`: None (no documents for image generation)
- `options`: AI call options with image generation settings
- `outputFormat`: "base64" (returns image as base64 string)
**Note**: Uses `outputFormat="base64"` to get image data, not document structure.
---
## 3. MethodOutlook.sendEmail() - Third Call Site
**File**: `gateway/modules/workflows/methods/methodOutlook.py`
**Line**: 1187-1201
**Context**: Email composition and sending workflow action
```python
ai_response = await self.services.ai.callAiDocuments(
prompt=ai_prompt,
documents=chatDocuments,
options=AiCallOptions(
operationType="email_composition",
priority="normal",
compressPrompt=False,
compressContext=True,
processDocumentsIndividually=False,
processingMode="detailed",
resultFormat="json",
maxCost=0.50,
maxProcessingTime=30
)
)
```
**Purpose**:
- Generates email content using AI
- Composes email with subject, body, and attachment references
- Processes all documents together for email context
**Parameters**:
- `prompt`: AI prompt for email composition
- `documents`: Chat documents to include in email context
- `options`: Specialized options for email composition
- `outputFormat`: Not specified (defaults to text/JSON)
**Special Options**:
- `operationType="email_composition"`: Specific operation type
- `processDocumentsIndividually=False`: Process all docs together
- `processingMode="detailed"`: Detailed processing for email quality
- `resultFormat="json"`: Expects JSON response
---
## 4. ServiceWeb.search() - Fourth Call Site
**File**: `gateway/modules/services/serviceWeb/mainServiceWeb.py`
**Line**: 216-221
**Context**: Web search service method
```python
searchResult = await self.services.ai.callAiDocuments(
prompt=searchPrompt,
documents=None,
options=searchOptions,
outputFormat="json"
)
```
**Purpose**:
- Performs web search using AI
- Returns search results as JSON with URLs
- Used for finding relevant web content
**Parameters**:
- `prompt`: Web search prompt
- `documents`: None (no documents for search)
- `options`: `AiCallOptions` with `operationType=WEB_SEARCH`
- `outputFormat`: "json" (expects JSON with URLs)
**Options Used**:
```python
searchOptions = AiCallOptions(
operationType=OperationTypeEnum.WEB_SEARCH,
resultFormat="json"
)
```
---
## 5. ServiceWeb.crawl() - Fifth Call Site
**File**: `gateway/modules/services/serviceWeb/mainServiceWeb.py`
**Line**: 275-280
**Context**: Web crawling service method
```python
crawlResult = await self.services.ai.callAiDocuments(
prompt=crawlPrompt,
documents=None,
options=crawlOptions,
outputFormat="json"
)
```
**Purpose**:
- Crawls web pages using AI
- Extracts and structures web content
- Returns crawled data as JSON
**Parameters**:
- `prompt`: Web crawling prompt with URL
- `documents`: None (no documents for crawling)
- `options`: `AiCallOptions` with `operationType=WEB_CRAWL`
- `outputFormat`: "json" (expects JSON with crawled content)
**Options Used**:
```python
crawlOptions = AiCallOptions(
operationType=OperationTypeEnum.WEB_CRAWL,
resultFormat="json"
)
```
---
## 6. test3_ai_behavior.py - Sixth Call Site (Test)
**File**: `gateway/test3_ai_behavior.py`
**Line**: 83-88
**Context**: Test script for AI behavior testing
```python
response = await self.services.ai.callAiDocuments(
prompt=prompt, # Use the raw user prompt directly
documents=None,
outputFormat="json",
title="Prime Numbers Test"
)
```
**Purpose**:
- Testing AI behavior with various prompts
- Specifically tested with "Generate 9000 prime numbers"
- Validates the continuation and looping mechanism
**Parameters**:
- `prompt`: Raw user prompt (e.g., "Generate 9000 prime numbers")
- `documents`: None
- `outputFormat`: "json" (expects JSON document structure)
- `title`: Test title ("Prime Numbers Test")
**Note**: This is a test file, not production code.
---
## Summary Table
| # | Location | File | Line | Purpose | outputFormat | Has Documents |
|---|----------|------|------|---------|--------------|---------------|
| 1 | `MethodAi.process()` | `methodAi.py` | 114 | General AI processing | Variable | Optional |
| 2 | `MethodAi.generateImage()` | `methodAi.py` | 282 | Image generation | `"base64"` | No |
| 3 | `MethodOutlook.sendEmail()` | `methodOutlook.py` | 1187 | Email composition | Not specified | Yes |
| 4 | `ServiceWeb.search()` | `mainServiceWeb.py` | 216 | Web search | `"json"` | No |
| 5 | `ServiceWeb.crawl()` | `mainServiceWeb.py` | 275 | Web crawling | `"json"` | No |
| 6 | `AIBehaviorTester.test()` | `test3_ai_behavior.py` | 83 | Testing | `"json"` | No |
---
## Common Patterns
### Pattern 1: Document Generation with Format
Used by: MethodAi.process()
```python
await self.services.ai.callAiDocuments(
prompt=aiPrompt,
documents=chatDocuments,
options=options,
outputFormat=output_format # html, pdf, docx, txt, etc.
)
```
### Pattern 2: JSON Response
Used by: ServiceWeb.search(), ServiceWeb.crawl(), Test
```python
await self.services.ai.callAiDocuments(
prompt=prompt,
documents=None,
options=options,
outputFormat="json"
)
```
### Pattern 3: Specialized Operation Types
Used by: MethodOutlook.sendEmail(), ServiceWeb methods
```python
options = AiCallOptions(
operationType=OperationTypeEnum.EMAIL_COMPOSITION, # or WEB_SEARCH, WEB_CRAWL
...
)
await self.services.ai.callAiDocuments(
prompt=prompt,
documents=documents,
options=options,
outputFormat=...
)
```
### Pattern 4: Image Generation
Used by: MethodAi.generateImage()
```python
await self.services.ai.callAiDocuments(
prompt=promptJson, # JSON string
documents=None,
options=options,
outputFormat="base64" # Special format for images
)
```
---
## All Routes End Up In:
```python
# mainServiceAi.py (line 142)
return await self.coreAi.callAiDocuments(prompt, documents, options, outputFormat, title)
# subCoreAi.py (line 423)
async def callAiDocuments(...) -> Union[str, Dict[str, Any]]:
# Builds prompt using buildGenerationPrompt()
# Calls _callAiWithLooping() for iteration management
# Handles continuation and completion detection
```
---
## Notes
1. **All calls go through the same path**: Every `callAiDocuments()` call routes through `mainServiceAi``subCoreAi`, which means they all benefit from:
- The new generic prompt building logic
- Continuation and looping mechanism
- JSON repair and section extraction
- Completion detection
2. **Different Use Cases**:
- Document generation (MethodAi, with outputFormat)
- Image generation (MethodAi, with base64)
- Email composition (MethodOutlook, with specialized options)
- Web search/crawling (ServiceWeb, with operation types)
- Testing (test files)
3. **All Use Cases Work**: Since `subCoreAi.callAiDocuments()` uses `buildGenerationPrompt()`, which is generic and works for any user prompt, all these call sites will work correctly regardless of their specific use case.

View file

@ -0,0 +1,160 @@
```mermaid
flowchart TD
%% External/shared services/utilities
subgraph External and Shared
AiObjectsCall[AiObjects.call()];
AiObjectsGen[AiObjects.generateImage()];
ExtractionService[ExtractionService.extractContent()];
GenServicePrompt[GenerationService.getAdaptiveExtractionPrompt()];
GenServiceRender[GenerationService.renderReport()];
Normalizer[NormalizationService (discover/apply/validate)];
SubPipelineMerge[subPipeline._applyMerging()];
JsonUtilsExtract[jsonUtils.extractJsonString()];
JsonUtilsRepair[jsonUtils.repairBrokenJson()];
JsonUtilsSections[jsonUtils.extractSectionsFromDocument()];
JsonUtilsBuildCtx[jsonUtils.buildContinuationContext()];
BuildGenPrompt[subPromptBuilderGeneration.buildGenerationPrompt()];
UtilsSanitize[subSharedAiUtils.sanitizePromptContent()];
UtilsBuildPH[subSharedAiUtils.buildPromptWithPlaceholders()];
end
%% AiService
subgraph serviceAi mainServiceAi py - AiService
AiSvc_create[create()]
AiSvc_init[__init__()]
AiSvc_ensure[_ensureAiObjectsInitialized()]
AiSvc_initSubs[_initializeSubmodules()]
AiSvc_readImage[readImage()]
AiSvc_generateImage[generateImage()]
AiSvc_callPlan[callAiPlanning()]
AiSvc_callDocs[callAiDocuments()]
AiSvc_sanitize[sanitizePromptContent()]
end
AiSvc_create --> AiObjectsCall
AiSvc_create --> AiSvc_initSubs
AiSvc_initSubs --> ExtractionService
AiSvc_initSubs --> SubCore_new[SubCoreAi(...)]
AiSvc_initSubs --> SubDocProc_new[SubDocumentProcessing(...)]
AiSvc_initSubs --> SubDocGen_new[SubDocumentGeneration(...)]
AiSvc_ensure --> AiObjectsCall
AiSvc_ensure --> AiSvc_initSubs
AiSvc_readImage --> SubCore_readImage
AiSvc_generateImage --> SubCore_generateImage
AiSvc_callPlan --> SubCore_callPlan
AiSvc_callDocs --> SubCore_callDocs
AiSvc_sanitize --> UtilsSanitize
%% SubCoreAi
subgraph serviceAi subCoreAi py - SubCoreAi
SubCore_ctor[__init__()]
SubCore_analyze[_analyzePromptAndCreateOptions()]
SubCore_loop[_callAiWithLooping()]
SubCore_extract[_extractSectionsFromResponse()]
SubCore_should[_shouldContinueGeneration()]
SubCore_buildFinal[_buildFinalResultFromSections()]
SubCore_callPlan[callAiPlanning()]
SubCore_callDocs[callAiDocuments()]
SubCore_readImage[readImage()]
SubCore_generateImage[generateImage()]
end
SubCore_analyze --> AiObjectsCall
SubCore_analyze --> AiSvc_sanitize
SubCore_loop --> AiObjectsCall
SubCore_loop --> SubCore_extract
SubCore_loop --> SubCore_should
SubCore_loop --> SubCore_buildFinal
SubCore_extract --> JsonUtilsExtract
SubCore_extract --> JsonUtilsRepair
SubCore_extract --> JsonUtilsSections
SubCore_loop --> JsonUtilsBuildCtx
SubCore_callPlan --> UtilsBuildPH
SubCore_callPlan --> AiObjectsCall
SubCore_callDocs --> AiSvc_ensure
SubCore_callDocs --> SubCore_analyze
SubCore_callDocs --> BuildGenPrompt
SubCore_callDocs --> SubCore_loop
SubCore_callDocs --> GenServiceRender
SubCore_callDocs -->|documents present| AiSvc_callDocs_toDP[services.ai.documentProcessor.callAiText()]
SubCore_readImage --> AiObjectsCall
SubCore_generateImage --> AiObjectsGen
%% SubDocumentProcessing
subgraph serviceAi subDocumentProcessing py - SubDocumentProcessing
SDP_ctor[__init__()]
SDP_extractionService[prop: extractionService]
SDP_perChunk[processDocumentsPerChunk()]
SDP_perChunkJson[processDocumentsPerChunkJson()]
SDP_perChunkJsonPrompt[processDocumentsPerChunkJsonWithPrompt()]
SDP_withCont[processDocumentsWithContinuation()]
SDP_callText[callAiText()]
SDP_partsMap[_processPartsWithMapping()]
SDP_chunksMap[_processChunksWithMapping()]
SDP_mergeParts[_mergePartResults()]
SDP_convertPartsJson[_convertPartResultsToJson()]
SDP_mergeChunks[_mergeChunkResults()]
SDP_mergeChunksClean[_mergeChunkResultsClean()]
SDP_mergeChunksJson[_mergeChunkResultsJson()]
SDP_buildContPrompt[_buildContinuationPrompt()]
SDP_contLoop[_processWithContinuationLoop()]
SDP_buildIterPrompt[_buildContinuationIterationPrompt()]
end
SDP_extractionService --> ExtractionService
SDP_perChunk --> ExtractionService
SDP_perChunk --> SDP_partsMap
SDP_perChunk --> SDP_mergeParts
SDP_perChunkJson --> ExtractionService
SDP_perChunkJson --> SDP_partsMap
SDP_perChunkJson --> SDP_convertPartsJson
SDP_perChunkJson --> Normalizer
SDP_perChunkJsonPrompt --> ExtractionService
SDP_perChunkJsonPrompt --> SDP_chunksMap
SDP_perChunkJsonPrompt --> SDP_mergeChunksJson
SDP_withCont --> SDP_buildContPrompt
SDP_withCont --> SDP_contLoop
SDP_contLoop --> SDP_perChunkJsonPrompt
SDP_contLoop --> SDP_buildIterPrompt
SDP_callText --> SDP_perChunk
%% internals mapping to AI/external
SDP_partsMap --> AiObjectsCall
SDP_chunksMap --> SubCore_readImage
SDP_chunksMap --> AiObjectsCall
SDP_mergeParts --> SubPipelineMerge
SDP_convertPartsJson --> SubPipelineMerge
SDP_mergeChunks --> SubPipelineMerge
SDP_mergeChunksClean --> SubPipelineMerge
SDP_mergeChunksJson --> SubPipelineMerge
%% SubDocumentGeneration
subgraph serviceAi subDocumentGeneration py - SubDocumentGeneration
SDG_ctor[__init__()]
SDG_callGen[callAiWithDocumentGeneration()]
SDG_procUnified[_processDocumentsUnified()]
SDG_validateUnified[_validateUnifiedResponseStructure()]
SDG_validateDoc[_validateDocumentStructure()]
SDG_buildUnified[_buildUnifiedResult()]
SDG_processDoc[_processDocument()]
SDG_callAiJson[_callAiJson()]
SDG_postRaw[_postRawDataChatMessage()]
end
SDG_callGen --> GenServicePrompt
SDG_callGen --> SDG_procUnified
SDG_procUnified --> SDP_withCont
SDG_procUnified --> SDG_validateUnified
SDG_procUnified --> SDG_postRaw
SDG_buildUnified --> SDG_processDoc
SDG_processDoc --> BuildGenPrompt
SDG_processDoc --> AiObjectsCall
SDG_processDoc --> GenServiceRender
SDG_callAiJson --> SDP_perChunkJson
%% Cross-module interactions from AiService-created submodules (contextual)
AiSvc_initSubs --> SubCore_ctor
AiSvc_initSubs --> SDP_ctor
AiSvc_initSubs --> SDG_ctor
```

View file

@ -0,0 +1,193 @@
# Prompt Building Flow - Summary
## ✅ Current State: CLEAN AND SIMPLE
**No placeholders** - Everything handled through function parameters.
---
## Complete Flow
```
1. mainServiceAi.callAiDocuments()
└─> Delegates to subCoreAi.callAiDocuments()
2. subCoreAi.callAiDocuments()
├─> Builds FIRST prompt: buildGenerationPrompt(..., continuationContext=None)
└─> Calls _callAiWithLooping(prompt, ..., promptBuilder, promptArgs)
3. _callAiWithLooping() - Loops until complete
├─> Iteration 1: Uses prompt from step 2
└─> Iteration 2+:
├─> Builds continuationContext = buildContinuationContext(allSections, lastRawResponse)
└─> Calls promptBuilder(**promptArgs, continuationContext=continuationContext)
4. buildGenerationPrompt()
├─> If continuationContext has valid last_raw_json: Build CONTINUATION prompt
└─> Else: Build INITIAL prompt
5. buildContinuationContext()
└─> Returns: {section_count, last_raw_json} [Simplified - only what's needed]
```
---
## Key Files & Responsibilities
### `mainServiceAi.py`
- **Role**: Entry point, delegation only
- **Responsibility**: Initialize AI objects, delegate to subCoreAi
### `subCoreAi.callAiDocuments()`
- **Role**: Document generation coordinator
- **Responsibility**:
- Build first prompt
- Prepare promptArgs for continuation
- Call looping function
### `subCoreAi._callAiWithLooping()`
- **Role**: Iteration manager
- **Responsibility**:
- Manage iterations
- Build continuation context for iterations 2+
- Call prompt builder with context
- Extract sections and detect completion
### `subPromptBuilderGeneration.buildGenerationPrompt()`
- **Role**: Prompt builder
- **Responsibility**:
- Build initial prompt (if continuationContext=None or invalid)
- Build continuation prompt (if continuationContext has valid last_raw_json)
- Handle both cases in one function
### `jsonUtils.buildContinuationContext()`
- **Role**: Context builder
- **Responsibility**:
- Extract section_count from accumulated sections
- Extract and clean last_raw_json from last response
- Return minimal context dict
---
## Data Flow
```
Initial Call:
userPrompt, title, extracted_content
buildGenerationPrompt(..., continuationContext=None)
Initial Prompt (no continuation)
Continuation Call:
allSections, lastRawResponse
buildContinuationContext(allSections, lastRawResponse)
{section_count: N, last_raw_json: "..."}
buildGenerationPrompt(..., continuationContext={...})
Continuation Prompt (with last JSON fragment)
```
---
## Improvements Made
1. ✅ **Simplified `buildContinuationContext()`**
- Removed unused fields: `last_content_sample`, `last_content_type`, `continuation_guidance`
- Only returns: `section_count`, `last_raw_json`
2. ✅ **Improved empty JSON handling**
- Validates `last_raw_json` is not empty or `{}`
- Falls back to initial prompt if invalid
3. ✅ **Clearer continuation check**
- Single boolean `has_continuation` checks all conditions
- Eliminates nested if/else confusion
---
## No Placeholders Needed!
The old placeholder-based approach (`<CONTINUATION_INSTRUCTION>`) has been completely removed. All logic is handled through:
- Function parameters (`continuationContext`)
- Direct conditional logic in `buildGenerationPrompt()`
This is **much simpler** and easier to understand and maintain.
---
## ✅ Generic for Any User Prompt
**Yes, this logic works for ANY user prompt!**
### Why It's Generic:
1. **No Content Assumptions**
- `userPrompt` is inserted directly into prompts without parsing or validation
- No restrictions on length, format, or content type
- No language detection required - AI handles any language
2. **Flexible JSON Template**
- Supports multiple content types: `heading`, `paragraph`, `table`, `list`, `code`
- AI chooses appropriate `content_type` based on the request
- Can combine multiple content types in one document
3. **Generic Continuation**
- Shows the exact last JSON fragment (works with any content)
- No assumptions about what was generated
- AI continues from wherever the fragment stopped
4. **No Special Handling Required**
- Works for:
- Lists (like "Generate 9000 prime numbers")
- Text content (like "Write a story about...")
- Structured data (like "Create a report with tables")
- Code (like "Generate Python code for...")
- Mixed content (like "Create a document with headings, paragraphs, and tables")
### Example Prompts That Work:
```python
# Numbers/Data
"Generate the first 9000 prime numbers"
"List all countries and their capitals"
"Create a multiplication table from 1 to 100"
# Text Content
"Write a comprehensive guide about Python programming"
"Summarize the history of artificial intelligence"
"Create a document about project management best practices"
# Structured Data
"Create a report with sales data in tables"
"Generate a comparison chart of programming languages"
"Build a document with headings for each section"
# Code
"Generate Python code examples for common algorithms"
"Create documentation with code snippets"
"Write a tutorial with code blocks"
# Mixed Content
"Create a technical document with headings, paragraphs, lists, and code examples"
"Generate a report with introduction, tables, charts, and conclusion"
```
### Practical Considerations:
1. **Token Limits**: Very long prompts might hit model token limits, but this is handled by the continuation mechanism
2. **Special Characters**: Any characters in the prompt are passed through (AI handles them)
3. **Multi-line Prompts**: Fully supported - inserted into f-strings as-is
4. **Language**: Works with any language - AI detects and responds appropriately
### The Logic Adapts:
- **Initial Prompt**: Tells AI to generate content based on user request
- **Continuation Prompt**: Shows last fragment and asks to continue
- **Completion Detection**: AI sets `complete_response: true` when done
The AI model does the adaptation, not the code. The code just provides a consistent structure and continuation mechanism.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
# PowerOn Playground - Marketing Pitch
## 🚀 **Endlich KI nutzen ohne Datenschutzrisiken!**
## 🚀 **Endlich KI nutzen integriert, schrittweise, zukunftssicher, unlimitiert**
### **Der PowerOn Playground - Deine sichere KI-Workstation**
### **PowerOn Playground + Integrationsplattform Deine sichere KI-Workstation**
---
@ -18,33 +18,39 @@
## **Die PowerOn-Lösung:**
### **🎯 PowerOn Playground - Einfach. Sicher. Effizient.**
### **🎯 Integrationsplattform + Playground: Einfach. Sicher. Effizient.**
**Der PowerOn Playground ist deine persönliche KI-Workstation, die alle deine Datenquellen sicher verbindet und dabei deine sensiblen Informationen schützt.**
**PowerOn verbindet Menschen und Unternehmensdaten sicher, mandantenfähig und workflow-gesteuert. Der Playground ist der schnelle Einstieg, um Use Cases im Team zu testen und in produktive Services zu überführen.**
---
## **✨ Was macht den PowerOn Playground einzigartig?**
## **✨ Was macht PowerOn einzigartig?**
### **🔒 Integrierter Datenschutz-Neutralisierer**
- **Automatische Anonymisierung** sensibler Daten vor der KI-Verarbeitung
- **DSGVO-konform** - Nutze KI ohne Compliance-Risiken
- **Transparente Regeln** - Du bestimmst, was anonymisiert wird
### **Die 3 Kern-Assets**
1) **🔒 Neutralizer (Datenschutz-First)**
- **Automatische Anonymisierung** sensibler Daten vor der KI-Verarbeitung
- **DSGVO-konform**, transparente Regeln du bestimmst, was neutralisiert wird
- **Validierungs-Roadmap**: Level 1 Datenschutz jetzt; Level 2 kontextueller IP-Schutz folgt mit externem Validat/Cert (ETH/HSG/Partner)
### **♾️ Unlimitierte Verarbeitung**
- **Keine Token-Limits** - Verarbeite Dokumente jeder Grosse
- **Intelligente Chunking-Strategien** - Optimale Verarbeitung grosser Datenmengen
- **Nahtlose Integration** - SharePoint, Google Drive, Outlook, Jira - alles verbunden
2) **♾️ Unlimitierte Verarbeitung**
- **Keine Token-Limits** Dokumente jeder Grösse verarbeiten
- **Intelligentes Chunking** und Streaming für grosse Datenmengen
- **Nahtlose Konnektoren** SharePoint, Google Drive, Outlook, Jira u.v.m.
3) **🧠 Mandantenfähige Workflow-Engine**
- **Use Case → Workflow**: Einmal durchspielen, dann automatisch stündlich/täglich/wöchentlich ausführen
- **Mehr-Mandanten-fähig** klare Trennung, RBAC, Audit-Logs
- **Offene REST-API** UI/Module von Partnern und Community anbaubar
### **🎤 Voice-First-Ansatz**
- **Sprechen statt Tippen** - 10x schneller als herkömmliche Eingabe
- **Mehrsprachig** - Deutsch, Englisch, Französisch, Italienisch
- **Hands-free** - Arbeite, während du andere Tätigkeiten ausübst
- **Sprechen statt Tippen** bis zu 10x schneller
- **Mehrsprachig** Deutsch, Englisch, Französisch, Italienisch
- **Hands-free** arbeitet mit, während du anderes tust
### **🔄 Einfache Workflows**
- **Drag & Drop** - Intuitive Bedienung wie bei ChatGPT
- **Vorgefertigte Templates** - Für häufige Aufgaben
- **Echtzeit-Feedback** - Sieh Ergebnisse sofort
- **Drag & Drop** Intuitive Bedienung wie bei ChatGPT
- **Templates** Häufige Aufgaben sofort starten
- **Echtzeit-Feedback** Ergebnisse sofort sichtbar
---
@ -76,6 +82,13 @@
---
## **🧩 Standard-Services vs. Individuell**
- **Standard-Services (Preislisten-basiert)**: Neutralizer, Workflow-Engine, Voice, Connectoren direkt nutzbar, günstig skalierbar
- **Individuell (Projekt-Charakter)**: Branchen-/Kunden-spezifische Anpassungen via Partner-Ökosystem; nahtlos in die Plattform integrierbar
Ziel: Standard wo möglich, individuell wo sinnvoll ohne die Sicherheit und Betriebssicherheit zu kompromittieren.
## **💰 Transparentes Pricing - Keine Überraschungen:**
### **🎯 PowerOn Playground Starter**
@ -114,7 +127,7 @@
- **Manuelle Arbeit**: CHF 3.000-8.000 pro Monat weniger
### **Dein Netto-ROI:**
**CHF 250 Investition → CHF 7.000-17.500 Einsparung = 2.800-7.000% ROI**
**CHF 250 Investition → CHF 7.00017.500 Einsparung = 2.8007.000% ROI**
---
@ -123,7 +136,7 @@
### **Datenschutz-First-Ansatz:**
- **End-to-End-Verschlüsselung** aller Daten
- **DSGVO-konforme Verarbeitung** mit automatischer Anonymisierung
- **Schweizer Datenschutz-Standards** - Höchste Sicherheit
- **Schweizer Sicherheits-Standards** - Höchste Sicherheit
- **Audit-Logging** - Vollständige Nachverfolgbarkeit
### **Enterprise-Sicherheit:**
@ -132,6 +145,10 @@
- **SSO-Integration** - Nahtlose Anmeldung
- **Backup & Recovery** - 99.9% Verfügbarkeit
### **Neutralizer Validierung (Roadmap):**
- **Level 1**: Datenschutz-Anonymisierung produktiv, intern validiert
- **Level 2**: Kontextueller IP-Schutz externe Validierung/Zertifizierung (Uni/Partner) geplant
---
## **🚀 Sofortiger Start - Keine Wartezeit:**
@ -180,7 +197,7 @@
- **Persönlicher Ansprechpartner** - Direkter Kontakt zu unserem Team
### **Option 2: Kostenlose Demo**
- **30-Minuten-Demo** - Schaut Euch das Demo-Video an
- **30-Minuten-Demo** - Live oder Video
- **Mit Euren Daten** - Testen mit echten Dokumenten
- **Unverbindlich** - Keine Verpflichtungen
@ -226,10 +243,10 @@ A: Alle Daten werden DSGVO-konform verarbeitet und automatisch anonymisiert.
A: Ja, monatlich kündbar ohne Gebühren. Keine Mindestlaufzeit, keine versteckten Kosten.
### **Q: Funktioniert es mit unseren bestehenden Systemen?**
A: Ja, wir unterstützen alle gängigen Enterprise-Systeme. Falls nicht, entwickeln wir gerne einen Custom-Connector.
A: Ja, wir unterstützen alle gängigen Enterprise-Systeme. Falls nicht, entwickeln Partner einen Custom-Connector nahtlos integrierbar.
### **Q: Wie sicher ist die Plattform?**
A: Höchste Schweizer Sicherheitsstandards, End-to-End-Verschlüsselung, regelmässige Penetrationstests.
A: Höchste Schweizer Sicherheitsstandards, End-to-End-Verschlüsselung, regelmässige Penetrationstests, Audit-Logging und Mandantentrennung.
---

Binary file not shown.