From ef3b5c051eaf675dd1f9941c1d3af398ea0c318a Mon Sep 17 00:00:00 2001 From: Ciprian Jichici Date: Wed, 18 Sep 2024 16:11:02 +0300 Subject: [PATCH] Fix external orchestration selection bug --- .../Services/LLMOrchestrationServiceManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dotnet/Orchestration/Services/LLMOrchestrationServiceManager.cs b/src/dotnet/Orchestration/Services/LLMOrchestrationServiceManager.cs index ae1723d06e..d824a61fd5 100644 --- a/src/dotnet/Orchestration/Services/LLMOrchestrationServiceManager.cs +++ b/src/dotnet/Orchestration/Services/LLMOrchestrationServiceManager.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using System.Text.Json; namespace FoundationaLLM.Orchestration.Core.Services { @@ -67,9 +68,9 @@ private async Task Initialize() _externalOrchestrationServiceNames = apiEndpointConfigurations .Where(aec => aec.Category == APIEndpointCategory.ExternalOrchestration && aec.AuthenticationParameters.TryGetValue(AuthenticationParametersKeys.APIKeyConfigurationName, out var apiKeyConfigObj) - && apiKeyConfigObj is string apiKeyConfig - && !string.IsNullOrWhiteSpace(apiKeyConfig) - && apiKeyConfig.StartsWith(AppConfigurationKeySections.FoundationaLLM_APIEndpoints)) + && apiKeyConfigObj is JsonElement apiKeyConfig + && !string.IsNullOrWhiteSpace(apiKeyConfig.GetString()) + && apiKeyConfig.GetString()!.StartsWith(AppConfigurationKeySections.FoundationaLLM_APIEndpoints)) .Select(aec => aec.Name) .ToList();