Skip to content
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

Allow user to pass in a customized speaker selection method #1791

Merged
merged 30 commits into from
Mar 7, 2024
Merged

Conversation

yiranwu0
Copy link
Collaborator

@yiranwu0 yiranwu0 commented Feb 26, 2024

Allow user to pass in a customized_speaker_selection_func(last_speaker: Agent, messages: List[Dict]) to determine what should be the next agent.
If the function returns None, the default speaker_selection_method is used.

Why are these changes needed?

Related issue number

Potentially closes #778

Checks

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 59.67%. Comparing base (676e8e1) to head (3d729b4).
Report is 2 commits behind head on main.

Files Patch % Lines
autogen/agentchat/groupchat.py 68.42% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1791       +/-   ##
===========================================
+ Coverage   36.10%   59.67%   +23.56%     
===========================================
  Files          63       63               
  Lines        6658     6670       +12     
  Branches     1470     1600      +130     
===========================================
+ Hits         2404     3980     +1576     
+ Misses       4056     2330     -1726     
- Partials      198      360      +162     
Flag Coverage Δ
unittests 59.46% <68.42%> (+23.35%) ⬆️

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.

@qingyun-wu
Copy link
Contributor

@kevin666aa is this ready for review? It is currently a draft PR. Please make a PR once it is ready. Thanks!

@qingyun-wu
Copy link
Contributor

Could you add the link to the newly added example in the Example page on website: https://microsoft.github.io/autogen/docs/Examples? Thanks!

@qingyun-wu qingyun-wu added this pull request to the merge queue Mar 7, 2024
Merged via the queue into main with commit c37227b Mar 7, 2024
59 of 60 checks passed
@sonichi sonichi deleted the dcheck branch March 7, 2024 02:55
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
…t#1791)

* init PR

* update

* update code check

* update

* update

* update

* update

* Test the ability to have agents a,u,t,o,g,e,n speak in turn.

* update

* update

* update

* Evidence that groupchat not terminating because of the TERMINATE substring.

* Raising NoEligibleSpeakerException allows graceful exit before max turns

* update

* To confirm with author that custom function is meant to override graph constraints

* Confirmed the expected test behaviour with author

* Update autogen/agentchat/groupchat.py

* update

* update

---------

Co-authored-by: Joshua Kim <Joshua@spectdata.com>
Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants