document-export
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocument Export
文档导出
You can export your responses, research, and analysis to professional documents in five formats: PDF, DOCX, PPTX, CSV, and XLSX.
您可以将回复内容、研究成果和分析结果导出为五种格式的专业文档:PDF、DOCX、PPTX、CSV和XLSX。
Tools
工具
document_export
document_exportdocument_export
document_exportGenerate a document from structured content. Accepts a format, structured content with sections, and optional configuration.
Formats: , , , ,
pdfdocxpptxcsvxlsxContent structure:
- (required) -- document title for cover pages and metadata
title - -- shown below the title on cover pages
subtitle - -- embedded in document metadata
author - -- ISO 8601 date string
date - -- visual preset:
theme,dark,light,corporate,creativeminimal - -- ordered content sections, each containing any combination of:
sections[]- +
heading(1/2/3)level - -- body text with inline markdown (
paragraphs[],**bold**,*italic*)[link](url) - --
table{ headers: string[], rows: string[][] } - --
chart{ type: bar|line|pie|doughnut|area|scatter, data: [...], title? } - --
list{ items: string[], ordered?: boolean } - --
keyValuesrendered as definition tables[{ key, value }] - --
image{ url?, base64?, caption?, width? } - -- PPTX only, attached as slide notes
speakerNotes - -- PPTX hint:
layout,title,content,two-column,image-left,image-right,chart-fullcomparison
Options: , (letter/a4/legal), (portrait/landscape), ,
filenamepageSizeorientationcoverPagepageNumbersOutput:
{ filePath, downloadUrl, previewUrl, format, sizeBytes, filename }从结构化内容生成文档。支持指定格式、带章节的结构化内容以及可选配置。
格式:, , , ,
pdfdocxpptxcsvxlsx内容结构:
- (必填)-- 用于封面和元数据的文档标题
title - -- 显示在封面标题下方
subtitle - -- 嵌入文档元数据
author - -- ISO 8601格式日期字符串
date - -- 视觉预设:
theme,dark,light,corporate,creativeminimal - -- 有序的内容章节,每个章节可包含以下任意组合:
sections[]- +
heading(1/2/3)level - -- 支持内联Markdown格式的正文文本(
paragraphs[]、**加粗**、*斜体*)[链接](url) - --
table{ headers: string[], rows: string[][] } - --
chart{ type: bar|line|pie|doughnut|area|scatter, data: [...], title? } - --
list{ items: string[], ordered?: boolean } - --
keyValues渲染为定义表格[{ key, value }] - --
image{ url?, base64?, caption?, width? } - -- 仅PPTX支持,作为幻灯片备注附加
speakerNotes - -- PPTX布局提示:
layout,title,content,two-column,image-left,image-right,chart-fullcomparison
选项:, (letter/a4/legal), (portrait/landscape), ,
filenamepageSizeorientationcoverPagepageNumbers输出:
{ filePath, downloadUrl, previewUrl, format, sizeBytes, filename }document_suggest
document_suggestdocument_suggest
document_suggestCheck whether a response should offer document export. Pure heuristic, no LLM call.
Input: , , , ,
responseTextwordCounthasTableDatahasSectionsisAnalyticalRules:
- 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 }判断是否应向用户提供文档导出功能。基于纯启发式规则,无需调用大语言模型。
输入:, , , ,
responseTextwordCounthasTableDatahasSectionsisAnalytical规则:
- 字数≥500 -> 推荐PDF、DOCX
- 包含表格数据 -> 推荐CSV、XLSX
- 包含独立章节 -> 推荐PPTX
- 分析类/量化内容 -> 优先推荐PDF、XLSX
- 字数≥200才会触发推荐
输出:
{ shouldOffer, suggestedFormats[], offerText }When to Offer Export
何时提供导出功能
After generating substantive responses, use to check if you should offer export:
document_suggest- 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
生成实质性回复后,使用判断是否应提供导出:
document_suggest- 长回复(500字以上)-> 提供PDF或DOCX
- 包含大量表格的数据类回复 -> 提供CSV或XLSX
- 多章节分析内容 -> 提供PPTX幻灯片
- 简短对话式回复 -> 不提供
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
document_export - Share the download link with the user
当用户请求导出(或接受您的推荐)时:
- 将回复内容整理为DocumentContent格式
- 根据用户需求选择合适的格式
- 调用并传入结构化内容
document_export - 向用户分享下载链接
Format Guide
格式指南
PDF Reports
PDF报告
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
最适合长篇研究、分析内容和正式报告。
- 使用一级标题作为文档标题,二级标题作为主要章节,三级标题作为子章节
- 用表格呈现对比数据
- 有数值数据时添加图表(柱状图用于对比,折线图用于趋势,饼图用于占比)
- 自动生成包含标题、副标题、作者、日期的封面
- 默认包含页码和页眉
- 支持内联Markdown格式:加粗、斜体、链接
- 支持从URL或base64嵌入图片
DOCX Word Documents
DOCX Word文档
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
具备PDF的所有内容能力,但支持编辑。
- 用户提及“我需要编辑”或“发我Word文档”时,选择DOCX
- 支持所有章节类型:标题、段落、表格、图表(以数据表形式)、图片、列表
- 保留内联格式:加粗、斜体、超链接
- 包含封面、页眉、页脚及页码
PPTX Slide Decks
PPTX幻灯片
Each section maps to one slide. Best for presentations and visual summaries.
- Keep text concise on slides -- move detail to
speakerNotes - Use hints:
layoutfor opener,titlefor standard,contentfor data slideschart-full - 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)
corporate - -- conference talks, tech demos (navy background, cyan accent)
dark - -- general purpose, academic (white background, blue accent) [default]
light - -- marketing, workshops (warm amber, gold accent, Georgia titles)
creative - -- data-focused, research (monochrome, generous whitespace)
minimal
每个章节对应一张幻灯片。最适合演示和可视化摘要。
- 幻灯片文字保持简洁,详细内容移至
speakerNotes - 使用布局提示:用于开场页,
title用于标准页,content用于数据页chart-full - 原生支持图表渲染(通过pptxgenjs实现柱状图、折线图、饼图、环形图、面积图、散点图)
- 自动获取并嵌入图片
- 右下角显示幻灯片编号
主题:
- -- 商务演示、季度复盘(深蓝/灰色,Arial字体)
corporate - -- 会议演讲、技术演示(深蓝背景,青色强调色)
dark - -- 通用场景、学术用途(白色背景,蓝色强调色)【默认】
light - -- 营销推广、工作坊(暖琥珀色,金色强调色,Georgia标题字体)
creative - -- 数据导向、研究场景(黑白配色,充足留白)
minimal
CSV
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)
仅支持表格数据。每个表格章节对应一组行数据;多个表格之间用空行分隔。
- 最适合用户需要导入至其他系统的数据导出
- 键值对将渲染为两列表格
- 若未检测到表格数据则抛出错误(建议改用PDF/DOCX)
XLSX Spreadsheets
XLSX电子表格
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
带格式的多工作表Excel工作簿。
- 每个表格章节对应一个独立工作表
- 表头行使用强调色和白色加粗文字样式
- 自动识别数值列并添加数字格式和SUM公式
- 冻结表头行以便滚动查看
- 自动调整列宽
Example Workflows
示例流程
Research -> PDF Report
研究内容 -> PDF报告
- User asks a research question
- You conduct deep research, compile findings
- detects long analytical response ->
document_suggestshouldOffer: true - You offer: "I can export this analysis as a PDF or Word document. Want me to?"
- User says "PDF please"
- You call with
document_export, structured sections, charts for dataformat: "pdf" - Share the download link
- 用户提出研究问题
- 您开展深度研究,整理成果
- 检测到长篇分析回复 ->
document_suggestshouldOffer: true - 您询问:“我可以将这份分析导出为PDF或Word文档,需要我操作吗?”
- 用户回复“请导出PDF”
- 您调用,传入
document_export、结构化章节和数据图表format: "pdf" - 分享下载链接
Data Analysis -> Spreadsheet
数据分析 -> 电子表格
- User provides data or asks for analysis
- You analyze, produce tables and charts
- detects tabular data -> suggests CSV, XLSX
document_suggest - User requests XLSX
- You call with tables as sections
document_export - Each table becomes a formatted worksheet with SUM formulas
- 用户提供数据或请求分析
- 您完成分析,生成表格和图表
- 检测到表格数据 -> 推荐CSV、XLSX
document_suggest - 用户请求XLSX
- 您调用并传入表格作为章节
document_export - 每个表格将成为带SUM公式的格式化工作表
Presentation -> PPTX
演示内容 -> PPTX
- User asks you to prepare a presentation
- You organize content into distinct sections (intro, body, conclusion)
- Use for opener,
layout: "title"for body,"content"for data"chart-full" - Set for business contexts
theme: "corporate" - Add with talking points
speakerNotes - Call with
document_exportformat: "pptx"
- 用户请求准备演示文稿
- 您将内容整理为独立章节(引言、正文、结论)
- 对开场页使用,正文页使用
layout: "title",数据页使用"content""chart-full" - 商务场景下设置
theme: "corporate" - 添加包含演讲要点的
speakerNotes - 调用并传入
document_exportformat: "pptx"
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)
若用户仅说“导出这个”未指定格式,推荐最相关的选项:
- 研究/分析内容 -> PDF + DOCX
- 数据密集型内容 -> XLSX + CSV
- 结构化概述内容 -> PPTX
- 通用长篇内容 -> PDF(最具通用性)