Logo

azure-openai

#10031

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, specifically the message "assitant" is not one of ["system", "assistant", "user", "function"] - "messages.0.role", indicates that the request is invalid due to an incorrect value in the role field of the messages array.

This error occurs because the role field must be one of the predefined values: "system", "assistant", "user", or "function". In your case, the value provided is "assitant", which is a typo and does not match any of the valid roles, leading to a "Bad Request" error.

Solution

To fix the 400 status error in the Azure OpenAI API due to the invalid role input, you need to correct the typo in the role field of the messages array. Here are the steps to resolve the issue:

  • Ensure the role field is set to one of the accepted values: "system", "assistant", "user", or "function".

  • Correct the typo from "assitant" to "assistant".

By making this correction, you will align your request with the API's expected input format.

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

Suggested Links

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →