From 2e5b38cc6b27263e0bf1b474ec0d8648b4b008f2 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Wed, 26 Jun 2024 09:51:13 +0200 Subject: [PATCH 1/3] Updated NuGet packages in multiple projects Updated various NuGet packages across several projects to enhance performance, fix bugs, and improve resilience and versioning strategies. Key updates include `Microsoft.Extensions.Http.Resilience` from `8.5.0` to `8.6.0` in projects like `ChatGptApi`, `ChatGptBlazor.Wasm`, and others for better HTTP communication resilience. `Nerdbank.GitVersioning` was upgraded to `3.6.139` in `Directory.Build.props` for improved versioning. Specific project updates include `Microsoft.AspNetCore.OpenApi`, `Swashbuckle.AspNetCore`, and others in `ChatGptApi`, as well as `Microsoft.AspNetCore.Components.WebAssembly` updates in `ChatGptBlazor.Wasm`. These changes aim at maintaining up-to-date dependencies for security, reliability, and feature enhancements. --- samples/ChatGptApi/ChatGptApi.csproj | 8 ++++---- samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj | 6 +++--- samples/ChatGptConsole/ChatGptConsole.csproj | 2 +- .../ChatGptFunctionCallingConsole.csproj | 2 +- samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj | 2 +- src/Directory.Build.props | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/ChatGptApi/ChatGptApi.csproj b/samples/ChatGptApi/ChatGptApi.csproj index 4eaec32..66b87eb 100644 --- a/samples/ChatGptApi/ChatGptApi.csproj +++ b/samples/ChatGptApi/ChatGptApi.csproj @@ -7,11 +7,11 @@ - - + + - - + + diff --git a/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj b/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj index 611c80c..0ec58e2 100644 --- a/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj +++ b/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/samples/ChatGptConsole/ChatGptConsole.csproj b/samples/ChatGptConsole/ChatGptConsole.csproj index 7f72f3f..3453c18 100644 --- a/samples/ChatGptConsole/ChatGptConsole.csproj +++ b/samples/ChatGptConsole/ChatGptConsole.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj b/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj index 205ffd8..833960e 100644 --- a/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj +++ b/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj b/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj index 66be1c8..dc946e0 100644 --- a/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj +++ b/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b928dd5..603e0ed 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -9,7 +9,7 @@ - + From cab61012a468a6c05859fc8ecd44e13cc8ea700b Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Wed, 26 Jun 2024 09:56:26 +0200 Subject: [PATCH 2/3] Update Azure API version to 2024-05-01-preview Updated the Azure OpenAI API version across configuration files and documentation from `2024-04-01-preview` to `2024-05-01-preview`. This includes changes in `README.md`, `appsettings.json`, and `AzureChatGptServiceConfiguration.cs`, ensuring the application defaults to the newer API version. The update reflects the adoption of new features or improvements available in the latest API preview version. --- README.md | 3 ++- samples/ChatGptApi/appsettings.json | 2 +- samples/ChatGptConsole/appsettings.json | 2 +- samples/ChatGptFunctionCallingConsole/appsettings.json | 2 +- samples/ChatGptStreamConsole/appsettings.json | 2 +- .../AzureChatGptServiceConfiguration.cs | 6 +++++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 56024ea..d49dbab 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,8 @@ builder.Services.AddChatGpt(options => - 2023-10-01-preview - 2024-02-15-preview - 2024-03-01-preview - - 2024-04-01-preview (default) + - 2024-04-01-preview + - 2024-05-01-preview (default) - 2024-02-01 - _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"). diff --git a/samples/ChatGptApi/appsettings.json b/samples/ChatGptApi/appsettings.json index 3c0afcc..a652b62 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-04-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-04-01-preview) + "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-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 2fb4aad..8391a2b 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-04-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-04-01-preview) + "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-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 37d9b84..5b3db33 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-04-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-04-01-preview) + "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-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 0ac1de6..f0a0095 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-04-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-04-01-preview) + "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-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 4202003..89ff3e4 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-04-01-preview"; + public const string DefaultApiVersion = "2024-05-01-preview"; /// /// Gets or sets the name of the Azure OpenAI Resource. @@ -48,6 +48,10 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// Swagger spec /// /// + /// 2024-05-01-preview + /// Swagger spec + /// + /// /// 2023-02-01 /// Swagger spec /// From 7d871ad23e4c18ac6fb149cefa880ed6206d8989 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Wed, 26 Jun 2024 10:20:53 +0200 Subject: [PATCH 3/3] Update Azure OpenAI API version to 2024-05-01-preview Updated the Azure OpenAI Service API version from `2024-04-01-preview` to `2024-05-01-preview` in both the `UseAzure.md` documentation and the `AzureChatGptServiceConfiguration.cs` source file. This change affects the `UseAzure` method and the `ApiVersion` property in the `AzureChatGptServiceConfiguration` class, ensuring the service uses the latest API version. --- docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md | 2 +- .../ServiceConfigurations/AzureChatGptServiceConfiguration.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md b/docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md index aacd116..cd71d01 100644 --- a/docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md +++ b/docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md @@ -4,7 +4,7 @@ Configures Azure OpenAI Service settings. ```csharp public static ChatGptOptionsBuilder UseAzure(this ChatGptOptionsBuilder builder, - string resourceName, string apiKey, string apiVersion = "2024-04-01-preview", + string resourceName, string apiKey, string apiVersion = "2024-05-01-preview", AzureAuthenticationType authenticationType = AzureAuthenticationType.ApiKey) ``` diff --git a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs index 89ff3e4..3385199 100644 --- a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs +++ b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs @@ -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-04-01-preview). + /// Gets or sets the API version of the Azure OpenAI service (Default: 2024-05-01-preview). /// /// /// Currently supported versions are: