Document Export
You can export your responses, research, and analysis to professional documents in five formats: PDF, DOCX, PPTX, CSV, and XLSX.
Tools
Generate a document from structured content. Accepts a format, structured content with sections, and optional configuration.
Content structure:
- (required) -- document title for cover pages and metadata
- -- shown below the title on cover pages
- -- embedded in document metadata
- -- ISO 8601 date string
- -- visual preset: , , , ,
- -- ordered content sections, each containing any combination of:
- + (1/2/3)
- -- body text with inline markdown (, , )
- --
{ headers: string[], rows: string[][] }
- --
{ type: bar|line|pie|doughnut|area|scatter, data: [...], title? }
- --
{ items: string[], ordered?: boolean }
- -- rendered as definition tables
- --
{ url?, base64?, caption?, width? }
- -- PPTX only, attached as slide notes
- -- PPTX hint: , , , , , ,
Options:
,
(letter/a4/legal),
(portrait/landscape),
,
Output:
{ filePath, downloadUrl, previewUrl, format, sizeBytes, filename }
Check whether a response should offer document export. Pure heuristic, no LLM call.
Rules:
- 500+ words -> suggest PDF, DOCX
- Tabular data -> suggest CSV, XLSX
- Distinct sections -> suggest PPTX
- Analytical/quantitative -> reinforce PDF, XLSX
- Minimum 200 words before any suggestion
Output:
{ shouldOffer, suggestedFormats[], offerText }
When to Offer Export
After generating substantive responses, use
to check if you should offer export:
- Long responses (500+ words) -> offer PDF or DOCX
- Data-heavy responses with tables -> offer CSV or XLSX
- Multi-section analysis -> offer PPTX slide deck
- Short conversational responses -> don't offer
How to Export
When the user requests an export (or accepts your offer):
- Structure your response content into DocumentContent format
- Choose the right format based on what the user asked for
- Call with the structured content
- Share the download link with the user
Format Guide
PDF Reports
Best for long-form research, analysis, and formal reports.
- Use level-1 heading for title, level-2 for major sections, level-3 for subsections
- Include tables for comparative data
- Add charts where numeric data is present (bar for comparisons, line for trends, pie for composition)
- Cover page generated automatically with title, subtitle, author, date
- Page numbers and headers included by default
- Supports inline markdown: bold, italic, links
- Images embedded from URLs or base64
DOCX Word Documents
Same content capabilities as PDF but editable.
- Users who say "I need to edit it" or "send me a Word doc" -> DOCX
- All section types supported: headings, paragraphs, tables, charts (as data tables), images, lists
- Inline formatting preserved: bold, italic, hyperlinks
- Cover page, headers, footers with page numbers
PPTX Slide Decks
Each section maps to one slide. Best for presentations and visual summaries.
- Keep text concise on slides -- move detail to
- Use hints: for opener, for standard, for data slides
- Native chart rendering (bar, line, pie, doughnut, area, scatter via pptxgenjs)
- Images automatically fetched and embedded
- Slide numbers in bottom-right
Themes:
- -- business presentations, quarterly reviews (navy/grey, Arial)
- -- conference talks, tech demos (navy background, cyan accent)
- -- general purpose, academic (white background, blue accent) [default]
- -- marketing, workshops (warm amber, gold accent, Georgia titles)
- -- data-focused, research (monochrome, generous whitespace)
CSV
Tabular data only. Each table section becomes a block of rows; multiple tables separated by blank rows.
- Best for data exports the user wants to import elsewhere
- Key-value pairs rendered as two-column tables
- Throws an error if no tabular data found (suggest PDF/DOCX instead)
XLSX Spreadsheets
Multi-sheet Excel workbooks with formatting.
- Each table section becomes its own worksheet
- Header rows styled with accent colour and white bold text
- Auto-detected numeric columns get number formatting and SUM formulas
- Frozen header row for easy scrolling
- Auto-sized column widths
Example Workflows
Research -> PDF Report
- User asks a research question
- You conduct deep research, compile findings
- detects long analytical response ->
- You offer: "I can export this analysis as a PDF or Word document. Want me to?"
- User says "PDF please"
- You call with , structured sections, charts for data
- Share the download link
Data Analysis -> Spreadsheet
- User provides data or asks for analysis
- You analyze, produce tables and charts
- detects tabular data -> suggests CSV, XLSX
- User requests XLSX
- You call with tables as sections
- Each table becomes a formatted worksheet with SUM formulas
Presentation -> PPTX
- User asks you to prepare a presentation
- You organize content into distinct sections (intro, body, conclusion)
- Use for opener, for body, for data
- Set for business contexts
- Add with talking points
- Call with
Multi-Format
If the user says "export this" without specifying format, offer the most relevant options:
- Research/analysis -> PDF + DOCX
- Data-heavy -> XLSX + CSV
- Structured overview -> PPTX
- General long content -> PDF (most universally useful)