- OpenAiService.cs: Neuer Service für OpenAI-kompatible APIs - SSE-Streaming mit text_start/text_delta/text_end Events - Tool-Calling: list_files, read_file, write_file, edit_file, delete_file, execute - Agentic Loop (max 10 Iterationen) - Tool-Use + Tool-Result in DB gespeichert - History-Rebuild: Anthropic-Format → OpenAI-Format (tool_use/tool_result korrekt konvertiert) - ChatContext.cs: Provider-Feld hinzugefügt - ChatService.cs: OpenAI-Provider-Erkennung in ResolveModelId + PrepareContext - ChatEndpoint.cs: Provider-Dispatch (nvidia → OpenAiService, sonst → AnthropicService) - Program.cs: OpenAiService als Singleton registriert - wwwroot/index.html: nvidia:moonshotai/kimi-k2.5 in Modell-Auswahl
52 lines
1.6 KiB
C#
52 lines
1.6 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 Provider { get; set; } // "" = Anthropic, "nvidia" = OpenAI-kompatibler Provider
|
|
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 SubAgentContext Preparer { get; set; }
|
|
|
|
// Review-Agent
|
|
public SubAgentContext Review { get; set; }
|
|
|
|
// Finalizer-Agent
|
|
public SubAgentContext Finalizer { get; set; }
|
|
}
|
|
|
|
public class SubAgentContext
|
|
{
|
|
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; }
|
|
|
|
// Preparer-spezifisch
|
|
public bool AllowUserChoice { get; set; }
|
|
|
|
// Review-spezifisch
|
|
public int MaxReviewIterations { get; set; }
|
|
}
|