streamV2(input: BaseLanguageModelInput, options: Partial<ChatGoogleCallOptions>): ChatModelStream| Name | Type | Description |
|---|---|---|
input* | BaseLanguageModelInput | The input messages. |
options | Partial<ChatGoogleCallOptions> | Optional call options. |
const stream = model.streamV2([{ role: "user", content: "Hello" }]);
// Stream text
for await (const token of stream.text) {
process.stdout.write(token);
}
// Or await the full message
const message = await stream;Create a ChatModelStream for the given input.
Returns a stream object that is both AsyncIterable<ChatModelStreamEvent>
and PromiseLike<AIMessage>, with typed sub-stream accessors for
.text, .toolCalls, .reasoning, and .usage.