using BotSharp.Abstraction.MLTasks; namespace BotSharp.Core.Infrastructures; public class CompletionProvider { public static IChatCompletion GetChatCompletion(IServiceProvider services, string? provider = null) { var completions = services.GetServices(); var state = services.GetRequiredService(); if (provider == null) { provider = state.GetState("provider", "azure-gpt-3.5"); } return completions.FirstOrDefault(x => x.Provider == provider); } }