Auto-Reminder alle 30 Messages + History-Limit 120

- SystemPromptBuilder.BuildReminder(): generiert automatisch Reminder-Text
  aus den aktiven Prompt-Blöcken (Identity, Workspace, Memory, etc.)
- Alle ~30 Messages wird ein [System Reminder]-Paar in die History injiziert
  (nur nach assistant-Messages, um user/assistant-Alternierung zu wahren)
- History auf maximal 120 Messages begrenzt (älteste werden entfernt)
- ChatContext um PromptBlocks-Property erweitert
- Alle Aufrufer (ChatEndpoint, TelegramService, CronjobService) übergeben
  promptBlocks an BuildHistoryFromDb
This commit is contained in:
Meleki committed 2026-03-09 06:35:35 +01:00
1 parent 83945689a6
commit 47d6f44e07
6 files changed
+91 -6

No files matched your search

+1 -1
View File
@@ -87,7 +87,7 @@ public class CronjobService : BackgroundService
throw new Exception("Session oder Agent nicht gefunden / nicht konfiguriert");
// History aus DB laden
var history = await _chatService.BuildHistoryFromDb(job.SessionId);
var history = await _chatService.BuildHistoryFromDb(job.SessionId, promptBlocks: ctx.PromptBlocks);
// User-Nachricht hinzufügen
var userContent = new List<object> { new { type = "text", text = job.Prompt } };