Hi Tuan Nguyen,
Welcome to the Microsoft Q&A Forum! Thank you for your question.
First, ensure that your request body is correctly formatted as JSON. The prompt
parameter should be within a messages
array, and each message should have a role
and content
. Here's an example of how your request body should look:
{
"messages": [
{
"role": "user",
"content": "what time is it in Italy?"
}
]
}
Make sure your headers include the correct Content-Type
:
{
"api-key": "your_api_key_here",
"Content-Type": "application/json"
}
Also, verify that your endpoint URL is correct and matches the deployment name and API version you are using. Based on the information you provided, it should be:
https://rforce-ai-assist.openai.azure.com/openai/deployments/gpt-4o-2/chat/completions?api-version=2024-08-01-preview
If you continue to face issues, please double-check the API documentation for any additional parameters or requirements that might be missing. You can refer to the Azure OpenAI Service REST API preview reference for more details.
Do let me know if you are still the facing the issue.
Thanks!