Closed ekzhu closed 7 months ago
@joshkyh @kevin666aa @qingyun-wu @sonichi
Hey @ekzhu, can you give us some examples under Additional Context of this ticket on what are the expected values for role_for_select_speaker_messages
and how each value would affect the GroupChat instance behaviour?
Hey @ekzhu, can you give us some examples under Additional Context of this ticket on what are the expected values for
role_for_select_speaker_messages
and how each value would affect the GroupChat instance behaviour?
Updated the description.
@YangQiuEric @Liques @richdrummer33 @akashAD98 @spincrisis @dsalas-crogl have all reported this issue.
I've also recently had an issue with the role:system problem. I believe it was when I tried to use Huggingface's API, only user and assistant were valid roles. Being able to replace system with user would help.
I'll look into this and try and get it sorted out :)
I've submitted a PR, #2167, to address the change to GroupChat to enable the setting of the role name for select speaker messages.
New constructor parameter as per @ekzhu's suggestion above - role_for_select_speaker_messages
on the GroupChat's constructor, which is an optional string attribute that defaults to system
.
Also includes:
This is done by #2199
Is your feature request related to a problem? Please describe.
Based on discussion in this thread: https://github.com/microsoft/autogen/issues/991. Mistral (and maybe other open source LLMs) requires the system messages to be before messages with user and assistant roles. So GroupChat select speaker "auto" mode can fail when the messages' roles are not in expected order.
I know #1791 is adding a more general way to address this, but a simpler approach should help to fix this without asking user to write custom function.
Describe the solution you'd like
In GroupChat's constructor, add a field
role_for_select_speaker_messages
with default set tosystem
. use this field in select speaker function in "auto" mode.Additional context
The expected values for
role_for_select_speaker_messages
would besystem
anduser
.The
role
in current line:https://github.com/microsoft/autogen/blob/c83d8d89e5e2b217e0a3a2a6f06346b2bb1786be/autogen/agentchat/groupchat.py#L384
can be customized based on the field
role_for_select_speaker_messages
.No response