-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Feature Request]: Allowing user to specify the "role" field for select speaker messages #1861
Comments
Hey @ekzhu, can you give us some examples under Additional Context of this ticket on what are the expected values for |
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 - Also includes:
|
… Group Chats (Replaces PR #2167) (#2199) * Re-commit of code from PR (#2167) addressing #1861, due to wrong basing * Update website/docs/topics/non-openai-models/best-tips-for-nonopenai-models.md Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> * Removed unnecessary notebook images * Update conversation-patterns.ipynb Updated to include note about being applicable when auto. * Updated to include checks that the role is not blank/None. Added tests. * Changed try-except to use pytest --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This is done by #2199 |
… Group Chats (Replaces PR microsoft#2167) (microsoft#2199) * Re-commit of code from PR (microsoft#2167) addressing microsoft#1861, due to wrong basing * Update website/docs/topics/non-openai-models/best-tips-for-nonopenai-models.md Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> * Removed unnecessary notebook images * Update conversation-patterns.ipynb Updated to include note about being applicable when auto. * Updated to include checks that the role is not blank/None. Added tests. * Changed try-except to use pytest --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
Based on discussion in this thread: #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:autogen/autogen/agentchat/groupchat.py
Line 384 in c83d8d8
can be customized based on the field
role_for_select_speaker_messages
.No response
The text was updated successfully, but these errors were encountered: