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

[Python] SelectorGroupChat to support concurrent speakers #5395

Open
ekzhu opened this issue Feb 6, 2025 · 2 comments
Open

[Python] SelectorGroupChat to support concurrent speakers #5395

ekzhu opened this issue Feb 6, 2025 · 2 comments

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Feb 6, 2025

SelectorGroupChat can support concurrent speakers by choosing multiple speakers at once, and have the manager waiting for all the selected speakers to respond before selecting the next round of speakers.

Related discussion: #5364

@CrankGentleman
Copy link

@ekzhu I also hope to execute multiple agents simultaneously. In my own project, there are agents for weather, air tickets, and hotels. However, I need it to initiate the parallel execution of three agents and then generate output. Clearly, this feature is currently not supported. This functionality is crucial as it can significantly shorten the waiting time for the entire application.

@ekzhu
Copy link
Collaborator Author

ekzhu commented Feb 25, 2025

It is actually not hard to add the support:

  1. Make select speaker method return multiple speakers as a list: update the selector_func signature to return str | List[str] | None.
  2. Update the default selection function to handle multiple speakers when the model returned more than one speaker names.
  3. In SelectorGroupChatManager, rather than publishing only one RequestToSpeak event, publish one for each selected agent's topic type.
  4. In SelectorGroupChatManager, buffer agent responses when there are multiple concurrent agent speakers, only start checking termination conditions etc after all speaker responded.

3 and 4 requires some refactoring of BaseGroupChatManager and have SelectorGroupChatManager override some methods in the base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants