From 05d83cba38455881094c1ab80c6b6de3d44ed8b0 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Wed, 11 Sep 2024 11:30:49 +0200 Subject: [PATCH] Update default API version to 2024-08-01-preview --- README.md | 7 ++++--- samples/ChatGptApi/appsettings.json | 2 +- samples/ChatGptConsole/appsettings.json | 2 +- .../appsettings.json | 2 +- samples/ChatGptStreamConsole/appsettings.json | 2 +- .../AzureChatGptServiceConfiguration.cs | 19 ++++++++++++------- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8b860f1..b5b2ae3 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,14 @@ builder.Services.AddChatGpt(options => - 2023-05-15 - 2023-06-01-preview - 2023-10-01-preview + - 2024-02-01 - 2024-02-15-preview - 2024-03-01-preview - 2024-04-01-preview - - 2024-05-01-preview - - 2024-02-01 + - 2024-05-01-preview - 2024-06-01 - - 2024-07-01-preview (default) + - 2024-07-01-preview + - 2024-08-01-preview (default) - _AuthenticationType_: it specifies if the key is an actual API Key or an [Azure Active Directory token](https://learn.microsoft.com/azure/cognitive-services/openai/how-to/managed-identity) (optional, default: "ApiKey"). ### DefaultModel and DefaultEmbeddingModel diff --git a/samples/ChatGptApi/appsettings.json b/samples/ChatGptApi/appsettings.json index baa079e..e99b998 100644 --- a/samples/ChatGptApi/appsettings.json +++ b/samples/ChatGptApi/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-07-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-07-01-preview) + "ApiVersion": "2024-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-08-01-preview) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptConsole/appsettings.json b/samples/ChatGptConsole/appsettings.json index 615151c..2406bcc 100644 --- a/samples/ChatGptConsole/appsettings.json +++ b/samples/ChatGptConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-07-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-07-01-preview) + "ApiVersion": "2024-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-08-01-preview) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptFunctionCallingConsole/appsettings.json b/samples/ChatGptFunctionCallingConsole/appsettings.json index 0e31baf..386819d 100644 --- a/samples/ChatGptFunctionCallingConsole/appsettings.json +++ b/samples/ChatGptFunctionCallingConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-07-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-07-01-preview) + "ApiVersion": "2024-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-08-01-preview) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptStreamConsole/appsettings.json b/samples/ChatGptStreamConsole/appsettings.json index c9940cf..e7f6b0e 100644 --- a/samples/ChatGptStreamConsole/appsettings.json +++ b/samples/ChatGptStreamConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-07-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-07-01-preview) + "ApiVersion": "2024-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-08-01-preview) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs index 05a5d17..793fb9b 100644 --- a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs +++ b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs @@ -10,7 +10,7 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// /// The default API version for Azure OpenAI service. /// - public const string DefaultApiVersion = "2024-07-01-preview"; + public const string DefaultApiVersion = "2024-08-01-preview"; /// /// Gets or sets the name of the Azure OpenAI Resource. @@ -18,7 +18,7 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration public string? ResourceName { get; set; } /// - /// Gets or sets the API version of the Azure OpenAI service (Default: 2024-07-01-preview). + /// Gets or sets the API version of the Azure OpenAI service (Default: 2024-08-01-preview). /// /// /// Currently supported versions are: @@ -36,6 +36,10 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// Swagger spec /// /// + /// 2024-02-01 + /// Swagger spec + /// + /// /// 2024-02-15-preview /// Swagger spec /// @@ -52,17 +56,18 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// Swagger spec /// /// - /// 2023-02-01 - /// Swagger spec - /// - /// /// 2024-06-01 /// Swagger spec /// /// /// 2024-07-01-preview /// Swagger spec - /// /// + /// + /// + /// 2024-08-01-preview + /// Swagger spec + /// + /// /// public string ApiVersion { get; set; } = DefaultApiVersion;