Logo

azure-openai

#10477

invalid_value_error

Invalid value provided. Supported values include: 'system', 'assistant', 'user', 'function', 'tool', and others depending on context.

This error has been identified and solved.

Reason

The 400 status error in the Azure OpenAI API, specifically the error message "Invalid value: 'Tel...st.'. Supported values are: 'system', 'assistant', 'user', 'function', and 'tool'," is likely due to an issue with the messages array in your request payload.

Here are the key reasons for this error:

  • Incorrect Role in Messages: The error indicates that the role field in one of the messages does not match the supported values ('system', 'assistant', 'user', 'function', or 'tool').

  • Invalid Request Configuration: The request payload may contain invalid or mismatched values for required properties, such as the role field in the messages array.

This error suggests that the payload you are passing to the API is not conforming to the expected schema for the messages array.

Solution

To fix the 400 status error in the Azure OpenAI API due to the "Invalid value" error in the role field, you need to ensure that the roles used in the prompt messages are valid. Here are the steps to resolve this issue:

  • Verify that the role field in each message is set to one of the supported values: 'system', 'assistant', 'user', 'function', or 'tool'.

  • Ensure the request payload conforms to the expected schema for the messages array.

  • Check for any typos or incorrect values in the role fields.

By correcting the role values to match the supported ones, you should be able to resolve the error.

Original Error Message

Raw

Invalid value provided. Supported values include: 'system', 'assistant', 'user', 'function', 'tool', and others depending on context.

Original Error Message

Raw

Invalid value provided. Supported values include: 'system', 'assistant', 'user', 'function', 'tool', and others depending on context.

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →