GraphConfig and a prompt, receive a GraphConfig with narrative text written into config.content.
Methods
generateNarrative
Processes the request and returns the final result. Internally handles streaming and collects the response.generateNarrativeStream
Returns an async iterator that yields events as they arrive.Parameters
Response
The response is validated with Zod. Invalid responses throw an error.
Which fields are written — title only, title and caption, or all three — depends on the storytelling level. See Invocation effort and chart narrative for how
metadata.effort controls this.
Basic Usage
With Progress Callback
Use theonProgress callback to show real-time progress without full streaming:

