[Bug]: Azure o1 and o1-preview error Unsupported value: 'messages[0].role' does not support 'system' with this model
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Describe the bug and reproduction steps
If you choose your deployed model as Azure o1 or o1-preview and run the agent with any request.
You get the following error:
litellm.BadRequestError: AzureException 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'}}
Docker is installed on windows and container is launched from within WSL. Exact issue: https://github.com/All-Hands-AI/OpenHands/issues/4839
OpenHands Installation
Docker command in README
OpenHands Version
0.20.0 - 2025-01-13
Operating System
WSL on Windows
Logs, Errors, Screenshots, and Additional Context
litellm.BadRequestError: AzureException 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'}}
The other day this issue on recognizing o1 models on Azure was fixed in litellm. Once o1 is recognized, it means that litellm will apply transformations like replacement of the system prompt with a user message, so that it works normally.
I'll test their release with the fix. I'm not sure why it happens on o1-preview too, though.
@enyst any updates from your testing? thanks
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
@rw-MohamedAbouseif Sorry for the delay on answering. This was fixed a while ago. I will close this, but if you see it again on any model, please feel free to reopen.