CachingChatClient.ReadCacheAsync(String, CancellationToken) Metodo

Definizione

Restituisce un oggetto memorizzato ChatResponsenella cache in precedenza, se disponibile. Questa operazione viene usata quando è presente una chiamata a GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken).

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

Parametri

key
String

Chiave della cache.

cancellationToken
CancellationToken

Oggetto CancellationToken da monitorare per le richieste di annullamento.

Valori restituiti

I dati memorizzati nella cache in precedenza, se disponibili, in caso contrario null.

Eccezioni

key è null.

Si applica a