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:
1 parent
f3069cedf7
commit
3e19da4d48
12 files changed
+428
-487
No files matched your search
@@ -589,7 +589,14 @@ public partial class AnthropicService
|
||||
|
||||
string toolResult;
|
||||
bool isError = false;
|
||||
try { toolResult = await _toolService.ExecuteTool(currentToolName, inputEl, workspace, _memoryService, agentId, workCt, remoteMgr: remoteMgr, sessionId: sessionId, vectorSearch: _vectorSearch, embeddingBg: _embeddingBg, db: _db, chatService: _chatService, anthropicService: this, openAiService: _openAiService, userId: userId, telegramService: _telegramService, apiToken: apiToken); }
|
||||
try { toolResult = await _toolService.ExecuteTool(currentToolName, inputEl, new ToolExecutionContext
|
||||
{
|
||||
Workspace = workspace, MemoryService = _memoryService, AgentId = agentId,
|
||||
CancellationToken = workCt, RemoteMgr = remoteMgr, SessionId = sessionId,
|
||||
VectorSearch = _vectorSearch, EmbeddingBg = _embeddingBg, Db = _db,
|
||||
ChatService = _chatService, AnthropicService = this, OpenAiService = _openAiService,
|
||||
UserId = userId, TelegramService = _telegramService, ApiToken = apiToken
|
||||
}); }
|
||||
catch (OperationCanceledException) { throw; }
|
||||
catch (Exception ex) { toolResult = $"Fehler: {ex.Message}"; isError = true; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user