From 3143addd7fe67a791029a25173ebb0862d1b699e Mon Sep 17 00:00:00 2001 From: Rodion Mostovoi Date: Wed, 6 Dec 2023 00:40:05 +0800 Subject: [PATCH] Update code and project version. In `ServiceCollectionExtensions.cs`, the order of arguments in `AddChatGptEntityFrameworkIntegration` function is changed. This was done to ensure `optionsAction` is not null before it's used. Also, validation for `optionsAction` is moved right after validating `configuration`. In `Directory.Build.props`, the version number has been updated from `4.0.0-alpha` to `4.0.1-alpha`. This indicates a minor revision or update in the project. --- src/Directory.Build.props | 2 +- .../Extensions/ServiceCollectionExtensions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9728ba1..d5d0f3b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - 4.0.0-alpha + 4.0.1-alpha net6.0;net7.0;net8.0 enable enable diff --git a/src/OpenAI.ChatGpt.EntityFrameworkCore/Extensions/ServiceCollectionExtensions.cs b/src/OpenAI.ChatGpt.EntityFrameworkCore/Extensions/ServiceCollectionExtensions.cs index 8efe406..93c6e86 100644 --- a/src/OpenAI.ChatGpt.EntityFrameworkCore/Extensions/ServiceCollectionExtensions.cs +++ b/src/OpenAI.ChatGpt.EntityFrameworkCore/Extensions/ServiceCollectionExtensions.cs @@ -12,8 +12,8 @@ public static class ServiceCollectionExtensions /// public static IServiceCollection AddChatGptEntityFrameworkIntegration( this IServiceCollection services, - Action optionsAction, IConfiguration configuration, + Action optionsAction, string completionsConfigSectionPath = ChatGPTConfigSectionPathDefault, string credentialsConfigSectionPath = OpenAiCredentialsConfigSectionPathDefault, string azureOpenAiCredentialsConfigSectionPath = AzureOpenAiCredentialsConfigSectionPathDefault, @@ -22,8 +22,8 @@ public static IServiceCollection AddChatGptEntityFrameworkIntegration( bool validateAiClientProviderOnStart = true) { ArgumentNullException.ThrowIfNull(services); - ArgumentNullException.ThrowIfNull(optionsAction); ArgumentNullException.ThrowIfNull(configuration); + ArgumentNullException.ThrowIfNull(optionsAction); if (string.IsNullOrWhiteSpace(credentialsConfigSectionPath)) { throw new ArgumentException("Value cannot be null or whitespace.",