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

Fix for Anthropic client class so system messages aren't lost #3392

Merged
merged 6 commits into from
Sep 3, 2024

Conversation

marklysze
Copy link
Collaborator

@marklysze marklysze commented Aug 20, 2024

At the moment if the set of messages for inference has more than one system message, only the last system message will be put into the Anthropic API system parameter.

During some testing of group chats I noticed there are multiple system messages for speaker selection in auto mode. So this meant the speaker selection was losing context and failing.

This PR simply concatenates the system messages together and it proves effective.

Why are these changes needed?

Group Chat doesn't work effectively with Anthropic models when in auto mode without it.

Related issue number

None raised.

Checks

@marklysze marklysze added the models Pertains to using alternate, non-GPT, models (e.g., local models, llama, etc.) label Aug 20, 2024
@marklysze marklysze requested a review from Hk669 August 20, 2024 19:57
Copy link
Contributor

@Hk669 Hk669 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks clean. thanks @marklysze

@marklysze
Copy link
Collaborator Author

There are errors in the openai tests. @marklysze

Hi @thinkall, I don't believe the OpenAI tests are required for this PR and I believe they are throwing the error:

if not skip_openai:
    config_list = autogen.config_list_from_json(

I'm not clear on how to bypass them for the checks.

The exception is related to a missing notebook/OAI_CONFIG_LIST file.

@thinkall thinkall added this pull request to the merge queue Sep 3, 2024
Merged via the queue into main with commit 0871b3c Sep 3, 2024
146 of 158 checks passed
@thinkall thinkall deleted the anthropic-system-messages-fix branch September 3, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models Pertains to using alternate, non-GPT, models (e.g., local models, llama, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants