CachingChatClient.ReadCacheAsync(String, CancellationToken) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne un cache précédemment mis ChatResponseen cache, le cas échéant. Cela est utilisé lorsqu’il existe un appel à 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)
Paramètres
- key
- String
Clé de cache.
- cancellationToken
- CancellationToken
À CancellationToken surveiller pour les demandes d’annulation.
Retours
Les données précédemment mises en cache, le cas échéant, sinon null.
Exceptions
key a la valeur null.