Closed ReinoutWW closed 1 year ago
For GPT4 you need to use a different version for api. For instance for chat I added 2023-03-15-preview here
services.AddOpenAi(settings =>
{
settings.ApiKey = configuration["OpenAi:ApiKey"];
settings.Azure.ResourceName = configuration["OpenAi:ResourceName"];
settings.Azure
.MapDeploymentEmbeddingModel(configuration["OpenAi:EmbeddingModelName"]!, EmbeddingModelType.AdaTextEmbedding);
settings.Azure
.MapDeploymentChatModel(configuration["OpenAi:ChatModelName"]!, ChatModelType.Gpt35Turbo);
settings.UseVersionForChat("2023-03-15-preview");
settings.CustomRetryPolicy = Policy
.HandleResult<HttpResponseMessage>(r => r.StatusCode != System.Net.HttpStatusCode.OK)
.WaitAndRetryAsync(3, x => TimeSpan.FromSeconds(2));
});
Usually when Azure gets Not Found is a problem of endpoint, therefore it could be the name of the resource, the version or a missing endpoint on Azure.
Describe the bug
Hello,
We've come across the following issue: {“error”:{“code”:“404”,“message”: “Resource not found”}}.
We're using Azure, chat model GPT-4. This error only occurs on the Chat model type, and not the completion model type. Is there a fault in the code?
Azure resource:
To Reproduce
Code snippets
OS
Windows
.Net version
.Net 7.0
Library version
3.0.4