GoogleGenerativeAIStream
GoogleGenerativeAIStream has been removed in AI SDK 4.0.
GoogleGenerativeAIStream is part of the legacy Google Generative AI integration. It is not compatible with the AI SDK 3.1 functions. It is recommended to use the AI SDK Google Generative AI Provider instead.
The GoogleGenerativeAIStream function is a utility that transforms the output from Google's Generative AI SDK into a ReadableStream. It uses AIStream under the hood, applying a specific parser for the Google's response data structure. This works with the official Generative AI SDK, and it's supported in both Node.js, Edge Runtime, and browser environments.
Import
React
import { GoogleGenerativeAIStream } from "ai"
API Signature
Parameters
response:
callbacks?:
onStart:
onCompletion:
onFinal:
onToken:
Returns
A ReadableStream
.