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

OpenAI o1 requires "developer" messages instead of "system" messages #1621

Closed
sigren opened this issue Dec 21, 2024 · 3 comments · Fixed by #1717
Closed

OpenAI o1 requires "developer" messages instead of "system" messages #1621

sigren opened this issue Dec 21, 2024 · 3 comments · Fixed by #1717

Comments

@sigren
Copy link

sigren commented Dec 21, 2024

Developer messages are the new system messages: Starting with o1-2024-12-17, o1 models support developer messages rather than system messages, to align with the chain of command behavior described in the model spec. Learn more.

<class 'openai.BadRequestError'> Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'system' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}

@manthanguptaa
Copy link
Contributor

Hey @sigren, thanks for raising this issue. We will test it on our side and keep you updated about it

@cnspary
Copy link

cnspary commented Jan 6, 2025

Any updates?

Hey @sigren, thanks for raising this issue. We will test it on our side and keep you updated about it

@ysolanky
Copy link
Contributor

ysolanky commented Jan 6, 2025

@sigren @cnspary can you please set system_message_role="developer" in your Agent config? That should fix this error.

We will update the default from system to developer to align with the new naming convention

manthanguptaa pushed a commit that referenced this issue Jan 8, 2025
## Description

OpenAI's o1 model requires `system` messages to be `developer` messages
going forward. This change is backwards compatible with older models.

Fixes #1621 

**Note** We don't yet have access to o1, so we cannot confirm whether o1
itself works yet. This only paves the way for it.

## Type of change

Please check the options that are relevant:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] Model update
- [ ] Infrastructure change

## Checklist

- [ ] My code follows Phidata's style guidelines and best practices
- [ ] I have performed a self-review of my code
- [ ] I have added docstrings and comments for complex logic
- [ ] My changes generate no new warnings or errors
- [ ] I have added cookbook examples for my new addition (if needed)
- [ ] I have updated requirements.txt/pyproject.toml (if needed)
- [ ] I have verified my changes in a clean environment
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 a pull request may close this issue.

4 participants