GraphConfig
The chart configuration object. See Graph Config Schema for the complete reference.GenerateGraphParams
Request parameters for the Chart Maker Agent.| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The current chart configuration |
userPrompt | string | No | Natural language instruction |
metadata | Metadata | No | Request tracking information |
storytellingOptions | StorytellingOptions | No | Prune storytelling from config content client-side (SDK only). |
GenerateGraphResponse
Response from the Chart Maker Agent.| Field | Type | Description |
|---|---|---|
config | GraphConfig | Updated chart configuration. Narrative (title, subtitle, caption) is embedded in config.content as TipTap JSON documents. |
response.message | string | Explanation of changes made |
response.steps | string[] | Optional breakdown of modifications |
GenerateMutationParams
Request parameters for the Mutation Agent.| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The current chart configuration, including the dataset to transform |
userPrompt | string | No | Natural language description of the transformation to apply |
metadata | Metadata | No | Request tracking information |
GenerateMutationResponse
Response from the Mutation Agent.| Field | Type | Description |
|---|---|---|
response.message | string | Explanation of the transformations applied |
response.steps | string[] | Ordered breakdown of each transformation step |
config | GraphConfig | Updated chart configuration with the transformed dataset |
GenerateAnnotationsParams
Request parameters for the Annotation Agent.| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The current chart configuration to annotate |
userPrompt | string | No | Natural language description of the annotations to add or remove |
metadata | Metadata | No | Request tracking information |
GenerateAnnotationsResponse
Response from the Annotation Agent.| Field | Type | Description |
|---|---|---|
response.message | string | Explanation of the annotations applied |
response.steps | string[] | Ordered breakdown of each annotation step |
config | GraphConfig | Updated chart configuration with annotations applied |
GenerateNarrativeParams
Request parameters for the Narrative Agent.| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The chart configuration to narrate |
userPrompt | string | Yes | Natural language instruction for the narrative |
metadata | Metadata | No | Request tracking information |
GenerateNarrativeResponse
Response from the Narrative Agent.| Field | Type | Description |
|---|---|---|
response.message | string | Explanation of the narrative produced |
config | GraphConfig | Updated chart configuration. Title, subtitle, and caption are written into config.content as TipTap JSON documents. |
GenerateGraphSuggestionsParams
Request parameters for the Suggestions Agent.| Field | Type | Required | Description |
|---|---|---|---|
config | GraphConfig | Yes | The chart configuration containing the dataset |
userPrompt | string | No | Natural language description of what to visualize |
metadata | Metadata | No | Request tracking information |
maxSuggestionCount | 1 | 2 | 3 | 4 | No | Optional cap (1–4) passed to the model for how many suggestions to aim for. Omitted uses the default (4). Responses are not truncated if longer. |
GenerateGraphSuggestionsResponse
Response from the Suggestions Agent.| Field | Type | Description |
|---|---|---|
suggestions | Suggestion[] | List of chart type suggestions |
Suggestion
A single chart suggestion returned by the Suggestions Agent.| Field | Type | Description |
|---|---|---|
dataPrepPrompt | string | Prompt describing how to prepare the data for this chart |
chartType | AiChartType | Suggested chart type |
summary | string | Short description of what the chart would show |
ExtractFromProseParams
Request parameters for the Extract Agent.| Field | Type | Required | Description |
|---|---|---|---|
sourceText | string | No | Raw text to extract data from. Up to 500,000 characters. |
attachments | ExtractAttachmentInput[] | No | Images, PDFs, and spreadsheets to extract data from. Up to 12 entries. |
images | ExtractImageInput[] | No | Deprecated. Legacy image array — use attachments instead. |
metadata | Metadata | No | Request tracking information |
sourceText, attachments, or both — at least one is required. images and attachments cannot be combined in a single request.
ExtractAttachmentInput
A discriminated union tagged bykind, used for the Extract Agent’s attachments array. Construct entries with the buildImageAttachment, buildPdfAttachment, and buildSpreadsheetAttachment helpers.
kind | Accepted formats | Decoded size limit |
|---|---|---|
'image' | PNG, JPEG, WebP, GIF | 2 MB each, 8 max |
'document' | 6 MB each, 2 max | |
'spreadsheet' | Excel .xlsx | 6 MB each, 2 max |
ExtractFromProseResponse
Response from the Extract Agent.| Field | Type | Description |
|---|---|---|
response.message | string | Summary of what was extracted |
config | GraphConfig | Chart configuration containing the extracted dataset |
extractMeta | ExtractMeta | null | Trust metadata for the extraction, or null when unavailable |
lastAccuracyEvaluation | ExtractAccuracyEvaluation | The agent’s final self-check of the extracted data, when performed |
ExtractMeta
Trust metadata attached to an extraction result.| Field | Type | Description |
|---|---|---|
confidence | ExtractConfidence | Overall confidence in the extraction |
needsUserInput | boolean | Whether the result should be reviewed before use |
warnings | string[] | Notes about ambiguous, conflicting, or missing source data |
cellConfidence | Array<…> | Optional per-cell confidence, each with a supporting source quote |
ExtractAccuracyEvaluation
The Extract Agent’s self-check of an extraction result.| Field | Type | Description |
|---|---|---|
score | number | Accuracy score, from 0 to 1 |
issues | string[] | Specific accuracy problems the agent identified |
sufficient | boolean | Whether the accuracy is good enough to use as-is |
summary | string | Human-readable summary of the accuracy check |
StorytellingOptions
SDK-only options to prune storytelling fields from the config content after the API returns. For each option set totrue, the SDK removes that field from config.content before returning.
| Field | Type | Description |
|---|---|---|
excludeTitle | boolean | If true, the SDK removes config.content.title. |
excludeSubtitle | boolean | If true, the SDK removes config.content.subtitle. |
excludeCaption | boolean | If true, the SDK removes config.content.caption. |
Metadata
Optional tracking information for requests.| Field | Type | Description |
|---|---|---|
callId | string | Optional. Identifier for tracking and debugging. |
locale | string | Locale for responses (e.g., en-US, fr-FR). |
effort | 'low' | 'medium' | 'high' | Preferred invocation tier; stored on the invocation and forwarded to nested agents. Default medium when omitted. |
storytellingEffort | 'none' | 'low' | 'medium' | 'high' | Deprecated — prefer effort. Still accepted for chart narrative and to infer effort when effort is omitted. |
budget | InvocationBudget | Optional hard caps on time, tokens, and cost for the request. |
executionMode | 'agentic' | 'fast' | Execution strategy: agentic runs the full multi-step loop, fast runs a single-shot plan. |
InvocationBudget
Optional hard limits applied to a single request. The server merges any provided fields with its own per-agent defaults.| Field | Type | Description |
|---|---|---|
maxWallClockMs | number | Hard wall-clock timeout for the request, in milliseconds |
maxTotalTokens | number | Hard cap on total tokens consumed |
maxCostUsd | number | Hard cap on request cost, in USD |
SSE Events
ProgressEvent
CompleteEvent
ErrorEvent
PreviewEvent
An incremental preview of an agent’s work-in-progress result. The payload is spread at the top level, and its shape depends on the agent.ReasoningEvent
A reasoning message emitted by an agent as it works.SSEEvent Union
Error Types
GraphyApiError
Error thrown by the SDK when an API request fails. Covers HTTP errors, SSE stream errors, and network failures.| Property | Type | Description |
|---|---|---|
status | number | undefined | HTTP status code, if from an HTTP response |
code | string | undefined | Machine-readable error code from the API |
retryable | boolean | Whether the SDK considers this error retryable |
GraphyApiErrorOptions
isGraphyApiError
Type guard for narrowing unknown errors toGraphyApiError:
Configuration Types
ClientConfig
RetryConfig
Logger
AiChartType
Supported chart types for AI operations.| Type | Description |
|---|---|
line | Line chart |
areaStacked | Stacked area chart |
bar | Horizontal bar chart |
groupedBar | Grouped horizontal bars |
stackedBar | Stacked horizontal bars |
100StackedBar | 100% stacked horizontal bars |
column | Vertical column chart |
groupedColumn | Grouped vertical columns |
stackedColumn | Stacked vertical columns |
100StackedColumn | 100% stacked vertical columns |
combo | Combined line and column |
pie | Pie chart |
donut | Donut chart |
funnel | Funnel chart |
heatmap | Heatmap |
scatter | Scatter plot |
bubble | Bubble chart |
waterfall | Waterfall chart |
table | Data table |
mekko | Marimekko chart |

