Skip to main content
Complete type definitions for the Graphy AI SDK.

GraphConfig

The chart configuration object. See Graph Config Schema for the complete reference.

GenerateGraphParams

Request parameters for the Chart Maker Agent.

GenerateGraphResponse

Response from the Chart Maker Agent.

GenerateMutationParams

Request parameters for the Mutation Agent.

GenerateMutationResponse

Response from the Mutation Agent.

GenerateAnnotationsParams

Request parameters for the Annotation Agent.

GenerateAnnotationsResponse

Response from the Annotation Agent.

GenerateNarrativeParams

Request parameters for the Narrative Agent.

GenerateNarrativeResponse

Response from the Narrative Agent.

GenerateGraphSuggestionsParams

Request parameters for the Suggestions Agent.

GenerateGraphSuggestionsResponse

Response from the Suggestions Agent.

Suggestion

A single chart suggestion returned by the Suggestions Agent.

ExtractFromProseParams

Request parameters for the Extract Agent.
Provide sourceText, attachments, or both — at least one is required. images and attachments cannot be combined in a single request.

ExtractAttachmentInput

A discriminated union tagged by kind, used for the Extract Agent’s attachments array. Construct entries with the buildImageAttachment, buildPdfAttachment, and buildSpreadsheetAttachment helpers.
A request accepts up to 12 attachments and 12 MB combined decoded size.

ExtractFromProseResponse

Response from the Extract Agent.

ExtractMeta

Trust metadata attached to an extraction result.

ExtractAccuracyEvaluation

The Extract Agent’s self-check of an extraction result.

StorytellingOptions

SDK-only options to prune storytelling fields from the config content after the API returns. For each option set to true, the SDK removes that field from config.content before returning.

Metadata

Optional tracking information for requests.

InvocationBudget

Optional hard limits applied to a single request. The server merges any provided fields with its own per-agent defaults.

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.

GraphyApiErrorOptions

isGraphyApiError

Type guard for narrowing unknown errors to GraphyApiError:

Configuration Types

ClientConfig

RetryConfig

Defaults:

Logger


AiChartType

Supported chart types for AI operations.

Zod Schemas

The SDK exports Zod schemas for runtime validation: