Skip to main content
Modify charts using natural language. Send a 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

Metadata

Response

The response is validated with Zod. Invalid responses throw an error.

Invocation effort and chart narrative

metadata.effort selects how heavy the invocation is: it is stored on the request, forwarded into agent invocations (including tools that run nested agents), and drives defaults when you do not send storytellingEffort. For chart generation, the chart agent still consumes a storytelling level (none / low / medium / high). The server sets that level as follows:
  • If you send only effort, the chart storytelling level is derived from effort (default effort is medium, which matches the narrative band you previously got from omitting metadata or using the old default).
  • If you send only storytellingEffort (deprecated), the chart uses that value directly and the server infers effort for the rest of the stack.
  • If you send both, storytellingEffort wins for the chart so existing explicit chart settings keep working; effort still applies everywhere else.
There is no none value on effort; to drop narrative fields in the client, use storytellingOptions on GenerateGraphParams (see StorytellingOptions).

Basic Usage


With Progress Callback

Use the onProgress callback to show real-time progress without full streaming:

ProgressEvent


With Abort Signal

Cancel a request mid-operation:

Streaming

For full control over the event stream:
See Streaming for cancellation and React patterns.

Error Handling

See Error Handling for retry behavior and error types.