Skip to content

Comments

feat: AgentChat.NET Group Chat Patterns: Selector, Swarm#5838

Open
lokitoth wants to merge 6 commits intomainfrom
dev/agentchat_dotnet_groupchat
Open

feat: AgentChat.NET Group Chat Patterns: Selector, Swarm#5838
lokitoth wants to merge 6 commits intomainfrom
dev/agentchat_dotnet_groupchat

Conversation

@lokitoth
Copy link
Member

@lokitoth lokitoth commented Mar 5, 2025

Closes #5803

@codecov
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.22%. Comparing base (7d17b22) to head (3b07b5a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5838      +/-   ##
==========================================
- Coverage   75.65%   70.22%   -5.43%     
==========================================
  Files         189      262      +73     
  Lines       12784    14762    +1978     
  Branches        0      243     +243     
==========================================
+ Hits         9672    10367     +695     
- Misses       3112     4205    +1093     
- Partials        0      190     +190     
Flag Coverage Δ
unittests 70.22% <ø> (-5.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lokitoth lokitoth force-pushed the dev/agentchat_dotnet_groupchat branch from 5781c82 to 6b20bf0 Compare March 5, 2025 14:41
@lokitoth lokitoth requested a review from Copilot March 5, 2025 15:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request introduces two new group chat patterns for AgentChat.NET: Swarm and Selector, enhancing the framework's capabilities for dynamic group conversations.

  • Added a Swarm group chat manager that selects speakers based on recent handoff messages.
  • Implemented a Selector group chat manager using a customizable prompt and selector function.
  • Updated the PromptTemplate to support formatted message templates.

Reviewed Changes

File Description
dotnet/src/Microsoft.AutoGen/AgentChat/GroupChat/SwarmGroupChat.cs Implements Swarm group chat selection logic with minor error message text.
dotnet/src/Microsoft.AutoGen/AgentChat/Abstractions/PromptTemplate.cs Provides templated string formatting for chat prompts.
dotnet/src/Microsoft.AutoGen/AgentChat/GroupChat/SelectorGroupChat.cs Implements Selector group chat logic with customizable prompt and selector function.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

dotnet/src/Microsoft.AutoGen/AgentChat/GroupChat/SwarmGroupChat.cs:47

  • [nitpick] Consider changing 'handoff messages' to 'handoff message' for grammatical correctness.
throw new InvalidOperationException("The first participant must be able to produce a handoff messages.");

dotnet/src/Microsoft.AutoGen/AgentChat/GroupChat/SelectorGroupChat.cs:140

  • [nitpick] The word 'candidaate' appears to be misspelled; it should be 'candidate'. Additionally, confirm that the initializer syntax '[..' is intentional or replace it with valid C# syntax.
IEnumerable<string> participants = [.. from candidaate in this.groupOptions.Participants.Values

Copy link
Collaborator

@rysweet rysweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so awesome! looks like we have tests for this in python - let's port them - will help as soon as I can

lokitoth added a commit that referenced this pull request Mar 11, 2025
Partially addresses #5800, others pending the Agents PR #5837 and GroupChats PR #5838 coming in to have the classes to attach save/load logic to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port AgentChat Groups to .NET

3 participants