feat: OpenAI-kompatibler Provider (Nvidia/g4f.space) mit Tool-Calling und SSE-Streaming

- 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
This commit is contained in:
Meleki committed 2026-03-11 16:15:09 +01:00
1 parent a646e695cd
commit 7972ca6a3a
6 files changed
+665 -2

No files matched your search

+1
View File
@@ -8,6 +8,7 @@ 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; }