refactor: Backend deduplizieren – 13 Dateien, -528 Zeilen netto
ChatContext: 3 identische Context-Klassen (PreparerContext, ReviewContext, FinalizerContext) zu einer SubAgentContext-Klasse zusammengefasst. ChatService: 3x40 Zeilen Sub-Agent-Setup durch BuildSubAgentContext() ersetzt. AnthropicService: 5 Hilfsmethoden extrahiert – ExtractWebSearchSources(), TruncateToolResult(), AddToolsToPayload(), ParseServerToolUse(), TrackUsage(). WorkspaceEndpoint: 5 Session/Agent-Endpoint-Paare durch generische Core-Handler mit basePath-Parameter ersetzt. Ungenutzte rmdir-Endpoints entfernt. AgentEndpoint: Doppeltes Agent-DTO-Mapping durch MapAgentList() ersetzt. SessionEndpoint: Doppelte Session/Agent-Auflösung durch ResolvePromptContext() ersetzt. DatabaseService: Toten Code entfernt (SetSessionTelegramChatId, ClearSessionTelegramChatId, GetSessions, GetUserSessions). ConvertDataUrlToWebP und ResizeDataUrlToWebP zu einer Methode zusammengefasst. TelegramEndpoint: Bot-DTO-Mapping durch MapBotResponse() dedupliziert. KreaEndpoint + SkillEndpoint: Thumbnail-Generierung in ImageService.GenerateThumbnail() extrahiert, SixLabors-Imports aus Endpoints entfernt. CronjobEndpoint: 7x ctx.Items[UserId] durch ctx.GetUserId() ersetzt.
This commit is contained in:
1 parent
0097ce69db
commit
dcedbaa074
13 files changed
+447
-975
No files matched your search
+8
-28
@@ -22,16 +22,16 @@ public class ChatContext
|
||||
public bool PlanMode { get; set; }
|
||||
|
||||
// Preparer-Agent (vor dem Worker)
|
||||
public PreparerContext Preparer { get; set; }
|
||||
public SubAgentContext Preparer { get; set; }
|
||||
|
||||
// Review-Agent
|
||||
public ReviewContext Review { get; set; }
|
||||
public SubAgentContext Review { get; set; }
|
||||
|
||||
// Finalizer-Agent
|
||||
public FinalizerContext Finalizer { get; set; }
|
||||
public SubAgentContext Finalizer { get; set; }
|
||||
}
|
||||
|
||||
public class PreparerContext
|
||||
public class SubAgentContext
|
||||
{
|
||||
public string ModelId { get; set; }
|
||||
public List<object> SystemPrompt { get; set; }
|
||||
@@ -40,31 +40,11 @@ public class PreparerContext
|
||||
public bool UseMemory { get; set; }
|
||||
public string WebSearchVersion { get; set; }
|
||||
public string ToolChoice { get; set; }
|
||||
public AgentRecord Agent { get; set; }
|
||||
|
||||
// Preparer-spezifisch
|
||||
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; }
|
||||
// Review-spezifisch
|
||||
public int MaxReviewIterations { get; set; }
|
||||
public AgentRecord Agent { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user