CachingChatClient Classe

Definição

Representa um cliente de chat de delegação 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

Name Description
CachingChatClient(IChatClient)

Inicializa uma nova instância da CachingChatClient classe.

Propriedades

Name Description
CoalesceStreamingUpdates

Recebe ou define um valor que indica se as atualizações em streaming estão coalecidas.

InnerClient

Obtém o interior IChatClient.

(Herdado de DelegatingChatClient)

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)
EnableCaching(IEnumerable<ChatMessage>, ChatOptions)

Determina se o cache deve ser usado com o pedido especificado.

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 de delegação que armazena em cache os resultados das chamadas de chat.

GetService(Type, Object)

Pergunta a IChatClient um objeto do tipo serviceTypeespecificado .

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

Representa um cliente de chat de delegação que armazena em cache os resultados das chamadas de chat.

ReadCacheAsync(String, CancellationToken)

Devolve um arquivo previamente armazenado ChatResponseem cache , se disponível. Isto é usado quando existe uma chamada para GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

ReadCacheStreamingAsync(String, CancellationToken)

Devolve uma lista de ChatResponseUpdate valores previamente armazenada em cache, se disponível. Isto é usado quando existe uma chamada para GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

WriteCacheAsync(String, ChatResponse, CancellationToken)

Armazena a ChatResponse na cache subjacente. Isto é usado quando existe uma chamada para GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

WriteCacheStreamingAsync(String, IReadOnlyList<ChatResponseUpdate>, CancellationToken)

Armazena uma lista de ChatResponseUpdate valores na cache subjacente. Isto é usado quando existe uma chamada para GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

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