Jaa


TextToSpeechClientBuilderServiceCollectionExtensions.AddKeyedTextToSpeechClient Method

Definition

Overloads

AddKeyedTextToSpeechClient(IServiceCollection, Object, ITextToSpeechClient, ServiceLifetime)

Source:
TextToSpeechClientBuilderServiceCollectionExtensions.cs

Registers a keyed singleton ITextToSpeechClient in the IServiceCollection.

public static Microsoft.Extensions.AI.TextToSpeechClientBuilder AddKeyedTextToSpeechClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object? serviceKey, Microsoft.Extensions.AI.ITextToSpeechClient innerClient, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddKeyedTextToSpeechClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Microsoft.Extensions.AI.ITextToSpeechClient * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.TextToSpeechClientBuilder
<Extension()>
Public Function AddKeyedTextToSpeechClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClient As ITextToSpeechClient, Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As TextToSpeechClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

serviceKey
Object

The key with which to associate the client.

innerClient
ITextToSpeechClient

The inner ITextToSpeechClient that represents the underlying backend.

lifetime
ServiceLifetime

The service lifetime for the client. Defaults to Singleton.

Returns

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

Remarks

The client is registered as a singleton service by default.

Applies to

AddKeyedTextToSpeechClient(IServiceCollection, Object, Func<IServiceProvider,ITextToSpeechClient>, ServiceLifetime)

Source:
TextToSpeechClientBuilderServiceCollectionExtensions.cs

Registers a keyed singleton ITextToSpeechClient in the IServiceCollection.

public static Microsoft.Extensions.AI.TextToSpeechClientBuilder AddKeyedTextToSpeechClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, object? serviceKey, Func<IServiceProvider,Microsoft.Extensions.AI.ITextToSpeechClient> innerClientFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton);
static member AddKeyedTextToSpeechClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, Microsoft.Extensions.AI.ITextToSpeechClient> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.AI.TextToSpeechClientBuilder
<Extension()>
Public Function AddKeyedTextToSpeechClient (serviceCollection As IServiceCollection, serviceKey As Object, innerClientFactory As Func(Of IServiceProvider, ITextToSpeechClient), Optional lifetime As ServiceLifetime = Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton) As TextToSpeechClientBuilder

Parameters

serviceCollection
IServiceCollection

The IServiceCollection to which the client should be added.

serviceKey
Object

The key with which to associate the client.

innerClientFactory
Func<IServiceProvider,ITextToSpeechClient>

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

lifetime
ServiceLifetime

The service lifetime for the client. Defaults to Singleton.

Returns

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

Remarks

The client is registered as a singleton service by default.

Applies to