語言

DistributedCachingChatClient.WriteCacheStreamingAsync 方法

定義

在底層快取中儲存一串 ChatResponseUpdate 數值。 當有呼叫 時 GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken),會使用此方法。

protected:
 override System::Threading::Tasks::Task ^ WriteCacheStreamingAsync(System::String ^ key, System::Collections::Generic::IReadOnlyList<Microsoft::Extensions::AI::ChatResponseUpdate ^> ^ value, System::Threading::CancellationToken cancellationToken);
protected override System.Threading.Tasks.Task WriteCacheStreamingAsync(string key, System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatResponseUpdate> value, System.Threading.CancellationToken cancellationToken);
override this.WriteCacheStreamingAsync : string * System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatResponseUpdate> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overrides Function WriteCacheStreamingAsync (key As String, value As IReadOnlyList(Of ChatResponseUpdate), cancellationToken As CancellationToken) As Task

參數

key
String

快取金鑰。

value
IReadOnlyList<ChatResponseUpdate>

ChatResponse這些要存放的。

cancellationToken
CancellationToken

CancellationToken他們需要監控取消申請。

傳回

A Task 代表操作完成。

適用於