DistributedCachingChatClient.ReadCacheAsync(String, CancellationToken) Método

Definição

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

protected:
 override System::Threading::Tasks::Task<Microsoft::Extensions::AI::ChatResponse ^> ^ ReadCacheAsync(System::String ^ key, System::Threading::CancellationToken cancellationToken);
protected override System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse?> ReadCacheAsync(string key, System.Threading.CancellationToken cancellationToken);
override this.ReadCacheAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse>
Protected Overrides Function ReadCacheAsync (key As String, cancellationToken As CancellationToken) As Task(Of ChatResponse)

Parâmetros

key
String

A chave de cache.

cancellationToken
CancellationToken

O CancellationToken para monitorizar pedidos de cancelamento.

Devoluções

Os dados anteriormente armazenados em cache, se disponíveis, caso contrário null.

Aplica-se a