Replies: 1 comment
-
|
This is a common issue with group chats and tool execution. Here are some approaches: 1. Dedicated Tool AgentInstead of having all agents invoke tools, designate one agent as the "tool executor": // Analyzer agent - no tools, just analysis
var analyzerAgent = new ChatCompletionAgent {
Name = "Analyzer",
Instructions = "Analyze and request tool calls from ToolExecutor"
};
// Tool executor - has all tools
var toolExecutorAgent = new ChatCompletionAgent {
Name = "ToolExecutor",
Instructions = "Execute tools when requested",
Kernel = kernelWithTools,
Arguments = new KernelArguments(settings)
};2. State-Based Tool RoutingTrack tool requests in shared state: var state = new Dictionary<string, object> {
["pending_tool_calls"] = new List<ToolCall>(),
["tool_results"] = new Dictionary<string, object>()
};
// When agent requests tool
if (message.Contains("TOOL_REQUEST:")) {
state["pending_tool_calls"].Add(ParseToolRequest(message));
// Route to tool executor
}3. Check Agent Kernel ConfigurationEnsure each agent in the group has its own properly configured Kernel: foreach (var agent in groupChat.Agents) {
if (agent is ChatCompletionAgent cca) {
// Verify kernel has plugins
var plugins = cca.Kernel.Plugins;
// Verify settings allow auto-invoke
}
}Root CauseIn group chats, the orchestration layer may intercept messages before tool calls are processed. The solution is often to make tool execution explicit rather than relying on auto-invocation. Could you share how your ChatGroup is configured? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing a multi-agentic solution, the problem is that on C# I don't see clear documentarion on how to do this. I have made my ChatCompletionAgents with toolcalls, individually they do work properly, but on the ChatGroup they don't.
I cannot share code due to privacy on it.
But my ChatCompletionAgents are something like this:
And my Orchestration is as how it is seen in this sample:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/Orchestration/Step03_GroupChat.cs
Beta Was this translation helpful? Give feedback.
All reactions