Idioma

CachingChatClient Classe

Definição

Representa um cliente de chat delegante que armazena em cache os resultados das chamadas de chat.

public ref class CachingChatClient abstract : Microsoft::Extensions::AI::DelegatingChatClient
public abstract class CachingChatClient : Microsoft.Extensions.AI.DelegatingChatClient
type CachingChatClient = class
    inherit DelegatingChatClient
Public MustInherit Class CachingChatClient
Inherits DelegatingChatClient
Herança
CachingChatClient
Derivado

Construtores

Nome Description
CachingChatClient(IChatClient)

Inicializa uma nova instância da classe CachingChatClient.

Propriedades

Nome Description
CoalesceStreamingUpdates

Obtém ou define um valor que indica se as atualizações de streaming são coalescidas.

InnerClient

Obtém o interior IChatClient.

(Herdado de DelegatingChatClient)

Métodos

Nome Description
Dispose()

Executa tarefas definidas pelo aplicativo associadas à liberação, liberação ou redefinição de recursos não gerenciados.

(Herdado de DelegatingChatClient)
Dispose(Boolean)

Fornece um mecanismo para liberar recursos não gerenciados.

(Herdado de DelegatingChatClient)
EnableCaching(IEnumerable<ChatMessage>, ChatOptions)

Determina se o cache deve ser usado com a solicitação especificada.

GetCacheKey(IEnumerable<ChatMessage>, ChatOptions, ReadOnlySpan<Object>)

Calcula uma chave de cache para os valores especificados.

GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken)

Representa um cliente de chat delegante que armazena em cache os resultados das chamadas de chat.

GetService(Type, Object)

Solicita um IChatClient objeto do tipo serviceTypeespecificado.

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

Representa um cliente de chat delegante que armazena em cache os resultados das chamadas de chat.

ReadCacheAsync(String, CancellationToken)

Retorna um cache ChatResponseanteriormente, se disponível. Isso é usado quando há uma chamada para GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

ReadCacheStreamingAsync(String, CancellationToken)

Retorna uma lista de ChatResponseUpdate valores armazenada em cache anteriormente, se disponível. Isso é usado quando há uma chamada para GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

WriteCacheAsync(String, ChatResponse, CancellationToken)

Armazena um ChatResponse no cache subjacente. Isso é usado quando há uma chamada para GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

WriteCacheStreamingAsync(String, IReadOnlyList<ChatResponseUpdate>, CancellationToken)

Armazena uma lista de ChatResponseUpdate valores no cache subjacente. Isso é usado quando há uma chamada para GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

Métodos de Extensão

Nome Description
AsBuilder(IChatClient)

Cria um novo ChatClientBuilder uso innerClient como seu cliente interno.

GetRequiredService(IChatClient, Type, Object)

Solicita um IChatClient objeto do tipo serviceType especificado e gera uma exceção se um não estiver disponível.

GetRequiredService<TService>(IChatClient, Object)

Solicita um IChatClient objeto de tipo TService e gera uma exceção se um não estiver disponível.

GetResponseAsync(IChatClient, ChatMessage, ChatOptions, CancellationToken)

Envia uma mensagem de chat e retorna as mensagens de resposta.

GetResponseAsync(IChatClient, String, ChatOptions, CancellationToken)

Envia uma mensagem de texto de chat do usuário e retorna as mensagens de resposta.

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

Envia uma mensagem de chat solicitando uma resposta que corresponda ao tipo T.

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

Envia uma mensagem de chat solicitando uma resposta que corresponda ao tipo T.

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

Envia mensagens de chat, solicitando uma resposta que corresponda ao tipo T.

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

Envia mensagens de chat, solicitando uma resposta que corresponda ao tipo T.

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

Envia uma mensagem de texto de chat do usuário solicitando uma resposta correspondente ao tipo T.

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

Envia uma mensagem de texto de chat do usuário solicitando uma resposta correspondente ao tipo T.

GetService<TService>(IChatClient, Object)

Solicita um IChatClient objeto do tipo TService.

GetStreamingResponseAsync(IChatClient, ChatMessage, ChatOptions, CancellationToken)

Envia uma mensagem de chat e transmite as mensagens de resposta.

GetStreamingResponseAsync(IChatClient, String, ChatOptions, CancellationToken)

Envia uma mensagem de texto de chat do usuário e transmite as mensagens de resposta.

Aplica-se a