Tool-Nutzung: tool_choice pro Agent konfigurierbar (default: any), wiederholte Instruktionen im System-Prompt, MaxIterations in appsettings

This commit is contained in:
Meleki committed 2026-02-28 19:33:41 +01:00
1 parent 8c9f54da79
commit ff67542ba6
10 files changed
+59 -9

No files matched your search

+4 -1
View File
@@ -151,11 +151,14 @@ public static class ChatEndpoint
if (!string.IsNullOrEmpty(workspace))
Directory.CreateDirectory(workspace);
var maxIterations = config.GetValue<int>("MaxIterations", 100);
var toolChoice = agent.ToolChoice ?? "any";
var anthropic = new AnthropicService(httpFactory, token, toolService, db);
streamingTracker.Start(sessionId, chainId);
try
{
await anthropic.StreamChat(res, modelId, systemPrompt, messages, chainId, workspace, sessionId, cancellationToken: cancellationToken);
await anthropic.StreamChat(res, modelId, systemPrompt, messages, chainId, workspace, sessionId, maxIterations: maxIterations, toolChoice: toolChoice, cancellationToken: cancellationToken);
}
finally
{