refactor: Backend-Deduplizierung – Parameter-Objekte, Shared Helpers, KeyCheckDispatcher

- ToolDefinitionOptions + ToolExecutionContext ersetzen lange Parameterlisten in ToolService
- AppendToLastMessage-Helper in ChatService eliminiert 5x duplizierte Logik
- OpenAiService: ResolveProviderConfig + BuildApiMessages + ConvertToOpenAiTools statt doppeltem Code
- Tool-Definitionen aus einer Quelle (Anthropic→OpenAI Konvertierung statt hardcodierter Liste)
- KeyCheckDispatcher zentralisiert Key-Check-Dispatch (ApiKeysEndpoint, KeyScanner, GitHubEventScanner)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.6 committed 2026-03-19 08:01:49 +01:00
1 parent f3069cedf7
commit 3e19da4d48
12 files changed
+428 -487

No files matched your search

+15
View File
@@ -1,6 +1,8 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Gott.Services;
@@ -102,6 +104,19 @@ public static class KeyPatterns
return type == "anthropic_oauth" || type == "anthropic_api" || type == "anthropic_unknown";
}
/// <summary>
/// Mappt einen Key-Typ auf den Provider-Namen für den Checker.
/// Gibt null zurück wenn kein Checker verfügbar ist.
/// </summary>
public static string GetCheckerProvider(string type)
{
if (IsAnthropic(type)) return "anthropic";
if (type == "openai_project" || type == "openai_service" || type == "openai_legacy") return "openai";
if (type == "google_api") return "google";
if (type == "stripe_live" || type == "stripe_test") return "stripe";
return null;
}
/// <summary>Menschenlesbarer Name für den Key-Typ.</summary>
public static string DisplayName(string type)
{