Share via


SpeechToTextClientExtensions.GetService<TService> Method

Definition

Asks the ISpeechToTextClient for an object of type TService.

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

Type Parameters

TService

The type of the object to be retrieved.

Parameters

client
ISpeechToTextClient

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 ISpeechToTextClient, including itself or any services it might be wrapping.

Applies to