Miguel Lopes Isidoro Greetings!
I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.
Error Message:
The response I am getting in POST {your-resource-name}/openai/deployments/{deployment-id}/extensions/chat/completions?api-version=2023-08-01-preview is not valid. This is a serious problem with the API response that must be addressed by the engineering team ASAP.
Invalid response i am getting (using postman):
response_20230801_Original_Response_Invalid_JSON.txt
Fix made by me manipulating the response:
response_20230801_Modified_Valid_JSON.txt
Issues found:
- Root element missing
- Duplicate data element
- Data element without ""
Solution:
I was sending stream:true in the request. I changed it to stream: false and a valid json response is generated.
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.