Skip to content

Commit

Permalink
Fix external orchestration selection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ciprianjichici committed Sep 18, 2024
1 parent 47123af commit ef3b5c0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit ef3b5c0

Please sign in to comment.