autogen
autogen copied to clipboard
Use structured outputs for speaker selection in `SelectorGroupChat`
Why are these changes needed?
To improve the reliability of speaker selection in SelectorGroupChat by using structured outputs.
Related issue number
Closes #5970
Checks
- [x] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md to build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes introduced in this PR.
- [x] I've made sure all auto checks have passed.
Hi @ekzhu,
I’m encountering the following mypy error:
src/autogen_agentchat/teams/_group_chat/_selector_group_chat.py:183: error: Second
argument of Enum() must be string, tuple, list or dict literal for mypy to determine Enum members [misc]
This error occurs on the line:
AgentName = Enum("AgentName", agent_name_map)
Since we need to dynamically create the Enum, I’m using # type: ignore to bypass the error.
References:
Thanks for the change. We will run some benchmarks on our side and see.
cc @afourney