Del via


TextToSpeechClientExtensions.GetService<TService> Method

Definition

Asks the ITextToSpeechClient for an object of type TService.

public static TService? GetService<TService>(this Microsoft.Extensions.AI.ITextToSpeechClient client, object? serviceKey = default);
static member GetService : Microsoft.Extensions.AI.ITextToSpeechClient * obj -> 'Service
<Extension()>
Public Function GetService(Of TService) (client As ITextToSpeechClient, Optional serviceKey As Object = Nothing) As TService

Type Parameters

TService

The type of the object to be retrieved.

Parameters

client
ITextToSpeechClient

The client.

serviceKey
Object

An optional key that can be used to help identify the target service.

Returns

TService

The found object, otherwise null.

Remarks

The purpose of this method is to allow for the retrieval of strongly typed services that may be provided by the ITextToSpeechClient, including itself or any services it might be wrapping.

Applies to