Share via


SpeechToTextClientBuilderServiceCollectionExtensions.AddSpeechToTextClient Method

Definition

Overloads

AddSpeechToTextClient(IServiceCollection, ISpeechToTextClient, ServiceLifetime)

Registers a singleton ISpeechToTextClient in the IServiceCollection.

public static Microsoft.Extensions.AI.SpeechToTextClientBuilder AddSpeechToTextClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Microsoft.Extensions.AI.ISpeechToTextClient innerClient, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddSpeechToTextClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.AI.ISpeechToTextClient * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.SpeechToTextClientBuilder
<Extension()>
Public Function AddSpeechToTextClient (serviceCollection As IServiceCollection, innerClient As ISpeechToTextClient, Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As SpeechToTextClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

innerClient
ISpeechToTextClient

The inner ISpeechToTextClient that represents the underlying backend.

lifetime
ServiceLifetime

The service lifetime for the client. Defaults to Singleton.

Returns

A SpeechToTextClientBuilder that can be used to build a pipeline around the inner client.

Remarks

The client is registered as a singleton service.

Applies to

AddSpeechToTextClient(IServiceCollection, Func<IServiceProvider,ISpeechToTextClient>, ServiceLifetime)

Registers a singleton ISpeechToTextClient in the IServiceCollection.

public static Microsoft.Extensions.AI.SpeechToTextClientBuilder AddSpeechToTextClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Func<IServiceProvider,Microsoft.Extensions.AI.ISpeechToTextClient> innerClientFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddSpeechToTextClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, Microsoft.Extensions.AI.ISpeechToTextClient> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.SpeechToTextClientBuilder
<Extension()>
Public Function AddSpeechToTextClient (serviceCollection As IServiceCollection, innerClientFactory As Func(Of IServiceProvider, ISpeechToTextClient), Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As SpeechToTextClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

innerClientFactory
Func<IServiceProvider,ISpeechToTextClient>

A callback that produces the inner ISpeechToTextClient that represents the underlying backend.

lifetime
ServiceLifetime

The service lifetime for the client. Defaults to Singleton.

Returns

A SpeechToTextClientBuilder that can be used to build a pipeline around the inner client.

Remarks

The client is registered as a singleton service.

Applies to