TextToSpeechClientBuilderServiceCollectionExtensions.AddKeyedTextToSpeechClient Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddKeyedTextToSpeechClient(IServiceCollection, Object, ITextToSpeechClient, ServiceLifetime) |
Registers a keyed singleton ITextToSpeechClient in the IServiceCollection. |
| AddKeyedTextToSpeechClient(IServiceCollection, Object, Func<IServiceProvider,ITextToSpeechClient>, ServiceLifetime) |
Registers a keyed singleton ITextToSpeechClient in the IServiceCollection. |
AddKeyedTextToSpeechClient(IServiceCollection, Object, ITextToSpeechClient, ServiceLifetime)
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)
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.