GraphConfig and a prompt, receive an updated GraphConfig.
Methods
generateGraph
Processes the request and returns the final result. Internally handles streaming and collects the response.generateGraphStream
Returns an async iterator that yields events as they arrive.Parameters
| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The current chart configuration |
userPrompt | string | Yes | Natural language instruction |
metadata | Metadata | No | Request tracking information |
storytellingOptions | StorytellingOptions | No | Prune storytelling from config content client-side (SDK only). |
Metadata
| Field | Type | Description |
|---|---|---|
callId | string | Required when metadata is provided. Unique identifier for tracking and debugging. |
locale | string | Locale for responses (e.g., en-US, fr-FR). |
storytellingEffort | 'none' | 'low' | 'medium' | 'high' | Which narrative fields the agent fills. See Storytelling and narrative. Default is 'low'. |
Response
| Field | Type | Description |
|---|---|---|
config | GraphConfig | Updated chart configuration. Narrative (title, subtitle, caption) is embedded in config.content as TipTap JSON documents; see Storytelling and narrative. |
response.message | string | Explanation of changes made |
response.steps | string[] | Breakdown of individual modifications |
Storytelling and narrative
metadata.storytellingEffort controls which of title, subtitle, and caption the agent fills. The agent is instructed as follows:
| Effort | Title | Subtitle | Caption |
|---|---|---|---|
'none' | — | — | — |
'low' | ✓ | null | null |
'medium' | ✓ | null | ✓ |
'high' | ✓ | ✓ | ✓ |
'none'— No narrative is generated;config.contenttitle, subtitle, and caption remain empty.'low'— Only title is filled (a trend, pattern or conclusion from the data). Default.'medium'— Title and caption are filled (caption describes trends, patterns or insights).'high'— Title, subtitle, and caption are all filled (subtitle describes what is being visualised).
config.content as TipTap JSON documents (config.content.title, config.content.subtitle, config.content.caption). With the SDK you can pass storytellingOptions to prune the content client-side: the SDK removes any excluded field from config.content before returning (see StorytellingOptions in the Type Reference).
Basic Usage
With Progress Callback
Use theonProgress callback to show real-time progress without full streaming:

