Public Access
26 lines
652 B
C#
26 lines
652 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace MeetingAssistant.Transcription;
|
|
|
|
public abstract class SpeechRecognitionPipelineBuilder
|
|
{
|
|
private readonly IServiceProvider services;
|
|
|
|
protected SpeechRecognitionPipelineBuilder(IServiceProvider services)
|
|
{
|
|
this.services = services;
|
|
}
|
|
|
|
protected T CreateProfiled<T>(MeetingAssistantOptions options)
|
|
{
|
|
return ActivatorUtilities.CreateInstance<T>(services, Options.Create(options));
|
|
}
|
|
|
|
protected T GetRequiredService<T>()
|
|
where T : notnull
|
|
{
|
|
return services.GetRequiredService<T>();
|
|
}
|
|
}
|