compare_documents
Diff two DOCX files and create a new document with tracked changes showing insertions and deletions.
Instructions
Diff two DOCX files and produce a tracked-change document.
Paragraph-level LCS diff:
Unchanged paragraphs copied verbatim.
Deleted paragraphs (in base, absent in revised) wrapped in w:del.
Inserted paragraphs (in revised, absent in base) wrapped in w:ins.
Modified paragraphs (1:1 replacement) get word-level del+ins inline.
The output is a valid DOCX readable in Word/LibreOffice showing the changes as tracked revisions.
Args: base_path: Path to the original DOCX. revised_path: Path to the revised DOCX. output_path: Destination path. Auto-generated if empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_path | Yes | ||
| revised_path | Yes | ||
| output_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |