DistributedCachingChatClient.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:
 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.

Si applica a