Skip to content

Commit

Permalink
V4.8.16 dev (#3431)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: a.e. <[email protected]>
Co-authored-by: Jiangween <[email protected]>
  • Loading branch information
4 people authored Dec 18, 2024
1 parent 82871be commit bd79e77
Show file tree
Hide file tree
Showing 154 changed files with 2,519 additions and 300 deletions.
Binary file added docSite/assets/imgs/dingtalk-bot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/dingtalk-bot-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-31.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-34.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-37.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-39.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-41.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/image-42.png
Binary file added docSite/assets/imgs/image-43.png
Binary file added docSite/assets/imgs/image-44.png
Binary file added docSite/assets/imgs/image-45.png
Binary file added docSite/assets/imgs/image-46.png
Binary file added docSite/assets/imgs/image-47.png
Binary file added docSite/assets/imgs/image-48.png
Binary file added docSite/assets/imgs/image-49.png
Binary file added docSite/assets/imgs/image-50.png
Binary file added docSite/assets/imgs/searxng_plugin_guide1.png
22 changes: 14 additions & 8 deletions docSite/content/zh-cn/docs/development/upgrading/4816.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ weight: 808

## 完整更新内容

1.
1. 新增 - SearXNG 搜索插件[点击查看教程](/docs/guide/plugins/searxng_plugin_guide/)
2. 新增 - 商业版支持 API 知识库和链接集合定时同步。
3. 新增 - 猜你想问支持选择模型和自定义提示词。
4. 新增 - 钉钉和企微机器人 webhook 插件。
5. 新增 - sandbox 新增 createHmac 加密全局方法。
6. 优化 - 工作流/简易模式变量初始化代码,去除监听初始化,避免因渲染顺序不一致导致的失败。
7. 修复 - 无法自动切换默认语言。增加分享链接,强制执行一次切换默认语言。
8. 修复 - 数组选择器自动兼容 4.8.13 以前的数据。
9. 修复 - 站点同步知识库,链接同步时未使用选择器。
10. 修复 - 简易模式转工作流,没有把系统配置项转化。
11. 修复 - 插件独立运行,变量初始值未赋上。
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. 修复 - 插件调试时,日志未保存插件输入参数。
9 changes: 9 additions & 0 deletions docSite/content/zh-cn/docs/guide/admin/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
weight: 490
title: '商业版后台'
description: '商业版后台使用教程'
icon: 'chat_bubble'
draft: false
images: []
---
<!-- 470 ~ 500 -->
44 changes: 44 additions & 0 deletions docSite/content/zh-cn/docs/guide/admin/sso_dingtalk.md
Original file line number Diff line number Diff line change
@@ -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)
59 changes: 59 additions & 0 deletions docSite/content/zh-cn/docs/guide/knowledge_base/lark_dataset.md
Original file line number Diff line number Diff line change
@@ -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)
42 changes: 42 additions & 0 deletions docSite/content/zh-cn/docs/guide/knowledge_base/yuque_dataset.md
Original file line number Diff line number Diff line change
@@ -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)
178 changes: 178 additions & 0 deletions docSite/content/zh-cn/docs/guide/plugins/searxng_plugin_guide.md
Original file line number Diff line number Diff line change
@@ -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 调用时不会返回结果。
Loading

0 comments on commit bd79e77

Please sign in to comment.