zhangjinyang
2025-05-07 b2e103bc64a5295bca3283ffaf0a46fa4caca8d6
docs: 文件内容提取,文件生成节点的文档。
1个文件已修改
4个文件已添加
45 ■■■■■ 已修改文件
docs/.vitepress/config.mts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/zh/product/workflow/nodes/doc-content.md 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/zh/product/workflow/nodes/file-generator.md 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/zh/product/workflow/resource/doc-content.png 补丁 | 查看 | 原始文档 | blame | 历史
docs/zh/product/workflow/resource/file-gen.png 补丁 | 查看 | 原始文档 | blame | 历史
docs/.vitepress/config.mts
@@ -198,6 +198,8 @@
                {text: '节点配置', collapsed: false, items: [
                        {text: '搜索引擎', link: '/workflow/nodes/search-engine'},
                        {text: '内容模板', link: '/workflow/nodes/template-node'},
                        {text: '文件内容提取', link: '/workflow/nodes/doc-content'},
                        {text: '文件生成', link: '/workflow/nodes/file-generator'},
                    ]},
            ]
        },
docs/zh/product/workflow/nodes/doc-content.md
New file
@@ -0,0 +1,30 @@
# 文件内容提取
![doc-content.png](../resource/doc-content.png)
输入参数:
- `fileUrl` 文件可访问的地址
输出参数:
- `content` 文件内容
## 后端实现
在 `aiflowy-module-ai` 模块下的 `node` 包中。
接口 `ReadDocService` 目前有两个实现类。
- `DefaultReadService`
> 默认实现,可实现简单读取文档内容。
- `GiteeParseService`
> 调用模力方舟的接口实现,需在配置文件中配置模力方舟的 appKey 并指定 `node.reader` 为 `giteeReader`。
```yaml
node:
  reader: 'giteeReader'
  gitee:
    appKey: 'your appKey'
```
> 如果无法满足需求,可自行实现接口 `ReadDocService` 并指定 `node.reader` 为你自己实现的 `bean` 即可。
docs/zh/product/workflow/nodes/file-generator.md
New file
@@ -0,0 +1,13 @@
# 文件生成
![file-gen.png](../resource/file-gen.png)
- 输入参数:`content` 文件内容。
- 输出参数:`url` 文件下载地址。
## 后端实现
在 `aiflowy-module-ai` 模块下的 `node` 包中。
`MakeFileNodeParser` 和 `MakeFileNode` 类。
> 目前实现了 `docx` 文件的生成,后续会添加更多支持。
docs/zh/product/workflow/resource/doc-content.png
docs/zh/product/workflow/resource/file-gen.png