
azure-openai
#10032
input_validation_error
Invalid input: 'assitant' is not a recognized role. Accepted roles are 'system', 'assistant', 'user', or 'function'.
This error has been identified and solved.
Reason
The 400 status error in the Azure OpenAI API with the message 'assitant' is not one of ['system', 'assistant', 'user', 'function'] - 'messages.1.role'
is occurring because of an invalid role specification in the request payload.
Specifically, the error indicates that the value "assitant"
provided for the role
field in the messages
array is not one of the accepted roles, which are 'system'
, 'assistant'
, 'user'
, or 'function'
. This mismatch causes the API to reject the request due to invalid syntax or configuration.
Solution
To fix the 400 status error in the Azure OpenAI API, you need to correct the role
field in the messages
array of your request payload. Here are the steps to resolve the issue:
Ensure the
role
field is set to one of the valid roles.Correct the typo in the role name.
Valid roles:
system
assistant
user
function
Replace the incorrect role name "assitant"
with the correct one, such as "assistant"
.
Suggested Links
https://portkey.ai/error-library/prompt-error-10016
https://community.openai.com/t/error-400-already-has-an-active-run/930753
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://github.com/danny-avila/LibreChat/discussions/3115
https://learn.microsoft.com/en-us/answers/questions/1479386/azure-openai-api-calling-issue
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/role-based-access-control
https://github.com/langgenius/dify/issues/4686
https://learn.microsoft.com/en-us/answers/questions/2139738/openai-badrequesterror-error-code-400-((error-((me
https://learn.microsoft.com/fi-fi/azure/ai-services/openai/reference