Stream text and accumulate the full response.
User prompt
Optional
Optional configuration
Full accumulated text
const story = await genStreamAccumulate("Tell me a story", { onDelta: (chunk) => process.stdout.write(chunk),});console.log("\n\nFull story:", story); Copy
const story = await genStreamAccumulate("Tell me a story", { onDelta: (chunk) => process.stdout.write(chunk),});console.log("\n\nFull story:", story);
Stream text and accumulate the full response.