Logo

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".

Original Error Message

Raw

Invalid input: 'assitant' is not a recognized role. Accepted roles are 'system', 'assistant', 'user', or 'function'.

Original Error Message

Raw

Invalid input: 'assitant' is not a recognized role. Accepted roles are 'system', 'assistant', 'user', or 'function'.