Skip to content

Commit 0e7bf89

Browse files
committed
feat: Add 飞书数据源 tool with configuration and usage instructions
1 parent 0c7e8ae commit 0e7bf89

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

tools/data.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ additionalProperties:
4545
en: "Translation Tool"
4646
zh-hant: "翻譯工具"
4747
zh: "翻译工具"
48+
- key: data_source
49+
name: 数据源
50+
sort: 70
51+
locales:
52+
en: "Data Source"
53+
zh-hant: "數據源"
54+
zh: "数据源"
6.75 KB
Binary file not shown.

tools/feishu_datasource/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# 飞书数据源工具
2+
3+
## 简介
4+
飞书数据源工具是一个专为 MaxKB 平台设计的数据源集成工具,用于从飞书云文档(飞书知识库)中获取和下载文档内容。该工具支持多种文档类型,包括飞书文档、表格、文件夹等,可以帮助用户快速将飞书中的知识内容导入到 MaxKB 知识库中。
5+
6+
## 功能特性
7+
- **多文档类型支持**:支持飞书文档(docx)、飞书表格(sheet)、文件夹(folder)等多种类型
8+
- **树形目录展示**:支持以树形结构展示飞书文档目录,可逐层浏览和选择文件
9+
- **批量下载**:支持批量选择并下载多个文件,自动处理文件夹递归下载
10+
- **自动格式转换**:飞书表格自动转换为 Excel 格式(.xlsx)方便处理
11+
12+
## 系统要求
13+
14+
- MaxKB 平台环境
15+
- 飞书开放平台应用(需要创建飞书应用获取 app_id 和 app_secret)
16+
- 飞书应用需要开通以下权限:
17+
- 查看、评论和下载云文档
18+
- 查看知识库
19+
- 获取知识空间文档信息
20+
21+
## 安装依赖
22+
23+
在使用此工具之前,需要先安装所需的依赖包:
24+
25+
```bash
26+
pip install requests
27+
```
28+
29+
依赖包说明:
30+
- `requests` - HTTP 请求库,用于调用飞书开放平台 API
31+
32+
## 配置说明
33+
34+
### 获取飞书应用凭证
35+
36+
1. 访问 [飞书开放平台](https://open.feishu.cn/),创建企业自建应用
37+
2. 在应用详情页获取 **App ID****App Secret**
38+
3. 在"权限管理"中开通以下权限:
39+
- `drive:drive:readonly` - 查看、评论和下载云文档
40+
- `wiki:wiki:readonly` - 查看知识库
41+
- `docx:document:readonly` - 获取知识空间文档信息
42+
4. 发布应用版本并在企业内启用
43+
44+
### 工具配置参数
45+
46+
| 参数名 | 类型 | 必填 | 说明 |
47+
|--------|------|------|------|
48+
| app_id | String || 飞书应用的 App ID,长度 1-200 字符 |
49+
| app_secret | String || 飞书应用的 App Secret,长度 1-200 字符 |
50+
| folder_token | String || 文件夹 token |
51+
52+
## 使用说明
53+
54+
### 在 MaxKB 中使用
55+
56+
1. **添加工具**
57+
- 在 MaxKB 工具商店中找到"飞书数据源"工具
58+
- 点击添加并配置 app_id 和 app_secret
59+
60+
2. **配置数据源**
61+
- 在知识库设置中添加数据源
62+
- 选择"飞书数据源"工具
63+
- 在树形选择器中浏览和选择需要导入的文档
64+
- 支持多选文档和文件夹
65+
66+
3. **同步数据**
67+
- 确认选择后,工具会自动下载选中的文档
68+
- 文件夹会自动递归下载其中的所有文档
69+
- 飞书表格会自动转换为 Excel 格式
70+
71+
## 支持的文件类型
72+
73+
### 飞书原生类型
74+
| 类型 | 说明 | 导出格式 |
75+
|------|------|----------|
76+
| docx | 飞书文档 | .docx |
77+
| sheet | 飞书表格 | .xlsx |
78+
| folder | 文件夹 | 递归处理 |
79+
80+
81+
82+
```

tools/feishu_datasource/data.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: 飞书数据源
2+
tags:
3+
- 数据源
4+
title: 飞书知识库数据源
5+
description: 飞书知识库数据源,用于从飞书文档中获取信息

tools/feishu_datasource/logo.png

13.5 KB
Loading

0 commit comments

Comments
 (0)