Share via


LoggingSpeechToTextClient Class

Definition

A delegating speech to text client that logs speech to text operations to an ILogger.

public ref class LoggingSpeechToTextClient : Microsoft::Extensions::AI::DelegatingSpeechToTextClient
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001")]
public class LoggingSpeechToTextClient : Microsoft.Extensions.AI.DelegatingSpeechToTextClient
public class LoggingSpeechToTextClient : Microsoft.Extensions.AI.DelegatingSpeechToTextClient
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001")>]
type LoggingSpeechToTextClient = class
    inherit DelegatingSpeechToTextClient
type LoggingSpeechToTextClient = class
    inherit DelegatingSpeechToTextClient
Public Class LoggingSpeechToTextClient
Inherits DelegatingSpeechToTextClient
Inheritance
LoggingSpeechToTextClient
Attributes

Remarks

The provided implementation of ISpeechToTextClient is thread-safe for concurrent use so long as the ILogger employed is also thread-safe for concurrent use.

When the employed ILogger enables Trace, the contents of messages and options are logged. These messages and options may contain sensitive application data. Trace is disabled by default and should never be enabled in a production environment. Messages and options are not logged at other logging levels.

Constructors

LoggingSpeechToTextClient(ISpeechToTextClient, ILogger)

Initializes a new instance of the LoggingSpeechToTextClient class.

Properties

InnerClient

Gets the inner ISpeechToTextClient.

(Inherited from DelegatingSpeechToTextClient)
JsonSerializerOptions

Gets or sets JSON serialization options to use when serializing logging data.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from DelegatingSpeechToTextClient)
Dispose(Boolean)

Provides a mechanism for releasing unmanaged resources.

(Inherited from DelegatingSpeechToTextClient)
GetService(Type, Object)

Asks the ISpeechToTextClient for an object of the specified type serviceType.

(Inherited from DelegatingSpeechToTextClient)
GetStreamingTextAsync(Stream, SpeechToTextOptions, CancellationToken)

Sends audio speech content to the model and streams back the generated text.

GetTextAsync(Stream, SpeechToTextOptions, CancellationToken)

Sends audio speech content to the model and returns the generated text.

Extension Methods

AsBuilder(ISpeechToTextClient)

Creates a new SpeechToTextClientBuilder using innerClient as its inner client.

GetService<TService>(ISpeechToTextClient, Object)

Asks the ISpeechToTextClient for an object of type TService.

GetStreamingTextAsync(ISpeechToTextClient, DataContent, SpeechToTextOptions, CancellationToken)

Generates text from speech providing a single audio speech DataContent.

GetTextAsync(ISpeechToTextClient, DataContent, SpeechToTextOptions, CancellationToken)

Generates text from speech providing a single audio speech DataContent.

Applies to