GenerateContentStreamResult interface

GenerativeModel.generateContentStream() 调用返回的结果对象。迭代 stream 以在数据块传入时获取分块,并/或使用 response promise 在流完成时获取汇总响应。

签名

export interface GenerateContentStreamResult 

属性

属性 类型 说明
响应 Promise<enhancedGenerateContentResponse>
stream AsyncGenerator<enhancedGenerateContentResponse>

GenerateContentStreamResult.response

签名

response: Promise<EnhancedGenerateContentResponse>;

GenerateContentStreamResult.stream

签名

stream: AsyncGenerator<EnhancedGenerateContentResponse>;