DistributedCachingChatClient.ReadCacheAsync(String, CancellationToken) Método

Definição

Retorna um cache ChatResponseanteriormente, se disponível. Isso é usado quando há 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 monitorar solicitações de cancelamento.

Retornos

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

Aplica-se a