Linguagem

OpenAIRealtimeClientSession Classe

Definição

Representa uma IRealtimeClientSession para a API OpenAI Realtime sobre WebSocket.

public ref class OpenAIRealtimeClientSession sealed : IAsyncDisposable, Microsoft::Extensions::AI::IRealtimeClientSession
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public sealed class OpenAIRealtimeClientSession : IAsyncDisposable, Microsoft.Extensions.AI.IRealtimeClientSession
public sealed class OpenAIRealtimeClientSession : IAsyncDisposable, Microsoft.Extensions.AI.IRealtimeClientSession
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type OpenAIRealtimeClientSession = class
    interface IRealtimeClientSession
    interface IAsyncDisposable
type OpenAIRealtimeClientSession = class
    interface IRealtimeClientSession
    interface IAsyncDisposable
Public NotInheritable Class OpenAIRealtimeClientSession
Implements IAsyncDisposable, IRealtimeClientSession
Herança
OpenAIRealtimeClientSession
Atributos
Implementações

Construtores

Name Descrição
OpenAIRealtimeClientSession(String, String)

Inicializa uma nova instância da OpenAIRealtimeClientSession classe.

Propriedades

Name Descrição
Options

Obtém as opções atuais da sessão.

Métodos

Name Descrição
ConnectAsync(CancellationToken)

Liga o WebSocket à API em tempo real da OpenAI.

DisposeAsync()

Realiza tarefas definidas pela aplicação associadas à libertação, libertação ou reinício de recursos não geridos de forma assíncrona.

GetStreamingResponseAsync(CancellationToken)

Transmite a resposta da sessão em tempo real.

SendAsync(RealtimeClientMessage, CancellationToken)

Envia uma mensagem de cliente para a sessão.

Implementações de Interface Explícita

Name Descrição
IRealtimeClientSession.GetService(Type, Object)

Pergunta a IRealtimeClientSession um objeto do tipo serviceTypeespecificado .

Métodos da Extensão

Name Descrição
ConfigureAwait(IAsyncDisposable, Boolean)

Configura como aguarda nas tarefas devolvidas de um descartável assíncrono será realizada.

GetRequiredService(IRealtimeClientSession, Type, Object)

Pede IRealtimeClientSession um objeto do tipo serviceType especificado e lança uma exceção caso não esteja disponível.

GetRequiredService<TService>(IRealtimeClientSession, Object)

Pede um IRealtimeClientSession objeto do tipo TService e lança uma exceção se não estiver disponível.

GetService<TService>(IRealtimeClientSession, Object)

Pede a IRealtimeClientSession um objeto do tipo TService.

Aplica-se a