Has anyone managed to use Models.GetModelsAsync() with Azure OpenAI? I can successfully use the chat and completions endpoints but I am getting an error trying to get the list of models. I know it seems to work a bit differently in Azure where you select your model with your deployment, but I was hoping to be able to access all models with one deployment :)
using this code
OpenAI_API.OpenAIAPI api = OpenAI_API.OpenAIAPI.ForAzure(_settings.AzureOpenAiResourceName, _settings.AzureOpenAiDeploymentId, _settings.AzureOpenAiApiKey);
api.ApiVersion = "2023-05-15";
var response = await api.Models.GetModelsAsync();
I am getting this error
Error at models (https://resource-name.openai.azure.com/openai/deployments/deployment-name/models?api-version=2023-05-15) with HTTP status code: NotFound. Content: {"error":{"code":"404","message": "Resource not found"}}
Doesn't seem to work with api-version=2022-12-01 either.
I think its something to do with the endpoint, as according to docs it should be
Has anyone managed to use Models.GetModelsAsync() with Azure OpenAI? I can successfully use the chat and completions endpoints but I am getting an error trying to get the list of models. I know it seems to work a bit differently in Azure where you select your model with your deployment, but I was hoping to be able to access all models with one deployment :)
using this code
I am getting this error
Error at models (https://resource-name.openai.azure.com/openai/deployments/deployment-name/models?api-version=2023-05-15) with HTTP status code: NotFound. Content: {"error":{"code":"404","message": "Resource not found"}}
Doesn't seem to work with api-version=2022-12-01 either.
I think its something to do with the endpoint, as according to docs it should be
GET {endpoint}/openai/models?api-version=2022-12-01 https://learn.microsoft.com/en-us/rest/api/cognitiveservices/azureopenaistable/models/list
Thanks for your help and putting this sdk together.