Back to Firebase Js Sdk

GenerateContentStreamResult interface

docs-devsite/ai.generatecontentstreamresult.md

12.12.11.5 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

GenerateContentStreamResult interface

Result object returned from GenerativeModel.generateContentStream() call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done.

<b>Signature:</b>

typescript
export interface GenerateContentStreamResult 

Properties

PropertyTypeDescription
responsePromise<EnhancedGenerateContentResponse<!-- -->>
streamAsyncGenerator<EnhancedGenerateContentResponse<!-- -->>

GenerateContentStreamResult.response

<b>Signature:</b>

typescript
response: Promise<EnhancedGenerateContentResponse>;

GenerateContentStreamResult.stream

<b>Signature:</b>

typescript
stream: AsyncGenerator<EnhancedGenerateContentResponse>;