|
| 1 | +import { defineTool } from '@tool/type'; |
| 2 | +import { FlowNodeInputTypeEnum, WorkflowIOValueTypeEnum } from '@tool/type/fastgpt'; |
| 3 | +import { ToolTagEnum } from '@tool/type/tags'; |
| 4 | + |
| 5 | +export default defineTool({ |
| 6 | + name: { |
| 7 | + 'zh-CN': '文档对比工具', |
| 8 | + en: 'DocDiff' |
| 9 | + }, |
| 10 | + tags: [ToolTagEnum.enum.tools], |
| 11 | + description: { |
| 12 | + 'zh-CN': '对比两个 Markdown 文档的差异,生成可视化的 HTML 对比报告', |
| 13 | + en: 'Compare differences between two Markdown documents and generate visual HTML comparison report' |
| 14 | + }, |
| 15 | + toolDescription: |
| 16 | + 'A tool that compares two markdown documents and generates a visual HTML diff report showing differences section by section', |
| 17 | + |
| 18 | + versionList: [ |
| 19 | + { |
| 20 | + value: '1.0.0', |
| 21 | + description: 'Initial version', |
| 22 | + inputs: [ |
| 23 | + { |
| 24 | + key: 'originalText', |
| 25 | + label: '原始文档', |
| 26 | + description: '原始的 Markdown 格式文档内容', |
| 27 | + required: true, |
| 28 | + valueType: WorkflowIOValueTypeEnum.string, |
| 29 | + renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference], |
| 30 | + toolDescription: 'The original markdown document content to compare' |
| 31 | + }, |
| 32 | + { |
| 33 | + key: 'modifiedText', |
| 34 | + label: '修改后文档', |
| 35 | + description: '修改后的 Markdown 格式文档内容', |
| 36 | + required: true, |
| 37 | + valueType: WorkflowIOValueTypeEnum.string, |
| 38 | + renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference], |
| 39 | + toolDescription: 'The modified markdown document content to compare' |
| 40 | + }, |
| 41 | + { |
| 42 | + key: 'title', |
| 43 | + label: '对比报告标题', |
| 44 | + description: '生成的 HTML 对比报告的标题', |
| 45 | + required: false, |
| 46 | + valueType: WorkflowIOValueTypeEnum.string, |
| 47 | + renderTypeList: [FlowNodeInputTypeEnum.input], |
| 48 | + defaultValue: '文档对比报告' |
| 49 | + } |
| 50 | + ], |
| 51 | + outputs: [ |
| 52 | + { |
| 53 | + valueType: WorkflowIOValueTypeEnum.string, |
| 54 | + key: 'htmlUrl', |
| 55 | + label: 'HTML 对比报告连接', |
| 56 | + description: '生成的 HTML 对比报告的访问连接' |
| 57 | + }, |
| 58 | + { |
| 59 | + valueType: WorkflowIOValueTypeEnum.arrayObject, |
| 60 | + key: 'diffs', |
| 61 | + label: '差异结果数组', |
| 62 | + description: '过滤后的文档差异数组,包含新增、删除、修改的变更' |
| 63 | + } |
| 64 | + ] |
| 65 | + } |
| 66 | + ] |
| 67 | +}); |
0 commit comments