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

[Bug]: Wrong role set in group chat #3009

Open
hardchor opened this issue Jun 24, 2024 · 1 comment
Open

[Bug]: Wrong role set in group chat #3009

hardchor opened this issue Jun 24, 2024 · 1 comment
Labels
bug Something isn't working group chat group-chat-related issues

Comments

@hardchor
Copy link
Collaborator

hardchor commented Jun 24, 2024

Describe the bug

When running a group chat and retrieving the chat_result, all user messages are flagged as role="assistant".
This causes an issue, e.g. when using the chat_result to later on resume the conversation (or when relying on the role value to display whether a message came from the user in a UI).

Steps to reproduce

  1. Initiate a group chat
chat_result = user_proxy.initiate_chat(group_chat_manager, message="Hello world!")
  1. Send a few messages, exit & inspect the chat results

Model Used

gpt-4o

Expected Behavior

Messages coming from users (i.e. via UserProxyAgent) should be marked as role="user"

Screenshots and logs

No response

Additional Information

I noticed that https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L653 hardcodes "assistent", which is the value that ends up in self._oai_messages. Since GroupChatManager doesn't override the send function, I believe (!) this might be the culprit.

P.S.: I noticed https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L774 hardcoding "user" on the receiver side, which might cause a similar issue.

@hardchor hardchor added the bug Something isn't working label Jun 24, 2024
@marklysze marklysze added the group chat group-chat-related issues label Jun 25, 2024
@marklysze
Copy link
Collaborator

Hi @hardchor, would you be able to provide some code that shows the resume failing?

As a note, the use of the user roles on the internal messages may not reflect a human input, I believe they are more aligned with the alternating interaction between agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working group chat group-chat-related issues
Projects
None yet
Development

No branches or pull requests

2 participants