
openai
#10523
unsupported_value_error
The provided value for 'messages[0].role' is not supported with the current model configuration.
This error has been identified and solved.
Reason
The error you're encountering, specifically the "Unsupported value: 'messages.role' does not support 'system' with this model," is due to the following reasons:
Model Limitations
Certain OpenAI models, such as the 'o1-preview' and 'o1-mini' models, do not support the 'system' role in chat completion. This is a limitation of these specific models.
Invalid Role Specification
The role specified in your message configuration ('system') is not one of the supported roles for the model you are using. These models only support roles like 'SYSTEM', 'USER', 'ASSISTANT', and others, but not 'system' or other unsupported roles.
Solution
To fix the "Unsupported value: 'messages.role' does not support 'system' with this model" error, you need to ensure that the role specified in your message configuration aligns with the supported roles of the model you are using.
Here are the steps to resolve this issue:
Use a different model that supports the 'system' role, such as models other than 'o1-preview' and 'o1-mini'.
Replace the 'system' role with one of the supported roles for your model, such as 'USER', 'ASSISTANT', or other valid roles.
Check the documentation for the specific model you are using to confirm the supported roles.
Suggested Links
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://community.openai.com/t/o1-models-do-not-support-system-role-in-chat-completion/953880
https://community.openai.com/t/getting-400-response-with-already-working-code/509212
https://github.com/run-llama/llama_index/issues/17395
https://community.openai.com/t/intermittent-error-an-unexpected-error-occurred-error-code-400-error-message-this-model-does-not-support-specifying-dimensions-type-invalid-request-error-param-none-code-none/955807
https://community.openai.com/t/request-failed-with-status-code-400/39242