Moving from OpenAI account to Azure OpenAI APIs

I have successfully setup a ChatGPT driven AI Assistant using MS Teams, MS Power Automate and OpenAI API Endpoints (i.e. Create Thread, Create Message, Run and Retrieve Thread once complete). I am now trying to switch the API endpoints from OpenAI to my Azure Deployment/Endpoints.

There are some small adjustments I needed to make to the HTTP calls and headers and these have been successful apart from the last one - Retrieve thread (GET).

Does anyone have any pointers on what I may be doing wrong?

The response is not providing the response from the OpenAI service to the prompt in the output (see below).

Also, I have requested an update to the quota, but have also tried other models/deployments and it’s still not working? Is it a quota issue? There’s no error suggesting this just fails at the step after the HTTP Request because the data is null.

GET
https://myresource/openai/threads/{my threadid}?api-version=2024-05-01-preview

Headers
{
“Content-Type”: “application/json”,
“api-key”: “sanatized key”
}

Response
{
“id”: “mythreadid”,
“object”: “thread”,
“created_at”: xxxxxx,
“metadata”: {},
“tool_resources”: {
“code_interpreter”: {
“file_ids”:
}
}
}

This should include a data-content-text-value response that can be parsed to get the response from OpenAI

1 Like

I build one Universal, you just change Credential Type in .env and you can use Azure OpenAI or OpenAI.

Thanks Savin, that’s a good idea, I’ll adopt the variable approach using .env. However, even when I’m hardcoding the API endpoint in (using a threadid variable) to retrieve the completed run, the JSON I get back is very short and does not have the data:tag included with the thread messages embedded as it does in the OpenAI (non-Azure) endpoint.

All the other REST API endpoints return the right information, just not this one. I feel like I’m missing something basic?

INPUT
{
“uri”: “https://myresource.openai.azure.com/openai/threads/*threadid*?api-version=2024-05-01-preview”,
“method”: “GET”,
“headers”: {
“Content-Type”: “application/json”,
“api-key”: “xxxxxx”
}
}

OUTPUT (there should be a DATA: tag for all the messaging but not coming back?)
{
“statusCode”: 200,
“headers”: {
“Date”: “Mon, 29 Jul 2024 17:08:46 GMT”,
“Connection”: “keep-alive”,
“x-ms-middleware-request-id”: “0e6cffb1-2a9c-4f9d-8d73-48717fe64d9b”,
“x-ms-region”: “East US”,
“X-Content-Type-Options”: “nosniff”,
“X-Request-ID”: “8d47a3b6-fc8d-4154-a064-e0955d8c6c15”,
“apim-request-id”: “ecb55f47-cf00-4d9d-bc41-fe77df9bb695”,
“Strict-Transport-Security”: “max-age=31536000; includeSubDomains; preload”,
“x-ms-client-request-id”: “1c8c44b5-2ff0-4b6b-9607-66a00ace5518”,
“Content-Type”: “application/json”,
“Content-Length”: “193”
},
“body”: {
“id”: “thread_K7mSjIDyQxfkV4OLmI8u06lE”,
“object”: “thread”,
“created_at”: 1722272915,
“metadata”: {},
“tool_resources”: {
“code_interpreter”: {
“file_ids”:
}
}
}
}