feat: Agent-Einstellung 'Rückfragen erlauben' (allowUserChoice)

- Neues Feld AllowUserChoice (bool, default true) im AgentRecord
- DB-Migration: allow_user_choice Spalte mit DEFAULT 1
- Agent-Form: Checkbox 'Rückfragen erlauben' nach 'Tool-Nutzung erzwingen'
- ToolService.GetToolDefinitions: neuer Parameter includeUserChoice
- ask_user_choice Tool wird nur eingebunden wenn Agent es erlaubt
- Review-Agents und Non-Streaming (Cronjobs) erhalten nie ask_user_choice
- ChatEndpoint reicht Agent.AllowUserChoice an StreamChat durch
This commit is contained in:
Meleki committed 2026-03-07 11:36:02 +01:00
1 parent 5f3e308975
commit 89ceb61948
10 files changed
+26 -36

No files matched your search

+3 -3
View File
@@ -17,11 +17,11 @@ public class ToolService
{
public const string AskUserChoiceToolName = "ask_user_choice";
public object[] GetToolDefinitions(bool includeFileTools = false, bool includeMemory = false)
public object[] GetToolDefinitions(bool includeFileTools = false, bool includeMemory = false, bool includeUserChoice = true)
{
var allTools = new List<object>();
// ask_user_choice ist immer verfügbar wenn Tools aktiv sind
allTools.Add(GetAskUserChoiceTool());
if (includeUserChoice)
allTools.Add(GetAskUserChoiceTool());
if (includeFileTools)
allTools.AddRange(GetFileTools());
if (includeMemory)