Skip to main content
Generate chart type and data preparation suggestions from a dataset. Send a GraphConfig and a prompt, receive a list of suggested visualizations.

Methods

generateSuggestions

Processes the request and returns the final result. Internally handles streaming and collects the response.

generateSuggestionsStream

Returns an async iterator that yields events as they arrive.

Parameters

Response

Suggestion

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

Basic Usage


With Progress Callback

Use the onProgress callback to show real-time progress:

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.