- 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
71 lines
2.2 KiB
C#
71 lines
2.2 KiB
C#
using System.Collections.Generic;
|
|
using Gott.Services;
|
|
|
|
namespace Gott.Models;
|
|
|
|
public class ChatContext
|
|
{
|
|
public string ChainId { get; set; }
|
|
public string SessionId { get; set; }
|
|
public string ModelId { get; set; }
|
|
public string Workspace { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string SystemPromptText { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public List<PromptBlock> PromptBlocks { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public int MaxIterations { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
public SessionRecord Session { get; set; }
|
|
public bool PlanMode { get; set; }
|
|
|
|
// Preparer-Agent (vor dem Worker)
|
|
public PreparerContext Preparer { get; set; }
|
|
|
|
// Review-Agent
|
|
public ReviewContext Review { get; set; }
|
|
|
|
// Finalizer-Agent
|
|
public FinalizerContext Finalizer { get; set; }
|
|
}
|
|
|
|
public class PreparerContext
|
|
{
|
|
public string ModelId { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string Workspace { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public bool AllowUserChoice { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
}
|
|
|
|
public class FinalizerContext
|
|
{
|
|
public string ModelId { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string Workspace { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
}
|
|
|
|
public class ReviewContext
|
|
{
|
|
public string ModelId { get; set; }
|
|
public List<object> SystemPrompt { get; set; }
|
|
public string AgentId { get; set; }
|
|
public string Workspace { get; set; }
|
|
public bool UseMemory { get; set; }
|
|
public string WebSearchVersion { get; set; }
|
|
public string ToolChoice { get; set; }
|
|
public int MaxReviewIterations { get; set; }
|
|
public AgentRecord Agent { get; set; }
|
|
}
|