From 7800e95641ee625a0971b441d6f03954e122bcb4 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 14 Aug 2025 15:06:43 +0300 Subject: [PATCH] Refactor WorkspaceConfiguration property initialization Changed ChatClient and Kernel properties in WorkspaceConfiguration to be non-nullable and initialized by default. Removed null checks and redundant instantiation logic in configuration methods for improved code clarity and safety. --- .../src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs b/framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs index 09c8a3de00..6fca2cfc00 100644 --- a/framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs +++ b/framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs @@ -44,8 +44,8 @@ public class WorkspaceConfigurationDictionary : Dictionary configureAction) { - if (ChatClient is null) - { - ChatClient = new ChatClientConfiguration(); - } - configureAction(ChatClient); return this; } @@ -66,11 +61,6 @@ public class WorkspaceConfiguration public WorkspaceConfiguration ConfigureKernel(Action configureAction) { - if (Kernel is null) - { - Kernel = new KernelConfiguration(); - } - configureAction(Kernel); return this; }