DistributedCachingChatClient.ReadCacheAsync(String, CancellationToken) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
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:
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)
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.