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: remove system messages for o1-family models #4923

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bassmang
Copy link
Collaborator

@bassmang bassmang commented Jan 7, 2025

No description provided.

Comment on lines +448 to +449
if self.model_info["family"] == "o1":
messages = prepare_o1_messages(messages)
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we should make this configurable, since doesn't o1 support system messages? It's just tricky since it blocks requests sometimes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Developer messages are the new system messages: Starting with o1-2024-12-17, o1 models support developer messages rather than system

This seems to be the new standard, I can try just converting to developer message instead

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.

Project coverage is 68.07%. Comparing base (7641577) to head (2f218bb).

Files with missing lines Patch % Lines
...xt/src/autogen_ext/models/openai/_openai_client.py 14.28% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4923      +/-   ##
==========================================
- Coverage   68.14%   68.07%   -0.08%     
==========================================
  Files         161      161              
  Lines       10171    10185      +14     
==========================================
+ Hits         6931     6933       +2     
- Misses       3240     3252      +12     
Flag Coverage Δ
unittests 68.07% <14.28%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

raise ValueError("No UserMessage found to append SystemMessage content.")

# Prepend the collected system content to the first user message
user_messages[0].content = f"{system_content.strip()}\n\n{user_messages[0].content.strip()}"
Copy link
Member

@afourney afourney Jan 8, 2025

Choose a reason for hiding this comment

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

I really don't think the client should be translating message types. If the client is being handed a system message, and the model is not compatible, this is an error.

Model family adjustments should be made at the Agent or application level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants