Język

CachingChatClient.ReadCacheAsync(String, CancellationToken) Metoda

Definicja

Zwraca wcześniej buforowany ChatResponseobiekt , jeśli jest dostępny. Jest to używane w przypadku wywołania metody 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)

Parametry

key
String

Klucz pamięci podręcznej.

cancellationToken
CancellationToken

Element CancellationToken do monitorowania żądań anulowania.

Zwraca

Wcześniej buforowane dane, jeśli są dostępne, w przeciwnym razie null.

Wyjątki

Parametr key ma wartość null.

Dotyczy