Compare commits

..

30 Commits

Author SHA1 Message Date
Archer
a997f277ad 4.8.16 test (#3437)
* perf: auto login code

* perf: invoice phone
2024-12-19 14:52:19 +08:00
papapatrick
1f4e5f6d71 perf: add contact phone number in invoice header (#3427) 2024-12-19 14:01:07 +08:00
heheer
ce2e926d76 fix: add sso auto login config (#3436) 2024-12-19 13:33:56 +08:00
Archer
bd79e7701f V4.8.16 dev (#3431)
* feat: add feishu & yuque dataset (#3379)

* feat: add feishu & yuque dataset

* fix ts

* fix ts

* move type position

* fix

* fix: merge interface

* fix

* feat: dingtalk sso support (#3408)

* fix: optional sso state

* feat: dingtalk bot

* feat: dingtalk sso login

* chore: move i18n to user namespace

* feat: dingtalk bot integration (#3415)

* feat: dingtalk bot integration

* docs: config dingtalk bot

* feat:sear XNG服务 (#3413)

* feat:sear XNG服务

* 补充了courseUrl

* 添加了官方文档

* 错误时返回情况修正了一下

* Tracks (#3420)

* feat: node intro

* feat: add domain track

* dingding sso login

* perf: api dataset code and add doc

* feat: tracks

* feat: searXNG plugins

* fix: ts

* feat: delete node tracks (#3423)

* fix: dingtalk bot GET verification (#3424)

* 4.8.16 test: fix: plugin inputs render;fix: ui offset (#3426)

* fix: ui offset

* perf: dingding talk

* fix: plugin inputs render

* feat: menu all folder (#3429)

* fix: recall code

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com>
Co-authored-by: Jiangween <145003935+Jiangween@users.noreply.github.com>
2024-12-18 19:30:19 +08:00
Archer
82871be054 Update 4815.md (#3409) 2024-12-16 19:02:43 +08:00
Archer
8ba339e78f Perf webhook (#3406)
* perf: plugin webhook

* perf: plugin webhook
2024-12-16 16:44:39 +08:00
Jiangween
8e9c030600 feat:钉钉和企微的webhook (#3393) 2024-12-16 15:05:02 +08:00
Hexiao Zhang
9b8779ba08 Update controller.ts (#3404) 2024-12-16 15:04:24 +08:00
Archer
bfac393ab1 Add question guide config (#3403)
* feat:Prompt task (#3337)

* feat:猜你想问自定义功能

* 修改用户输入框部分,去除冗余代码

* 删除不必要的属性

* 删除多余内容

* 修正了格式问题,并实现获取调试和app最新参数

* 修正了几行代码

* feat:Prompt task (#3337)

* feat:猜你想问自定义功能

* 修改用户输入框部分,去除冗余代码

* 删除不必要的属性

* 删除多余内容

* 修正了格式问题,并实现获取调试和app最新参数

* 修正了几行代码

* perf: question gudide code

* fix: i18n

* hunyuan logo

* fix: cq templates

* perf: create question guide code

* udpate svg

---------

Co-authored-by: Jiangween <145003935+Jiangween@users.noreply.github.com>
2024-12-16 13:49:31 +08:00
a.e.
76d20b2b76 fix: handle sso state (#3402) 2024-12-16 12:17:13 +08:00
papapatrick
b4933471cd refactor: 知识块都改为markdown渲染 (#3389) 2024-12-16 12:16:44 +08:00
Archer
c995bccef8 fix: input form value type error (#3399) 2024-12-15 19:58:50 +08:00
a.e.
3deac290bf fix: sso redirect (#3395) 2024-12-13 17:58:57 +08:00
Archer
b7eb4c15de fix: add multiple selector null check (#3392) 2024-12-13 14:15:30 +08:00
heheer
41a8536c16 fix template (#3390) 2024-12-13 12:08:36 +08:00
Archer
1e618502c7 Update 4815.md (#3388) 2024-12-13 11:27:50 +08:00
Archer
e9297c2c6a Update 4815.md (#3387) 2024-12-13 11:26:25 +08:00
Archer
30a89fe4cb fix: list permission (#3386) 2024-12-13 11:00:22 +08:00
Archer
c41def5fbb Fix input (#3385)
* doc

* fix: inputs

* fix: inputs

* fix: inputs

* fix: inputs
2024-12-13 08:28:33 +08:00
Archer
b596976a96 fix: render inputs (#3384) 2024-12-13 08:06:05 +08:00
Archer
e71708ee76 doc (#3383)
* doc

* feat: navbar size

* navbar ui
2024-12-12 17:54:38 +08:00
Archer
ddddd998c8 Fix workflow detail (#3382)
* fix: loop node init

* fix: workflow detail

* fix: point table

* add null check
2024-12-12 17:14:46 +08:00
heheer
181b854342 fix: cost tool tip display (#3381) 2024-12-12 17:05:27 +08:00
Archer
40af63b1dd perf: remove auto delete invalid item (#3377) 2024-12-11 22:46:32 +08:00
Archer
d2a56a2fed Update 4815.md (#3375) 2024-12-11 22:14:27 +08:00
Archer
4b9b0dbbb9 perf: private app check (#3376)
* perf: private app check

* perf: clb count
2024-12-11 22:12:57 +08:00
Archer
c0135f5f21 fix: permission (#3374)
* fix: permission

* feat: create dataset per
2024-12-11 20:56:52 +08:00
Archer
8a4715293e Update 4815.md (#3373) 2024-12-11 16:36:08 +08:00
Archer
69dc927a5a feat: login limit (#3369)
* feat: login limit

* feat: env template

* fix: ts
2024-12-11 15:46:21 +08:00
Archer
d5752ddbaa feat: Sync collection (#3368)
* feat: sync collection

* feat: sync collection

* perf: website selector

* update doc
2024-12-11 15:03:41 +08:00
285 changed files with 5479 additions and 1577 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

View File

@@ -201,7 +201,7 @@ weight: 708
- /imgs/model/qwen.svg - 通义千问
- /imgs/model/sparkDesk.svg - 讯飞星火
- /imgs/model/yi.svg - 零一万物
-
- /imgs/model/hunyuan.svg - 腾讯混元
## 特殊模型

View File

@@ -866,6 +866,8 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/delHistory
### 清空所有历史记录
仅会情况通过 API Key 创建的对话历史记录,不会清空在线使用、分享链接等其他来源的对话历史记录。
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
@@ -1313,6 +1315,83 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
## 猜你想问
**4.8.16 后新版接口**
新版猜你想问,必须包含 appId 和 chatId 的参数才可以进行使用。会自动根据 chatId 去拉取最近 6 轮对话记录作为上下文来引导回答。
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/ai/agent/v2/createQuestionGuide' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"questionGuide": {
"open": true,
"model": "GPT-4o-mini",
"customPrompt": "你是一个智能助手,请根据用户的问题生成猜你想问。"
}
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
| 参数名 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| appId | string | ✅ | 应用 Id |
| chatId | string | ✅ | 对话 Id |
| questionGuide | object | | 自定义配置,不传的话,则会根据 appId取最新发布版本的配置 |
```ts
type CreateQuestionGuideParams = OutLinkChatAuthProps & {
appId: string;
chatId: string;
questionGuide?: {
open: boolean;
model?: string;
customPrompt?: string;
};
};
```
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": [
"你对AI有什么看法",
"想了解AI的应用吗",
"你希望AI能做什么"
]
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
---
**4.8.16 前旧版接口:**
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
@@ -1369,3 +1448,5 @@ curl --location --request POST 'http://localhost:3000/api/core/ai/agent/createQu

View File

@@ -1,5 +1,5 @@
---
title: '升级到 V4.3(需要初始化)'
title: '升级到 V4.3(包含升级脚本)'
description: 'FastGPT 从旧版本升级到 V4.3 操作指南'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: '升级到 V4.4(需要初始化)'
title: '升级到 V4.4(包含升级脚本)'
description: 'FastGPT 从旧版本升级到 V4.4 操作指南'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: '升级到 V4.4.1(需要初始化)'
title: '升级到 V4.4.1(包含升级脚本)'
description: 'FastGPT 从旧版本升级到 V4.4.1 操作指南'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: '升级到 V4.4.2(需要初始化)'
title: '升级到 V4.4.2(包含升级脚本)'
description: 'FastGPT 从旧版本升级到 V4.4.2 操作指南'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.4.5(需要初始化)'
title: 'V4.4.5(包含升级脚本)'
description: 'FastGPT V4.4.5 更新'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.6(需要初始化)'
title: 'V4.6(包含升级脚本)'
description: 'FastGPT V4.6 更新'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.6.2(需要初始化)'
title: 'V4.6.2(包含升级脚本)'
description: 'FastGPT V4.6.2'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.6.3(需要初始化)'
title: 'V4.6.3(包含升级脚本)'
description: 'FastGPT V4.6.3'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.6.4(需要初始化)'
title: 'V4.6.4(包含升级脚本)'
description: 'FastGPT V4.6.4'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.6.9(需要初始化)'
title: 'V4.6.9(包含升级脚本)'
description: 'FastGPT V4.6.9更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.7.1(需要初始化)'
title: 'V4.7.1(包含升级脚本)'
description: 'FastGPT V4.7.1 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.1(需要初始化)'
title: 'V4.8.1(包含升级脚本)'
description: 'FastGPT V4.8.1 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.10(需要初始化)'
title: 'V4.8.10(包含升级脚本)'
description: 'FastGPT V4.8.10 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.12(需要初始化)'
title: 'V4.8.12(包含升级脚本)'
description: 'FastGPT V4.8.12 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.15(初始化)'
title: 'V4.8.15(包含升级脚本)'
description: 'FastGPT V4.8.15 更新说明'
icon: 'upgrade'
draft: false
@@ -23,23 +23,35 @@ weight: 809
## 升级指南
- 更新 FastGPT 镜像 tag: v4.8.15
- 更新 FastGPT 商业版镜像 tag: v4.8.15 fastgpt-pro镜像
- 更新 fastgpt 镜像 tag: v4.8.15-fix3
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.15
- Sandbox 镜像,可以不更新
## 运行初始化脚本
## 运行升级脚本
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`{{host}} 替换成**FastGPT 域名**。
```bash
curl --location --request POST 'https://{{host}}/admin/initv4815' \
curl --location --request POST 'https://{{host}}/api/admin/initv4815' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```
会重置应用定时执行的字段,把 null 去掉,减少索引大小。
----
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`{{host}} 替换成**fastgpt-pro域名**。
```bash
curl --location --request POST 'https://{{host}}/api/admin/init/refreshFreeUser' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```
重新计算一次免费版用户的时长,之前有版本升级时没有重新计算时间,导致会误发通知。
## 完整更新内容
@@ -61,4 +73,4 @@ curl --location --request POST 'https://{{host}}/admin/initv4815' \
16. 修复 - 语言播放鉴权问题。
17. 修复 - 插件应用知识库引用上限始终为 3000
18. 修复 - 工作流编辑记录存储上限,去掉本地存储,增加异常离开时,强制自动保存。
19. 修复 - 工作流特殊变量替换问题。($开头的字符串无法替换)
19. 修复 - 工作流特殊变量替换问题。($开头的字符串无法替换)

View File

@@ -0,0 +1,29 @@
---
title: 'V4.8.16(进行中)'
description: 'FastGPT V4.8.16 更新说明'
icon: 'upgrade'
draft: false
toc: true
weight: 808
---
## 完整更新内容
1. 新增 - SearXNG 搜索插件[点击查看教程](/docs/guide/plugins/searxng_plugin_guide/)
2. 新增 - 商业版支持 API 知识库和链接集合定时同步。
3. 新增 - 猜你想问支持选择模型和自定义提示词。
4. 新增 - 钉钉和企微机器人 webhook 插件。
5. 新增 - 商业版支持钉钉 SSO 登录配置。[点击查看教程](/docs/guide/admin/sso_dingtalk/)
6. 新增 - 商业版支持飞书和语雀知识库导入。[点击查看教程](/docs/guide/knowledge_base/lark_dataset/)
7. 新增 - sandbox 新增 createHmac 加密全局方法。
8. 新增 - 工作流右键支持
9. 优化 - 工作流/简易模式变量初始化代码,去除监听初始化,避免因渲染顺序不一致导致的失败。
10. 优化 - 工作流获取数据类型不一致数据时,增加类型转化,避免 undefined。
11. 修复 - 无法自动切换默认语言。增加分享链接,强制执行一次切换默认语言。
12. 修复 - 数组选择器自动兼容 4.8.13 以前的数据。
13. 修复 - 站点同步知识库,链接同步时未使用选择器。
14. 修复 - 简易模式转工作流,没有把系统配置项转化。
15. 修复 - 插件独立运行,变量初始值未赋上。
16. 修复 - 工作流使用弹窗组件时,关闭弹窗后,有时候会出现页面偏移。
17. 修复 - 插件调试时,日志未保存插件输入参数。

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.4(需要初始化)'
title: 'V4.8.4(包含升级脚本)'
description: 'FastGPT V4.8.4 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.5(需要初始化)'
title: 'V4.8.5(包含升级脚本)'
description: 'FastGPT V4.8.5 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.6(需要初始化)'
title: 'V4.8.6(包含升级脚本)'
description: 'FastGPT V4.8.6 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.8(需要初始化)'
title: 'V4.8.8(包含升级脚本)'
description: 'FastGPT V4.8.8 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -55,14 +55,14 @@ docker-compose up -d
## 执行升级初始化脚本
镜像更新完后,可以查看文档中的`版本介绍`,通常需要执行升级脚本的版本都会标明`需要初始化`,打开对应的文档,参考说明执行初始化脚本即可,大部分时候都是需要发送一个`POST`请求。
镜像更新完后,可以查看文档中的`版本介绍`,通常需要执行升级脚本的版本都会标明`包含升级脚本`,打开对应的文档,参考说明执行**升级脚本**即可,大部分时候都是需要发送一个`POST`请求。
## QA
### 为什么需要初始化
### 为什么需要执行升级脚本
数据表出现大幅度变更,无法通过设置默认值,或复杂度较高时,会通过初始化来更新部分数据表字段。
数据表出现大幅度变更,无法通过设置默认值,或复杂度较高时,会通过升级脚本来更新部分数据表字段。
严格按初始化步骤进行操作,不会造成旧数据丢失。但在初始化过程中,如果数据量大,需要初始化的时间较长,这段时间可能会造成服务无法正常使用。
### {{host}} 是什么

View File

@@ -0,0 +1,9 @@
---
weight: 490
title: '商业版后台'
description: '商业版后台使用教程'
icon: 'chat_bubble'
draft: false
images: []
---
<!-- 470 ~ 500 -->

View File

@@ -0,0 +1,44 @@
---
weight: 490
title: '钉钉 SSO 配置'
description: '钉钉 SSO 登录'
icon: 'chat_bubble'
draft: false
images: []
---
## 1. 注册钉钉应用
登录 [钉钉开放平台](https://open-dev.dingtalk.com/fe/app?hash=%23%2Fcorp%2Fapp#/corp/app),创建一个应用。
![alt text](/imgs/image-25.png)
## 2. 配置钉钉应用安全设置
点击进入创建好的应用后,点开`安全设置`,配置出口 IP服务器 IP和重定向 URL。重定向 URL 填写逻辑:
`{{fastgpt 域名}}/login/provider`
![alt text](/imgs/image-26.png)
## 3. 设置钉钉应用权限
点击进入创建好的应用后,点开`权限设置`,开放两个权限: `个人手机号信息``通讯录个人信息读权限`
![alt text](/imgs/image-27.png)
## 4. 发布应用
点击进入创建好的应用后,点开`版本管理与发布`,随便创建一个新版本即可。
## 5. 在 FastGPT Admin 配置钉钉应用 id
名字都是对应上,直接填写即可。
| | |
| --- | --- |
| ![alt text](/imgs/image-28.png)| ![alt text](/imgs/image-29.png) |
## 6. 测试
![alt text](/imgs/image-30.png)

View File

@@ -0,0 +1,59 @@
---
title: '飞书知识库'
description: 'FastGPT 飞书知识库功能介绍和使用方式'
icon: 'language'
draft: false
toc: true
weight: 405
---
| | |
| --- | --- |
| ![alt text](/imgs/image-39.png) | ![alt text](/imgs/image-40.png) |
FastGPT v4.8.16 版本开始,商业版用户支持飞书知识库导入,用户可以通过配置飞书应用的 appId 和 appSecret并选中一个**文档空间的顶层文件夹**来导入飞书知识库。目前处于测试阶段,部分交互有待优化。
由于飞书限制,无法直接获取所有文档内容,目前仅可以获取共享空间下文件目录的内容,无法获取个人空间和知识库里的内容。
## 1. 创建飞书应用
打开 [飞书开放平台](https://open.feishu.cn/?lang=zh-CN),点击**创建应用**,选择**自建应用**,然后填写应用名称。
## 2. 配置应用权限
创建应用后,进入应用可以配置相关权限,这里需要增加两个权限:
1. 获取云空间文件夹下的云文档清单
2. 查看新版文档
![alt text](/imgs/image-41.png)
## 3. 获取 appId 和 appSecret
![alt text](/imgs/image-42.png)
## 4. 给 Folder 增加权限
可参考飞书教程: https://open.feishu.cn/document/server-docs/docs/drive-v1/faq#b02e5bfb
大致总结为:
1. 把刚刚创建的应用拉入一个群里
2. 给这个群增加目录权限
如果你的目录已经给全员组增加权限了,则可以跳过上面步骤,直接获取 Folder Token。
![alt text](/imgs/image-43.png)
## 5. 获取 Folder Token
可以页面路径上获取 Folder Token注意不要把问号复制进来。
![alt text](/imgs/image-44.png)
## 6. 创建知识库
根据 3 和 5 获取到的 3 个参数,创建知识库,选择飞书文件库类型,然后填入对应的参数,点击创建。
![alt text](/imgs/image-39.png)

View File

@@ -0,0 +1,42 @@
---
title: '语雀文件库'
description: 'FastGPT 语雀文件库功能介绍和使用方式'
icon: 'language'
draft: false
toc: true
weight: 405
---
| | |
| --- | --- |
| ![alt text](/imgs/image-31.png) | ![alt text](/imgs/image-32.png) |
FastGPT v4.8.16 版本开始,商业版用户支持语雀文件库导入,用户可以通过配置语雀的 token 和 uid 来导入语雀文档库。目前处于测试阶段,部分交互有待优化。
## 1. 获取语雀的 token 和 uid
在语雀首页 - 个人头像 - 设置,可找到对应参数。
![alt text](/imgs/image-36.png)
参考下图获取 Token 和 User ID注意给 Token 赋值权限:
| 获取 Token | 增加权限 | 获取 User ID |
| --- | --- | --- |
| ![alt text](/imgs/image-33.png) | ![alt text](/imgs/image-34.png) | ![alt text](/imgs/image-35.png) |
## 2. 创建知识库
使用上一步获取的 token 和 uid创建知识库选择语雀文件库类型然后填入对应的参数点击创建。
![alt text](/imgs/image-37.png)
![alt text](/imgs/image-31.png)
## 3. 导入文档
创建完知识库后,点击`添加文件`即可导入语雀的文档库,跟随引导即可。
语雀知识库支持定时同步功能,每天会不定时的扫描一次,如果文档有更新,则会进行同步,也可以进行手动同步。
![alt text](/imgs/image-38.png)

View File

@@ -0,0 +1,178 @@
---
title: "SearXNG 搜索插件配置与使用说明"
description: "FastGPT SearXNG 搜索插件配置指南"
icon: "search"
draft: false
toc: true
weight: 303
---
[SearXNG](https://github.com/searxng/searxng)是一款免费的互联网元搜索引擎,它汇总了来自各种搜索服务和数据库的结果。它不会跟踪或分析用户。用户可以自行部署它进行使用。本文介绍 Searxng 的部署以及接入 FastGPT 插件。
## 1. 部署应用
这里介绍在 Sealos 中部署 SearXNG 的方法。Docker 部署,可以直接参考 [SearXNG 官方教程](https://github.com/searxng/searxng)。
点击打开 [Sealos 北京区](https://bja.sealos.run/),点击应用部署,并新建一个应用:
| 打开应用部署 | 点击新建应用 |
| --- | --- |
| ![](/imgs/searxng_plugin_guide1.png) | ![alt text](/imgs/image-45.png) |
## 2. 部署配置
把下面参数,填入配置中:
* 镜像名: searxng/searxng:latest
* CPU: 0.2
* 内存: 512M
* 容器暴露端口: 8080
* 开启公网访问
* 点击高级配置,填写环境变量和配置文件
![alt text](/imgs/image-50.png)
**环境变量**
填下面两个内容,主要是为了减小并发,不然内存占用非常大。
```
UWSGI_WORKERS=4
UWSGI_THREADS=4
```
**配置文件**
新增一个配置文件,文件名:`/etc/searx/settings.yml`
文件内容:
```txt
general:
debug: false
instance_name: "searxng"
privacypolicy_url: false
donation_url: false
contact_url: false
enable_metrics: true
open_metrics: ''
brand:
new_issue_url: https://github.com/searxng/searxng/issues/new
docs_url: https://docs.searxng.org/
public_instances: https://searx.space
wiki_url: https://github.com/searxng/searxng/wiki
issue_url: https://github.com/searxng/searxng/issues
search:
safe_search: 0
autocomplete: ""
autocomplete_min: 4
default_lang: "auto"
ban_time_on_fail: 5
max_ban_time_on_fail: 120
formats:
- html
server:
port: 8080
bind_address: "0.0.0.0"
base_url: false
limiter: false
public_instance: false
secret_key: "example"
image_proxy: false
http_protocol_version: "1.0"
method: "POST"
default_http_headers:
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Robots-Tag: noindex, nofollow
Referrer-Policy: no-referrer
redis:
url: false
ui:
static_path: ""
static_use_hash: false
templates_path: ""
default_theme: simple
default_locale: ""
query_in_title: false
infinite_scroll: false
center_alignment: false
theme_args:
simple_style: auto
outgoing:
request_timeout: 30.0
max_request_timeout: 40.0
pool_connections: 200
pool_maxsize: 50
enable_http2: false
retries: 5
engines:
- name: bing
engine: bing
shortcut: bi
doi_resolvers:
oadoi.org: 'https://oadoi.org/'
doi.org: 'https://doi.org/'
doai.io: 'https://dissem.in/'
sci-hub.se: 'https://sci-hub.se/'
sci-hub.st: 'https://sci-hub.st/'
sci-hub.ru: 'https://sci-hub.ru/'
default_doi_resolver: 'oadoi.org'
```
国内目前只有 Bing 引擎可以正常用,所以上面的配置只配置了 bing 引擎。如果在海外部署,可以使用[Sealos 新加坡可用区](https://cloud.sealos.io/),并配置其他搜索引擎,可以参考[SearXNG 默认配置文件](https://github.com/searxng/searxng/blob/master/searx/settings.yml), 从里面复制一些 engine 配置。例如:
```
- name: duckduckgo
engine: duckduckgo
shortcut: ddg
- name: google
engine: google
shortcut: go
```
## 3. FastGPT 使用
复制 Sealos 部署后提供的公网地址,填入 FastGPT 的 SearXNG 插件的 URL 中。
| 复制公网地址| 填入 URL |
| --- | --- |
| ![alt text](/imgs/image-48.png) | ![alt text](/imgs/image-49.png) |
## 返回格式
* 成功时返回搜索结果数组:
```Bash
{
"result": "[{\"title\":\"标题1\",\"link\":\"链接1\",\"snippet\":\"摘要1\"}, ...]"
}
```
* 失败时通过 Promise.reject 可能返回错误信息:
```Bash
- "缺少查询参数"
- "缺少url"
- "Failed to fetch data from Search XNG"
```
一般问题来源于参数缺失与服务部署,如有更多问题可在用户群提问。
## FAQ
### 无搜索结果
1. 先直接打开外网地址,测试是否可以正常搜索。
2. 检查是否有超时的搜索引擎,通过 API 调用时不会返回结果。

View File

@@ -84,4 +84,18 @@ function main({input}){
}
```
![alt text](/imgs/image-2.png)
![alt text](/imgs/image-2.png)
### createHmac 加密
与 node 中 crypto 的 createHmac 方法一致。
```js
function main({secret}){
const {sign,timestamp} = createHmac('sha256',secret)
return {
sign,timestamp
}
}
```

View File

@@ -0,0 +1,57 @@
---
title: "接入钉钉机器人教程"
description: "FastGPT 接入钉钉机器人教程"
icon: "chat"
draft: false
toc: true
weight: 505
---
从 4.8.16 版本起FastGPT 商业版支持直接接入钉钉机器人,无需额外的 API。
## 1. 创建钉钉企业内部应用
1. 在[钉钉开发者后台](https://open-dev.dingtalk.com/fe/app)创建企业内部应用。
![图片1](/imgs/dingtalk-bot-1.png)
2. 获取**Client ID**和**Client Secret**。
![图片2](/imgs/dingtalk-bot-2.png)
## 2. 为 FastGPT 添加发布渠道
在 FastGPT 中选择要接入的应用,在**发布渠道**页面,新建一个接入钉钉机器人的发布渠道。
将前面拿到的 **Client ID****Client Secret** 填入配置弹窗中。
![图片3](/imgs/dingtalk-bot-3.png)
创建完成后,点击**请求地址**按钮,然后复制回调地址。
## 3. 为应用添加**机器人**应用能力。
在钉钉开发者后台,点击左侧**添加应用能力**,为刚刚创建的企业内部应用添加 **机器人** 应用能力。
![图片4](/imgs/dingtalk-bot-4.png)
## 4. 配置机器人回调地址
点击左侧**机器人** 应用能力,然后将底部**消息接受模式**设置为**HTTP模式**,消息接收地址填入前面复制的 FastGPT 的回调地址。
![图片5](/imgs/dingtalk-bot-5.png)
调试完成后,点击**发布**。
## 5. 发布应用
机器人发布后,还需要在**版本管理与发布**页面发布应用版本。
![图片6](/imgs/dingtalk-bot-6.png)
点击**创建新版本**后,设置版本号和版本描述后点击保存发布即可。
![图片7](/imgs/dingtalk-bot-7.png)
应用发布后,即可在钉钉企业中使用机器人功能,可对机器人私聊。或者在群组添加机器人后`@机器人`,触发对话。
![图片8](/imgs/dingtalk-bot-8.png)

View File

@@ -121,8 +121,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix2 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix2 # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -79,8 +79,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix2 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix2 # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -60,8 +60,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix2 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix2 # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -12,7 +12,8 @@ export enum DatasetErrEnum {
unLinkCollection = 'unLinkCollection',
invalidVectorModelOrQAModel = 'invalidVectorModelOrQAModel',
notSupportSync = 'notSupportSync',
sameApiCollection = 'sameApiCollection'
sameApiCollection = 'sameApiCollection',
noApiServer = 'noApiServer'
}
const datasetErr = [
{

View File

@@ -72,7 +72,7 @@ export const ERROR_RESPONSE: Record<
[ERROR_ENUM.tooManyRequest]: {
code: 429,
statusText: ERROR_ENUM.tooManyRequest,
message: 'Too many request',
message: i18nT('common:error.too_many_request'),
data: null
},
[ERROR_ENUM.insufficientQuota]: {

View File

@@ -0,0 +1,7 @@
export enum TrackEnum {
login = 'login',
createApp = 'createApp',
useAppTemplate = 'useAppTemplate',
createDataset = 'createDataset',
appNodes = 'appNodes'
}

View File

@@ -0,0 +1,18 @@
import { TrackEnum } from './constants';
import { OAuthEnum } from '../../../support/user/constant';
import { AppTypeEnum } from '../../../core/app/constants';
export type PushTrackCommonType = {
uid: string;
teamId: string;
tmbId: string;
};
export type TrackSchemaType = {
event: TrackEnum;
createTime: Date;
uid?: string;
teamId?: string;
tmbId?: string;
data: Record<string, any>;
};

View File

@@ -29,7 +29,7 @@ export const simpleText = (text = '') => {
replace {{variable}} to value
*/
export function replaceVariable(text: any, obj: Record<string, string | number>) {
if (!(typeof text === 'string')) return text;
if (typeof text !== 'string') return text;
for (const key in obj) {
const val = obj[key];

View File

@@ -58,11 +58,13 @@ export type FastGPTFeConfigsType = {
icon?: string;
title?: string;
url?: string;
autoLogin?: boolean;
};
oauth?: {
github?: string;
google?: string;
wechat?: string;
dingtalk?: string;
microsoft?: {
clientId?: string;
tenantId?: string;

View File

@@ -65,3 +65,13 @@ export const Prompt_CQJson = `请帮我执行一个“问题分类”任务,
问题:"{{question}}"
类型ID=
`;
export const PROMPT_QUESTION_GUIDE = `You are an AI assistant tasked with predicting the user's next question based on the conversation history. Your goal is to generate 3 potential questions that will guide the user to continue the conversation. When generating these questions, adhere to the following rules:
1. Use the same language as the user's last question in the conversation history.
2. Keep each question under 20 characters in length.
Analyze the conversation history provided to you and use it as context to generate relevant and engaging follow-up questions. Your predictions should be logical extensions of the current topic or related areas that the user might be interested in exploring further.
Remember to maintain consistency in tone and style with the existing conversation while providing diverse options for the user to choose from. Your goal is to keep the conversation flowing naturally and help the user delve deeper into the subject matter or explore related topics.`;
export const PROMPT_QUESTION_GUIDE_FOOTER = `Please strictly follow the format rules: \nReturn questions in JSON format: ['Question 1', 'Question 2', 'Question 3']. Your output: `;

View File

@@ -1,8 +1,10 @@
import { PROMPT_QUESTION_GUIDE } from '../ai/prompt/agent';
import {
AppTTSConfigType,
AppFileSelectConfigType,
AppWhisperConfigType,
AppAutoExecuteConfigType
AppAutoExecuteConfigType,
AppQGConfigType
} from './type';
export enum AppTypeEnum {
@@ -28,6 +30,12 @@ export const defaultWhisperConfig: AppWhisperConfigType = {
autoTTSResponse: false
};
export const defaultQGConfig: AppQGConfigType = {
open: false,
model: 'gpt-4o-mini',
customPrompt: PROMPT_QUESTION_GUIDE
};
export const defaultChatInputGuideConfig = {
open: false,
textList: [],

View File

@@ -97,7 +97,7 @@ export type AppChatConfigType = {
welcomeText?: string;
variables?: VariableItemType[];
autoExecute?: AppAutoExecuteConfigType;
questionGuide?: boolean;
questionGuide?: AppQGConfigType;
ttsConfig?: AppTTSConfigType;
whisperConfig?: AppWhisperConfigType;
scheduledTriggerConfig?: AppScheduledTriggerConfigType;
@@ -148,6 +148,14 @@ export type AppWhisperConfigType = {
autoSend: boolean;
autoTTSResponse: boolean;
};
// question guide
export type AppQGConfigType = {
open: boolean;
model?: string;
customPrompt?: string;
};
// question guide text
export type ChatInputGuideConfigType = {
open: boolean;

View File

@@ -16,6 +16,7 @@ import { DatasetSearchModeEnum } from '../dataset/constants';
import { DispatchNodeResponseType } from '../workflow/runtime/type.d';
import { ChatBoxInputType } from '../../../../projects/app/src/components/core/chat/ChatContainer/ChatBox/type';
import { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
import { FlowNodeInputItemType } from '../workflow/type/io';
export type ChatSchema = {
_id: string;
@@ -35,6 +36,7 @@ export type ChatSchema = {
variableList?: VariableItemType[];
welcomeText?: string;
variables: Record<string, any>;
pluginInputs?: FlowNodeInputItemType[];
metadata?: Record<string, any>;
};

View File

@@ -17,6 +17,11 @@ export type DatasetUpdateBody = {
externalReadUrl?: DatasetSchemaType['externalReadUrl'];
defaultPermission?: DatasetSchemaType['defaultPermission'];
apiServer?: DatasetSchemaType['apiServer'];
yuqueServer?: DatasetSchemaType['yuqueServer'];
feishuServer?: DatasetSchemaType['feishuServer'];
// sync schedule
autoSync?: boolean;
};
/* ================= collection ===================== */
@@ -47,6 +52,8 @@ export type CreateDatasetCollectionParams = DatasetCollectionChunkMetadataType &
tags?: string[];
createTime?: Date;
updateTime?: Date;
nextSyncTime?: Date;
};
export type ApiCreateDatasetCollectionParams = DatasetCollectionChunkMetadataType & {

View File

@@ -22,3 +22,14 @@ export type APIFileContentResponse = {
export type APIFileReadResponse = {
url: string;
};
export type FeishuServer = {
appId: string;
appSecret: string;
folderToken: string;
};
export type YuqueServer = {
userId: string;
token: string;
};

View File

@@ -6,7 +6,9 @@ export enum DatasetTypeEnum {
dataset = 'dataset',
websiteDataset = 'websiteDataset', // depp link
externalFile = 'externalFile',
apiDataset = 'apiDataset'
apiDataset = 'apiDataset',
feishu = 'feishu',
yuque = 'yuque'
}
export const DatasetTypeMap = {
[DatasetTypeEnum.folder]: {
@@ -33,6 +35,16 @@ export const DatasetTypeMap = {
icon: 'core/dataset/externalDatasetOutline',
label: 'api_file',
collectionLabel: 'common.File'
},
[DatasetTypeEnum.feishu]: {
icon: 'core/dataset/feishuDatasetOutline',
label: 'feishu_dataset',
collectionLabel: 'common.File'
},
[DatasetTypeEnum.yuque]: {
icon: 'core/dataset/yuqueDatasetOutline',
label: 'yuque_dataset',
collectionLabel: 'common.File'
}
};
@@ -82,7 +94,8 @@ export const DatasetCollectionTypeMap = {
export enum DatasetCollectionSyncResultEnum {
sameRaw = 'sameRaw',
success = 'success'
success = 'success',
failed = 'failed'
}
export const DatasetCollectionSyncResultMap = {
[DatasetCollectionSyncResultEnum.sameRaw]: {
@@ -90,6 +103,9 @@ export const DatasetCollectionSyncResultMap = {
},
[DatasetCollectionSyncResultEnum.success]: {
label: i18nT('common:core.dataset.collection.sync.result.success')
},
[DatasetCollectionSyncResultEnum.failed]: {
label: i18nT('dataset:sync_collection_failed')
}
};

View File

@@ -10,7 +10,7 @@ import {
} from './constants';
import { DatasetPermission } from '../../support/permission/dataset/controller';
import { Permission } from '../../support/permission/controller';
import { APIFileServer } from './apiDataset';
import { APIFileServer, FeishuServer, YuqueServer } from './apiDataset';
export type DatasetSchemaType = {
_id: string;
@@ -33,9 +33,10 @@ export type DatasetSchemaType = {
};
inheritPermission: boolean;
apiServer?: APIFileServer;
feishuServer?: FeishuServer;
yuqueServer?: YuqueServer;
syncSchedule?: { cronString: string; timezone: string };
syncNextTime?: Date;
autoSync?: boolean;
// abandon
externalReadUrl?: string;
@@ -65,11 +66,13 @@ export type DatasetCollectionSchemaType = {
fileId?: string; // local file id
rawLink?: string; // link url
externalFileId?: string; //external file id
apiFileId?: string; // api file id
externalFileUrl?: string; // external import url
nextSyncTime?: Date;
rawTextLength?: number;
hashRawText?: string;
externalFileUrl?: string; // external import url
apiFileId?: string; // api file id
metadata?: {
webPageSelector?: string;
relatedImgId?: string; // The id of the associated image collections

View File

@@ -251,6 +251,7 @@ export const getReferenceVariableValue = ({
return variables[outputId];
}
// 避免 value 刚好就是二个元素的字符串数组
const node = nodes.find((node) => node.nodeId === sourceNodeId);
if (!node) {
return value;
@@ -283,9 +284,13 @@ export const formatVariableValByType = (val: any, valueType?: WorkflowIOValueTyp
if (!valueType) return val;
// Value type check, If valueType invalid, return undefined
if (valueType.startsWith('array') && !Array.isArray(val)) return undefined;
if (valueType === WorkflowIOValueTypeEnum.boolean && typeof val !== 'boolean') return undefined;
if (valueType === WorkflowIOValueTypeEnum.number && typeof val !== 'number') return undefined;
if (valueType === WorkflowIOValueTypeEnum.string && typeof val !== 'string') return undefined;
if (valueType === WorkflowIOValueTypeEnum.boolean) return Boolean(val);
if (valueType === WorkflowIOValueTypeEnum.number) return Number(val);
if (valueType === WorkflowIOValueTypeEnum.string) {
if (val === undefined) return 'undefined';
if (val === null) return 'null';
return typeof val === 'object' ? JSON.stringify(val) : String(val);
}
if (
[
WorkflowIOValueTypeEnum.object,

View File

@@ -26,12 +26,14 @@ import type {
AppScheduledTriggerConfigType,
ChatInputGuideConfigType,
AppChatConfigType,
AppAutoExecuteConfigType
AppAutoExecuteConfigType,
AppQGConfigType
} from '../app/type';
import { EditorVariablePickerType } from '../../../web/components/common/Textarea/PromptEditor/type';
import {
defaultAutoExecuteConfig,
defaultChatInputGuideConfig,
defaultQGConfig,
defaultTTSConfig,
defaultWhisperConfig
} from '../app/constants';
@@ -76,9 +78,14 @@ export const splitGuideModule = (guideModules?: StoreNodeItemType) => {
const variables: VariableItemType[] =
guideModules?.inputs.find((item) => item.key === NodeInputKeyEnum.variables)?.value ?? [];
const questionGuide: boolean =
!!guideModules?.inputs?.find((item) => item.key === NodeInputKeyEnum.questionGuide)?.value ??
false;
// Adapt old version
const questionGuideVal = guideModules?.inputs?.find(
(item) => item.key === NodeInputKeyEnum.questionGuide
)?.value;
const questionGuide: AppQGConfigType =
typeof questionGuideVal === 'boolean'
? { ...defaultQGConfig, open: questionGuideVal }
: questionGuideVal ?? defaultQGConfig;
const ttsConfig: AppTTSConfigType =
guideModules?.inputs?.find((item) => item.key === NodeInputKeyEnum.tts)?.value ??

View File

@@ -3,6 +3,7 @@ export enum PublishChannelEnum {
iframe = 'iframe',
apikey = 'apikey',
feishu = 'feishu',
dingtalk = 'dingtalk',
wecom = 'wecom',
officialAccount = 'official_account'
}

View File

@@ -14,6 +14,11 @@ export interface FeishuAppType {
verificationToken?: string;
}
export interface DingtalkAppType {
clientId: string;
clientSecret: string;
}
export interface WecomAppType {
AgentId: string;
CorpId: string;
@@ -36,7 +41,12 @@ export interface OffiAccountAppType {
// because we can not reply anything in 15s. Thus, the wechat server will treat this request as a failed request.
}
export type OutlinkAppType = FeishuAppType | WecomAppType | OffiAccountAppType | undefined;
export type OutlinkAppType =
| FeishuAppType
| WecomAppType
| OffiAccountAppType
| DingtalkAppType
| undefined;
export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
_id: string;

View File

@@ -1,4 +1,5 @@
import { OAuthEnum } from './constant';
import { TrackRegisterParams } from './login/api';
export type PostLoginProps = {
username: string;
@@ -9,8 +10,7 @@ export type OauthLoginProps = {
type: `${OAuthEnum}`;
code: string;
callbackUrl: string;
inviterId?: string;
};
} & TrackRegisterParams;
export type WxLoginProps = {
inviterId?: string;

View File

@@ -16,5 +16,6 @@ export enum OAuthEnum {
google = 'google',
wechat = 'wechat',
microsoft = 'microsoft',
dingtalk = 'dingtalk',
sso = 'sso'
}

View File

@@ -2,3 +2,17 @@ export type GetWXLoginQRResponse = {
code: string;
codeUrl: string;
};
export type TrackRegisterParams = {
inviterId?: string;
bd_vid?: string;
fastgpt_sem?: {
keyword: string;
};
sourceDomain?: string;
};
export type AccountRegisterBody = {
username: string;
code: string;
password: string;
} & TrackRegisterParams;

View File

@@ -12,6 +12,7 @@ export type CreateTeamProps = {
avatar?: string;
defaultTeam?: boolean;
lafAccount?: LafAccountType;
memberName?: string;
};
export type UpdateTeamProps = {
name?: string;

View File

@@ -101,6 +101,7 @@ export type TeamInvoiceHeaderType = {
bankName?: string;
bankAccount?: string;
needSpecialInvoice: boolean;
contactPhone: string;
emailAddress: string;
};

View File

@@ -9,6 +9,7 @@ export enum UsageSourceEnum {
share = 'share',
wecom = 'wecom',
feishu = 'feishu',
dingtalk = 'dingtalk',
official_account = 'official_account'
}
@@ -39,5 +40,8 @@ export const UsageSourceMap = {
},
[UsageSourceEnum.wecom]: {
label: i18nT('user:usage.wecom')
},
[UsageSourceEnum.dingtalk]: {
label: i18nT('user:usage.dingtalk')
}
};

View File

@@ -37,6 +37,8 @@ export const getUsageSourceByPublishChannel = (publishchannel: PublishChannelEnu
return UsageSourceEnum.wecom;
case PublishChannelEnum.officialAccount:
return UsageSourceEnum.official_account;
case PublishChannelEnum.dingtalk:
return UsageSourceEnum.dingtalk;
default:
return UsageSourceEnum.fastgpt;
}

View File

@@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"dependencies": {
"cheerio": "1.0.0-rc.12",
"@types/pg": "^8.6.6",
"axios": "^1.5.1",
"duck-duck-scrape": "^2.2.5",

View File

@@ -5,7 +5,15 @@ import { cloneDeep } from 'lodash';
import { WorkerNameEnum, runWorker } from '@fastgpt/service/worker/utils';
// Run in main thread
const staticPluginList = ['getTime', 'fetchUrl', 'feishu', 'google', 'bing'];
const staticPluginList = [
'getTime',
'fetchUrl',
'feishu',
'DingTalkWebhook',
'WeWorkWebhook',
'google',
'bing'
];
// Run in worker thread (Have npm packages)
const packagePluginList = [
'mathExprVal',
@@ -19,7 +27,8 @@ const packagePluginList = [
'wiki',
'databaseConnection',
'Doc2X',
'Doc2X/PDF2text'
'Doc2X/PDF2text',
'searchXNG'
];
export const list = [...staticPluginList, ...packagePluginList];

View File

@@ -0,0 +1,536 @@
{
"author": "",
"version": "4816",
"name": "钉钉 webhook",
"avatar": "plugins/dingding",
"intro": "向钉钉机器人发起 webhook 请求。",
"courseUrl": "https://open.dingtalk.com/document/robots/custom-robot-access",
"showStatus": false,
"weight": 10,
"isTool": true,
"templateType": "communication",
"workflow": {
"nodes": [
{
"nodeId": "pluginInput",
"name": "插件开始",
"intro": "自定义配置外部输入,使用插件时,仅暴露自定义配置的输入",
"avatar": "core/workflow/template/workflowStart",
"flowNodeType": "pluginInput",
"showStatus": false,
"position": {
"x": 557.4542421888484,
"y": -131.2827008898969
},
"version": "481",
"inputs": [
{
"inputType": "input",
"valueType": "string",
"key": "钉钉机器人地址",
"label": "钉钉机器人地址",
"description": "",
"isToolInput": false,
"defaultValue": "",
"editField": {
"key": true
},
"dynamicParamDefaultValue": {
"inputType": "reference",
"valueType": "string",
"required": true
},
"renderTypeList": ["input"],
"required": true,
"canEdit": true,
"value": "",
"list": []
},
{
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
"key": "加签值",
"label": "加签值",
"description": "钉钉机器人加签值",
"defaultValue": "",
"list": [
{
"label": "",
"value": ""
}
],
"maxFiles": 5,
"canSelectFile": true,
"canSelectImg": true,
"required": true
},
{
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
"key": "发送的消息",
"label": "发送的消息",
"description": "发送的消息",
"defaultValue": "",
"list": [
{
"label": "",
"value": ""
}
],
"maxFiles": 5,
"canSelectFile": true,
"canSelectImg": true,
"required": true,
"toolDescription": "发送的消息"
}
],
"outputs": [
{
"id": "mv52BrPVE6bm",
"key": "钉钉机器人地址",
"valueType": "string",
"label": "钉钉机器人地址",
"type": "static"
},
{
"id": "srcret",
"valueType": "string",
"key": "加签值",
"label": "加签值",
"type": "hidden"
},
{
"id": "发送的消息",
"valueType": "string",
"key": "发送的消息",
"label": "发送的消息",
"type": "hidden"
}
]
},
{
"nodeId": "pluginOutput",
"name": "插件输出",
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
"avatar": "core/workflow/template/pluginOutput",
"flowNodeType": "pluginOutput",
"showStatus": false,
"position": {
"x": 2420.0305926489386,
"y": -106.28270088989689
},
"version": "481",
"inputs": [],
"outputs": []
},
{
"nodeId": "rKBYGQuYefae",
"name": "HTTP 请求",
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
"avatar": "core/workflow/template/httpRequest",
"flowNodeType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1645.779103978597,
"y": -431.7827008898969
},
"version": "481",
"inputs": [
{
"key": "system_addInputParam",
"renderTypeList": ["addInputParam"],
"valueType": "dynamic",
"label": "",
"required": false,
"description": "common:core.module.input.description.HTTP Dynamic Input",
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
},
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpMethod",
"renderTypeList": ["custom"],
"valueType": "string",
"label": "",
"value": "POST",
"required": true,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpTimeout",
"renderTypeList": ["custom"],
"valueType": "number",
"label": "",
"value": 30,
"min": 5,
"max": 600,
"required": true,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpReqUrl",
"renderTypeList": ["hidden"],
"valueType": "string",
"label": "",
"description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"value": "{{$a5qdMS7ECNYE.qLUQfhG0ILRX$}}",
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpHeader",
"renderTypeList": ["custom"],
"valueType": "any",
"value": [],
"label": "",
"description": "common:core.module.input.description.Http Request Header",
"placeholder": "common:core.module.input.description.Http Request Header",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpParams",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpJsonBody",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": "{\r\n \"msgtype\": \"text\",\r\n \"text\": {\r\n \"content\": \"{{$pluginInput.发送的消息$}}\"\r\n }\r\n}",
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpFormBody",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpContentType",
"renderTypeList": ["hidden"],
"valueType": "string",
"value": "json",
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
}
],
"outputs": [
{
"id": "error",
"key": "error",
"label": "workflow:request_error",
"description": "HTTP请求错误信息成功时返回空",
"valueType": "object",
"type": "static"
},
{
"id": "httpRawResponse",
"key": "httpRawResponse",
"required": true,
"label": "workflow:raw_response",
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"valueType": "any",
"type": "static"
},
{
"id": "system_addOutputParam",
"key": "system_addOutputParam",
"type": "dynamic",
"valueType": "dynamic",
"label": "",
"editField": {
"key": true,
"valueType": true
}
}
]
},
{
"nodeId": "q3ccNXiZIHoS",
"name": "系统配置",
"intro": "",
"avatar": "core/workflow/template/systemConfig",
"flowNodeType": "pluginConfig",
"position": {
"x": 99.73879703925843,
"y": -201.26482361861054
},
"version": "4811",
"inputs": [],
"outputs": []
},
{
"nodeId": "a5qdMS7ECNYE",
"name": "代码运行",
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
"avatar": "core/workflow/template/codeRun",
"flowNodeType": "code",
"showStatus": true,
"position": {
"x": 1106.1011901190363,
"y": -407.7827008898969
},
"version": "482",
"inputs": [
{
"key": "system_addInputParam",
"renderTypeList": ["addInputParam"],
"valueType": "dynamic",
"label": "",
"required": false,
"description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
},
"valueDesc": "",
"debugLabel": "",
"toolDescription": ""
},
{
"key": "codeType",
"renderTypeList": ["hidden"],
"label": "",
"value": "js",
"valueDesc": "",
"description": "",
"debugLabel": "",
"toolDescription": ""
},
{
"key": "code",
"renderTypeList": ["custom"],
"label": "",
"value": "function main({url, secret}){\n const {sign,timestamp} = createHmac('sha256',secret)\n\n return {\n result: `${url}&timestamp=${timestamp}&sign=${sign}`\n }\n}",
"valueDesc": "",
"description": "",
"debugLabel": "",
"toolDescription": ""
},
{
"renderTypeList": ["reference"],
"valueType": "string",
"canEdit": true,
"key": "url",
"label": "url",
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
},
"required": true,
"value": ["pluginInput", "mv52BrPVE6bm"]
},
{
"renderTypeList": ["reference"],
"valueType": "string",
"canEdit": true,
"key": "secret",
"label": "secret",
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
},
"required": true,
"value": ["pluginInput", "srcret"]
}
],
"outputs": [
{
"id": "system_rawResponse",
"key": "system_rawResponse",
"label": "workflow:full_response_data",
"valueType": "object",
"type": "static",
"description": ""
},
{
"id": "error",
"key": "error",
"label": "workflow:execution_error",
"description": "代码运行错误信息,成功时返回空",
"valueType": "object",
"type": "static"
},
{
"id": "system_addOutputParam",
"key": "system_addOutputParam",
"type": "dynamic",
"valueType": "dynamic",
"label": "",
"customFieldConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": false
},
"description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
"valueDesc": ""
},
{
"id": "qLUQfhG0ILRX",
"type": "dynamic",
"key": "result",
"valueType": "string",
"label": "result",
"valueDesc": "",
"description": ""
}
]
}
],
"edges": [
{
"source": "rKBYGQuYefae",
"target": "pluginOutput",
"sourceHandle": "rKBYGQuYefae-source-right",
"targetHandle": "pluginOutput-target-left"
},
{
"source": "pluginInput",
"target": "a5qdMS7ECNYE",
"sourceHandle": "pluginInput-source-right",
"targetHandle": "a5qdMS7ECNYE-target-left"
},
{
"source": "a5qdMS7ECNYE",
"target": "rKBYGQuYefae",
"sourceHandle": "a5qdMS7ECNYE-source-right",
"targetHandle": "rKBYGQuYefae-target-left"
}
],
"chatConfig": {
"welcomeText": "",
"variables": [],
"questionGuide": false,
"ttsConfig": {
"type": "web"
},
"whisperConfig": {
"open": false,
"autoSend": false,
"autoTTSResponse": false
},
"chatInputGuide": {
"open": false,
"textList": [],
"customUrl": ""
},
"instruction": "",
"autoExecute": {
"open": false,
"defaultPrompt": ""
},
"_id": "6710a5619c45325525326719"
}
}
}

View File

@@ -439,7 +439,9 @@
}
],
"chatConfig": {
"questionGuide": false,
"questionGuide": {
"open": false
},
"ttsConfig": {
"type": "web"
},

View File

@@ -0,0 +1,386 @@
{
"author": "",
"version": "4816",
"name": "企业微信 webhook",
"avatar": "plugins/qiwei",
"intro": "向企业微信机器人发起 webhook 请求。只能内部群使用。",
"courseUrl": "https://developer.work.weixin.qq.com/document/path/91770",
"showStatus": false,
"weight": 10,
"isTool": true,
"templateType": "communication",
"workflow": {
"nodes": [
{
"nodeId": "pluginInput",
"name": "插件开始",
"intro": "自定义配置外部输入,使用插件时,仅暴露自定义配置的输入",
"avatar": "core/workflow/template/workflowStart",
"flowNodeType": "pluginInput",
"showStatus": false,
"position": {
"x": 537.6357458754286,
"y": -201.26482361861054
},
"version": "481",
"inputs": [
{
"inputType": "input",
"valueType": "string",
"key": "企微机器人地址",
"label": "企微机器人地址",
"description": "",
"isToolInput": false,
"defaultValue": "",
"editField": {
"key": true
},
"dynamicParamDefaultValue": {
"inputType": "reference",
"valueType": "string",
"required": true
},
"renderTypeList": ["input"],
"required": true,
"canEdit": true,
"value": ""
},
{
"key": "发送的消息",
"valueType": "string",
"label": "发送的消息",
"renderTypeList": ["input", "reference"],
"required": true,
"description": "发送的消息",
"canEdit": true,
"value": "",
"editField": {
"key": true
},
"dynamicParamDefaultValue": {
"inputType": "reference",
"valueType": "string",
"required": true
},
"list": [],
"defaultValue": "",
"toolDescription": "发送的消息"
}
],
"outputs": [
{
"id": "mv52BrPVE6bm",
"key": "企微机器人地址",
"valueType": "string",
"label": "企微机器人地址",
"type": "static"
},
{
"id": "p0m68Dv5KaIp",
"key": "发送的消息",
"valueType": "string",
"label": "发送的消息",
"type": "static"
}
]
},
{
"nodeId": "pluginOutput",
"name": "插件输出",
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
"avatar": "core/workflow/template/pluginOutput",
"flowNodeType": "pluginOutput",
"showStatus": false,
"position": {
"x": 1776.027569211593,
"y": -58.264823618610535
},
"version": "481",
"inputs": [],
"outputs": []
},
{
"nodeId": "rKBYGQuYefae",
"name": "HTTP 请求",
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
"avatar": "core/workflow/template/httpRequest",
"flowNodeType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1069.7228495148624,
"y": -392.26482361861054
},
"version": "481",
"inputs": [
{
"key": "system_addInputParam",
"renderTypeList": ["addInputParam"],
"valueType": "dynamic",
"label": "",
"required": false,
"description": "common:core.module.input.description.HTTP Dynamic Input",
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
},
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpMethod",
"renderTypeList": ["custom"],
"valueType": "string",
"label": "",
"value": "POST",
"required": true,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpTimeout",
"renderTypeList": ["custom"],
"valueType": "number",
"label": "",
"value": 30,
"min": 5,
"max": 600,
"required": true,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpReqUrl",
"renderTypeList": ["hidden"],
"valueType": "string",
"label": "",
"description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"value": "{{url}}",
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpHeader",
"renderTypeList": ["custom"],
"valueType": "any",
"value": [],
"label": "",
"description": "common:core.module.input.description.Http Request Header",
"placeholder": "common:core.module.input.description.Http Request Header",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpParams",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpJsonBody",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": "{\r\n \"msgtype\": \"text\",\r\n \"text\": {\r\n \"content\": \"{{text}}\"\r\n }\r\n}",
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpFormBody",
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "system_httpContentType",
"renderTypeList": ["hidden"],
"valueType": "string",
"value": "json",
"label": "",
"required": false,
"debugLabel": "",
"toolDescription": ""
},
{
"key": "text",
"valueType": "string",
"label": "text",
"renderTypeList": ["reference"],
"description": "",
"canEdit": true,
"editField": {
"key": true,
"valueType": true
},
"value": ["pluginInput", "p0m68Dv5KaIp"],
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
}
},
{
"key": "url",
"valueType": "string",
"label": "url",
"renderTypeList": ["reference"],
"description": "",
"canEdit": true,
"editField": {
"key": true,
"valueType": true
},
"value": ["pluginInput", "mv52BrPVE6bm"],
"customInputConfig": {
"selectValueTypeList": [
"string",
"number",
"boolean",
"object",
"arrayString",
"arrayNumber",
"arrayBoolean",
"arrayObject",
"arrayAny",
"any",
"chatHistory",
"datasetQuote",
"dynamic",
"selectApp",
"selectDataset"
],
"showDescription": false,
"showDefaultValue": true
}
}
],
"outputs": [
{
"id": "error",
"key": "error",
"label": "workflow:request_error",
"description": "HTTP请求错误信息成功时返回空",
"valueType": "object",
"type": "static"
},
{
"id": "httpRawResponse",
"key": "httpRawResponse",
"required": true,
"label": "workflow:raw_response",
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"valueType": "any",
"type": "static"
},
{
"id": "system_addOutputParam",
"key": "system_addOutputParam",
"type": "dynamic",
"valueType": "dynamic",
"label": "",
"editField": {
"key": true,
"valueType": true
}
}
]
},
{
"nodeId": "q3ccNXiZIHoS",
"name": "系统配置",
"intro": "",
"avatar": "core/workflow/template/systemConfig",
"flowNodeType": "pluginConfig",
"position": {
"x": 99.73879703925843,
"y": -201.26482361861054
},
"version": "4811",
"inputs": [],
"outputs": []
}
],
"edges": [
{
"source": "pluginInput",
"target": "rKBYGQuYefae",
"sourceHandle": "pluginInput-source-right",
"targetHandle": "rKBYGQuYefae-target-left"
},
{
"source": "rKBYGQuYefae",
"target": "pluginOutput",
"sourceHandle": "rKBYGQuYefae-source-right",
"targetHandle": "pluginOutput-target-left"
}
],
"chatConfig": {
"welcomeText": "",
"variables": [],
"questionGuide": false,
"ttsConfig": {
"type": "web"
},
"whisperConfig": {
"open": false,
"autoSend": false,
"autoTTSResponse": false
},
"chatInputGuide": {
"open": false,
"textList": [],
"customUrl": ""
},
"instruction": "",
"autoExecute": {
"open": false,
"defaultPrompt": ""
},
"_id": "6710a5619c45325525326719"
}
}
}

View File

@@ -489,7 +489,9 @@
"chatConfig": {
"welcomeText": "",
"variables": [],
"questionGuide": false,
"questionGuide": {
"open": false
},
"ttsConfig": {
"type": "web"
},

View File

@@ -666,7 +666,9 @@
"chatConfig": {
"welcomeText": "",
"variables": [],
"questionGuide": false,
"questionGuide": {
"open": false
},
"ttsConfig": {
"type": "web"
},

Some files were not shown because too many files have changed in this diff Show More