OpenTelemetryChatClient Classe

Definição

Representa um cliente de chat de delegação que implementa as Convenções Semânticas do OpenTelemetry para sistemas de IA Generativa.

public ref class OpenTelemetryChatClient sealed : Microsoft::Extensions::AI::DelegatingChatClient
public sealed class OpenTelemetryChatClient : Microsoft.Extensions.AI.DelegatingChatClient
type OpenTelemetryChatClient = class
    inherit DelegatingChatClient
Public NotInheritable Class OpenTelemetryChatClient
Inherits DelegatingChatClient
Herança
OpenTelemetryChatClient

Observações

Esta classe fornece uma implementação das Convenções Semânticas para sistemas de IA Generativa v1.41, definidas em https://opentelemetry.io/docs/specs/semconv/gen-ai/. A especificação ainda é experimental e sujeita a alterações; assim, a saída de telemetria deste cliente também está sujeita a alterações.

Construtores

Name Description
OpenTelemetryChatClient(IChatClient, ILogger, String)

Inicializa uma nova instância da OpenTelemetryChatClient classe.

Propriedades

Name Description
EnableSensitiveData

Recebe ou define um valor que indica se informação potencialmente sensível deve ser incluída na telemetria.

InnerClient

Obtém o interior IChatClient.

(Herdado de DelegatingChatClient)
JsonSerializerOptions

Obtém ou define opções de serialização JSON para usar ao formatar dados de chat em cadeias de telemetria.

Métodos

Name Description
Dispose()

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

(Herdado de DelegatingChatClient)
Dispose(Boolean)

Fornece um mecanismo para libertar recursos não geridos.

(Herdado de DelegatingChatClient)
GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)

Envia mensagens no chat e responde.

GetService(Type, Object)

Pergunta a IChatClient um objeto do tipo serviceTypeespecificado .

GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)

Envia mensagens no chat e transmite a resposta em streaming.

Métodos da Extensão

Name Description
AsBuilder(IChatClient)

Cria um novo ChatClientBuilder uso innerClient como seu cliente interno.

GetRequiredService(IChatClient, Type, Object)

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

GetRequiredService<TService>(IChatClient, Object)

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

GetResponseAsync(IChatClient, ChatMessage, ChatOptions, CancellationToken)

Envia uma mensagem por chat e responde às respostas.

GetResponseAsync(IChatClient, String, ChatOptions, CancellationToken)

Envia uma mensagem de texto por chat de utilizador e responde às respostas.

GetResponseAsync<T>(IChatClient, ChatMessage, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia uma mensagem por chat, pedindo uma resposta correspondente ao tipo T.

GetResponseAsync<T>(IChatClient, ChatMessage, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia uma mensagem por chat, pedindo uma resposta correspondente ao tipo T.

GetResponseAsync<T>(IChatClient, IEnumerable<ChatMessage>, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia mensagens por chat, pedindo uma resposta correspondente ao tipo T.

GetResponseAsync<T>(IChatClient, IEnumerable<ChatMessage>, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia mensagens por chat, pedindo uma resposta correspondente ao tipo T.

GetResponseAsync<T>(IChatClient, String, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia uma mensagem de texto por chat de utilizador, solicitando uma resposta correspondente ao tipo T.

GetResponseAsync<T>(IChatClient, String, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

Envia uma mensagem de texto por chat de utilizador, solicitando uma resposta correspondente ao tipo T.

GetService<TService>(IChatClient, Object)

Pede a IChatClient um objeto do tipo TService.

GetStreamingResponseAsync(IChatClient, ChatMessage, ChatOptions, CancellationToken)

Envia uma mensagem por chat e transmite as respostas.

GetStreamingResponseAsync(IChatClient, String, ChatOptions, CancellationToken)

Envia uma mensagem de texto por chat de utilizador e transmite as mensagens de resposta.

Aplica-se a