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

Delivering multiple system messages is not supported by the local model deployed by the fschat-wrapped OpenAI API, which only supports a single system message #595

Closed
aizaiyishunjian opened this issue Nov 8, 2023 · 7 comments
Labels
0.2 Issues which were filed before re-arch to 0.4 group chat/teams group-chat-related issues help wanted Extra attention is needed models Pertains to using alternate, non-GPT, models (e.g., local models, llama, etc.)

Comments

@aizaiyishunjian
Copy link

GroupChatManager requests the 'messages' of the model, passing multiple system messages.

{
    "messages":[
    {"role": "system", "content": "You are in a role play game. The following roles are available:\n User_proxy: \n Agency_Manager: \n   You are the Project Manager. Be concise and avoid pleasantries. Refrain from any conversations that don"t serve the goal of the user, ie.thank you... \n Agency_Researcher: \n ..."}, 
    {"role": "user", "name": "User_proxy", "content": "\n        如何提高公司订单效益\n        "}, 
    {"role": "system", "content": "Read the above conversation. Then select the next role from ['User_proxy', 'Agency_Manager', 'Agency_Researcher', 'Agency_Strategist', 'Agency_Copywriter'] to play. Only return the role."}]
}

However, for encapsulated OpenAI APIs like fschat, the setting of system messages is overridden, hence only one is retained.:

    def set_system_message(self, system_message: str):
        """Set the system message."""
        self.system_message = system_message


        for message in messages:
            msg_role = message["role"]
            if msg_role == "system":
                conv.set_system_message(message["content"])
            elif msg_role == "user":
                conv.append_message(conv.roles[0], message["content"])
            elif msg_role == "assistant":
                conv.append_message(conv.roles[1], message["content"])
            else:
                raise ValueError(f"Unknown role: {msg_role}")
@afourney afourney added group chat/teams group-chat-related issues models Pertains to using alternate, non-GPT, models (e.g., local models, llama, etc.) labels Nov 8, 2023
@afourney
Copy link
Member

afourney commented Nov 8, 2023

It looks to me like these APIs would also have a problem with the "name" attribute that is important for Group Chat scenarios. I'm not sure compatibility will be easy to achieve. @LittleLittleCloud

@sonichi
Copy link
Contributor

sonichi commented Nov 12, 2023

For the multi-system-message issue, you can override the select_speaker() function. The "name" attribute issue mentioned by @afourney needs attention too.

@venkat-arvo
Copy link

multiple 'system' messages are also causing a problem with using litellm proxy on claude 3 models. is there a work around for this issue?

@ekzhu
Copy link
Collaborator

ekzhu commented Mar 23, 2024

multiple 'system' messages are also causing a problem with using litellm proxy on claude 3 models. is there a work around for this issue?

here is a potential fix, do you want to try to implement it? #1861

@afourney
Copy link
Member

Increasingly I think we need middleware for messages. The format AutoGen uses should be able to diverge from that used by the LLMs, with messages transformed just prior to making the LLM call.

@j-dominguez9
Copy link

I'm getting the following error using groupchats with Claude-3. I believe it might be related to this issue. Followed the example on the documentation for configuration.

anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.0.name: Extra inputs are not permitted'}}

@thinkall thinkall added the help wanted Extra attention is needed label Jun 18, 2024
jackgerrits added a commit that referenced this issue Oct 2, 2024
* Add confirmation for messages produced by Coder

* change confirmation to be on executor
@rysweet rysweet added 0.2 Issues which were filed before re-arch to 0.4 needs-triage labels Oct 2, 2024
@rysweet
Copy link
Collaborator

rysweet commented Oct 12, 2024

unlikely that this will be implemented for 0.2 and 0.4 arch obviates the need, I think. please reopen if you object

@rysweet rysweet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which were filed before re-arch to 0.4 group chat/teams group-chat-related issues help wanted Extra attention is needed models Pertains to using alternate, non-GPT, models (e.g., local models, llama, etc.)
Projects
None yet
Development

No branches or pull requests

8 participants