using BotSharp.Abstraction.MLTasks; namespace BotSharp.Core.Infrastructures; public class CompletionProvider { public static IChatCompletion GetChatCompletion(IServiceProvider services) { var completions = services.GetServices(); // var settings = services.GetRequiredService(); // completions.FirstOrDefault(x => x.GetType().FullName.EndsWith(settings.ChatCompletion)); var state = services.GetRequiredService(); var model = state.GetState("model", "gpt-3.5-turbo"); return completions.FirstOrDefault(x => x.ModelName == model); } }