Loading...
Loading...
Compare original and translation side by side
| Tool | Use When |
|---|---|
| User asks to create/generate a NEW Word document |
| User asks to edit/update an EXISTING document or add content |
| User asks what documents are available |
| User wants to download a document or read its comments |
| Check actual page appearance (charts, images, complex layouts) |
| 工具 | 适用情况 |
|---|---|
| 用户要求创建/生成新的Word文档 |
| 用户要求编辑/更新现有文档或添加内容 |
| 用户询问可用的文档有哪些 |
| 用户想要下载文档或查看文档中的批注 |
| 检查页面实际显示效果(图表、图片、复杂布局) |
preview_word_pagepreview_word_pagepreview_word_pagepreview_word_pagefrom docx.shared import Inches
section = doc.sections[0]
section.page_width = Inches(8.5)
section.page_height = Inches(11)from docx.shared import Inches
section = doc.sections[0]
section.page_width = Inches(8.5)
section.page_height = Inches(11)undefinedundefinedstyle.font.name = 'Arial'doc.add_heading('Title', level=1)doc.add_paragraph(style='Heading 1')doc.add_paragraph(style='List Bullet')doc.add_paragraph(style='List Number')style.font.name = 'Arial'doc.add_heading('Title', level=1)doc.add_paragraph(style='Heading 1')doc.add_paragraph(style='List Bullet')doc.add_paragraph(style='List Number')from docx.shared import Inches
paragraph = doc.add_paragraph()
run = paragraph.add_run()
run.add_picture('file.png', width=Inches(6))from docx.shared import Inches
paragraph = doc.add_paragraph()
run = paragraph.add_run()
run.add_picture('file.png', width=Inches(6))doc = Document()docDocument()doc.save()add_paragraph(style='List Bullet')paragraph.text = 'new text'docdoc = Document()docDocument()doc.save()add_paragraph(style='List Bullet')paragraph.text = 'new text'| Parameter | Type | Required | Description |
|---|---|---|---|
| str | Yes | Python code using python-docx (see Code Rules above) |
| str | Yes | Filename without extension (letters, numbers, hyphens only) |
{
"python_code": "doc.add_heading('Quarterly Report', 0)\ndoc.add_paragraph('This report summarizes Q4 performance.')\ndoc.add_heading('Revenue', level=1)\ndoc.add_paragraph('Total revenue: $1.2M')",
"document_name": "quarterly-report"
}document_namefilenamename| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| str | 是 | 使用python-docx编写的Python代码(需遵守上述代码规则) |
| str | 是 | 无扩展名的文件名(仅允许字母、数字和连字符) |
{
"python_code": "doc.add_heading('Quarterly Report', 0)\ndoc.add_paragraph('This report summarizes Q4 performance.')\ndoc.add_heading('Revenue', level=1)\ndoc.add_paragraph('Total revenue: $1.2M')",
"document_name": "quarterly-report"
}document_namefilenamename| Parameter | Type | Required | Description |
|---|---|---|---|
| str | Yes | Existing document name (without .docx) |
| str | Yes | New output name (MUST differ from source) |
| str | Yes | Python code to modify the document |
{
"source_name": "quarterly-report",
"output_name": "quarterly-report-v2",
"python_code": "doc.add_paragraph('Additional notes added.')"
}| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| str | 是 | 现有文档的名称(无.docx扩展名) |
| str | 是 | 新的输出文件名(必须与源文件名不同) |
| str | 是 | 用于修改文档的Python代码 |
{
"source_name": "quarterly-report",
"output_name": "quarterly-report-v2",
"python_code": "doc.add_paragraph('Additional notes added.')"
}include_comments=True| Parameter | Type | Required | Description |
|---|---|---|---|
| str | Yes | Document name without extension |
| bool | No | If true, extract and display comments with paragraph mapping (default: false) |
include_comments=True| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| str | 是 | 无扩展名的文档名称 |
| bool | 否 | 若为true,提取并显示带段落关联的批注(默认:false) |
| Parameter | Type | Required | Description |
|---|---|---|---|
| str | Yes | Document name without extension |
| list[int] | Yes | 1-based page numbers to preview |
| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| str | 是 | 无扩展名的文档名称 |
| list[int] | 是 | 需要预览的从1开始计数的页码 |
section.page_width = Inches(8.5); section.page_height = Inches(11)section.top_margin = section.bottom_margin = section.left_margin = section.right_margin = Inches(1)style.font.name = 'Arial'document.add_heading('Title', level=1)add_paragraph(style='Heading 1')add_paragraph(style='List Bullet')add_paragraph(style='List Number')run.add_picture('file.png', width=Inches(6))section.page_width = Inches(8.5); section.page_height = Inches(11)section.top_margin = section.bottom_margin = section.left_margin = section.right_margin = Inches(1)style.font.name = 'Arial'document.add_heading('Title', level=1)add_paragraph(style='Heading 1')add_paragraph(style='List Bullet')add_paragraph(style='List Number')paragraph.text = 'new text'run.add_picture('file.png', width=Inches(6))