GraphConfig with the extracted data.
Methods
extractFromProse
Processes the request and returns the final result. Internally handles streaming and collects the response.extractFromProseStream
Returns an async iterator that yields events as they arrive.Parameters
Provide
sourceText, attachments, or both — at least one is required. images and attachments cannot be combined in a single request.Attachments
attachments is a discriminated union tagged by kind. Use the builder helpers to construct entries — each accepts base64-encoded file data and returns a correctly-tagged attachment.
ExtractAttachmentInput
dataBase64 must be RFC 4648 standard base64. The builders set mimeType for you (buildImageAttachment takes it as input since images have several valid types).
Size limits
Across all kinds, a request accepts up to 12 attachments and 12 MB combined. Limits are measured on the decoded bytes, not the base64 string.
Response
The response is validated with Zod. Invalid responses throw an error.
ExtractMeta
ExtractAccuracyEvaluation
Basic Usage
Extract from plain text:Extracting from Files
Read a file, base64-encode it, and wrap it with the matching builder:sourceText and multiple attachments in one request — the agent reconciles all sources into a single dataset.
With Progress Callback
Use theonProgress callback to show real-time progress without full streaming:

