CachingChatClient.WriteCacheAsync Método

Definição

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

protected:
 abstract System::Threading::Tasks::Task ^ WriteCacheAsync(System::String ^ key, Microsoft::Extensions::AI::ChatResponse ^ value, System::Threading::CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task WriteCacheAsync(string key, Microsoft.Extensions.AI.ChatResponse value, System.Threading.CancellationToken cancellationToken);
abstract member WriteCacheAsync : string * Microsoft.Extensions.AI.ChatResponse * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected MustOverride Function WriteCacheAsync (key As String, value As ChatResponse, cancellationToken As CancellationToken) As Task

Parâmetros

key
String

A chave de cache.

value
ChatResponse

O ChatResponse a ser armazenado.

cancellationToken
CancellationToken

O CancellationToken para monitorar solicitações de cancelamento.

Retornos

Um Task que representa a conclusão da operação.

Exceções

value é null.

Aplica-se a