-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add C# GroupChat tool approval sample for multi-agent orchestrations #3374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
|
@copilot add this project to the solution |
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
| // First speaker after initial user message | ||
| if (this.IterationCount == 0) | ||
| { | ||
| AIAgent qaAgent = this._agents.First(a => a.Id == "QAEngineer"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Shouldn't the Name property be used here and in line 44 instead of Id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot use the Name property as mentioned above instead of the Id property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 2535dde. Changed from a.Id to a.Name on both lines 39 and 44.
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
|
@copilot dotnet build failed with the errors: |
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Fixed in commit 7610a6d. Added UTF-8 BOM to both |
Motivation and Context
Adds C# equivalent of the Python
group_chat_builder_tool_approval.pysample to demonstrate human-in-the-loop approvals within multi-agent workflows.Description
Implements a deployment workflow where QA and DevOps agents collaborate, with production deployment requiring human approval.
Implementation:
Program.cs- Two-phase workflow: run until approval needed, handle approval, resumeDeploymentGroupChatManager.cs- Custom speaker selection extendingGroupChatManagerusing agentNameproperty for selectionApprovalRequiredAIFunctionwrapper for sensitive operationsFunctionApprovalRequestContentduring workflow executionagent-framework-dotnet.slnxsolution file in/Samples/GettingStarted/Workflows/Agents/folderKey patterns demonstrated:
Technical notes:
GroupChatManagersubclasses from external assemblies must useprotected(notprotected internal)ChatClientAgentconstructor, not as settable propertiesNameproperty (set during agent creation) rather than the auto-generatedIdpropertyContribution Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.