GenerateContentStreamResult interface

GenerativeModel.generateContentStream() 呼叫傳回的結果物件。反覆執行 stream 以取得切片,並在串流完成後/或使用 response 承諾,取得匯總回應。

簽名:

export interface GenerateContentStreamResult 

屬性

屬性 類型 說明
回覆 承諾<EnhancedGenerateContentResponse>
串流播放 AsyncGenerator<EnhancedGenerateContentResponse>

產生 ContentStreamResult.response

簽名:

response: Promise<EnhancedGenerateContentResponse>;

產生 ContentStreamResult.stream

簽名:

stream: AsyncGenerator<EnhancedGenerateContentResponse>;