Public Access
Make meeting lifecycle stateful
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user