-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
105 changed files
with
1,088 additions
and
798 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
title: 'Web 站点同步' | ||
description: 'FastGPT Web 站点同步功能介绍和使用方式' | ||
icon: 'language' | ||
draft: false | ||
toc: true | ||
weight: 105 | ||
--- | ||
|
||
![](/imgs/webSync1.jpg) | ||
|
||
## 什么是 Web 站点同步 | ||
|
||
Web 站点同步利用爬虫的技术,可以通过一个入口网站,自动捕获`同域名`下的所有网站,目前最多支持`200`个子页面。出于合规与安全角度,FastGPT 仅支持`静态站点`的爬取,主要用于各个文档站点快速构建知识库。 | ||
|
||
Tips: 国内的媒体站点基本不可用,公众号、csdn、知乎等。可以通过终端发送`curl`请求检测是否为静态站点,例如: | ||
|
||
```bash | ||
curl ai.fastgpt.in | ||
``` | ||
|
||
## 如何使用 | ||
|
||
### 1. 新建知识库,选择 Web 站点同步 | ||
|
||
![](/imgs/webSync2.jpg) | ||
|
||
![](/imgs/webSync3.jpg) | ||
|
||
### 2. 点击配置站点信息 | ||
|
||
![](/imgs/webSync4.jpg) | ||
|
||
### 3. 填写网址和选择器 | ||
|
||
![](/imgs/webSync5.jpg) | ||
|
||
好了, 现在点击开始同步,静等系统自动抓取网站信息即可。 | ||
|
||
|
||
## 创建应用,绑定知识库 | ||
|
||
![](/imgs/webSync6.jpg) | ||
|
||
## 选择器如何使用 | ||
|
||
选择器是 HTML CSS JS 的产物,你可以通过选择器来定位到你需要抓取的具体内容,而不是整个站点。使用方式为: | ||
|
||
### 首先打开浏览器调试面板(通常是 F12,或者【右键 - 检查】) | ||
|
||
![](/imgs/webSync7.jpg) | ||
|
||
![](/imgs/webSync8.jpg) | ||
|
||
### 输入对应元素的选择器 | ||
|
||
[菜鸟教程 css 选择器](https://www.runoob.com/cssref/css-selectors.html),具体选择器的使用方式可以参考菜鸟教程。 | ||
|
||
上图中,我们选中了一个区域,对应的是`div`标签,它有 `data-prismjs-copy`, `data-prismjs-copy-success`, `data-prismjs-copy-error` 三个属性,这里我们用到一个就够。所以选择器是: | ||
**`div[data-prismjs-copy]`** | ||
|
||
除了属性选择器,常见的还有类和ID选择器。例如: | ||
|
||
![](/imgs/webSync9.jpg) | ||
|
||
上图 class 里的是类名(可能包含多个类名,都是空格隔开的,选择一个即可),选择器可以为:**`.docs-content`** | ||
|
||
### 多选择器使用 | ||
|
||
在开头的演示中,我们对 FastGPT 文档是使用了多选择器的方式来选择,通过逗号隔开了两个选择器。 | ||
|
||
![](/imgs/webSync10.jpg) | ||
|
||
我们希望选中上图两个标签中的内容,此时就需要两组选择器。一组是:`.docs-content .mb-0.d-flex`,含义是 `docs-content` 类下同时包含 `mb-0`和`d-flex` 两个类的子元素; | ||
|
||
另一组是`.docs-content div[data-prismjs-copy]`,含义是`docs-content` 类下包含`data-prismjs-copy`属性的`div`元素。 | ||
|
||
把两组选择器用逗号隔开即可:`.docs-content .mb-0.d-flex, .docs-content div[data-prismjs-copy]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: 'V4.6.4(需要初始化)' | ||
description: 'FastGPT V4.6.4' | ||
icon: 'upgrade' | ||
draft: false | ||
toc: true | ||
weight: 832 | ||
--- | ||
|
||
## 1。执行初始化 API | ||
|
||
发起 1 个 HTTP 请求 ({{rootkey}} 替换成环境变量里的 `rootkey`,{{host}} 替换成自己域名) | ||
|
||
1. https://xxxxx/api/admin/initv464 | ||
|
||
```bash | ||
curl --location --request POST 'https://{{host}}/api/admin/initv464' \ | ||
--header 'rootkey: {{rootkey}}' \ | ||
--header 'Content-Type: application/json' | ||
``` | ||
|
||
初始化说明: | ||
1. 初始化 PG 的createTime字段 | ||
2. 初始化 Mongo 中 chat 的 feedback 字段 | ||
|
||
|
||
## V4.6.4 功能介绍 | ||
|
||
1. 重写 - 分享链接身份逻辑,采用 localID 记录用户的ID。 | ||
2. 商业版新增 - 分享链接 SSO 方案,通过`身份鉴权`地址,仅需`3个接口`即可完全接入已有用户系统。具体参考[分享链接身份鉴权](/docs/development/openapi/share/) | ||
3. 调整 - 知识库搜索模块 topk 逻辑,采用 MaxToken 计算,兼容不同长度的文本块 | ||
4. 调整鉴权顺序,提高 apikey 的优先级,避免cookie抢占 apikey 的鉴权。 | ||
5. 链接读取支持多选择器。参考[Web 站点同步用法](/docs/course/webSync) | ||
6. 修复 - 分享链接图片上传鉴权问题 | ||
7. 修复 - Mongo 连接池未释放问题。 | ||
8. 修复 - Dataset Intro 无法更新 | ||
9. 修复 - md 代码块问题 | ||
10. 修复 - root 权限问题 | ||
11. 优化 docker file | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const HUMAN_ICON = `/icon/human.svg`; | ||
export const LOGO_ICON = `/icon/logo.svg`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type UpdateChatFeedbackProps = { | ||
chatId: string; | ||
chatItemId: string; | ||
shareId?: string; | ||
outLinkUid?: string; | ||
userBadFeedback?: string; | ||
userGoodFeedback?: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
export enum UserStatusEnum { | ||
active = 'active', | ||
forbidden = 'forbidden' | ||
} | ||
export const userStatusMap = { | ||
[UserStatusEnum.active]: { | ||
label: 'support.user.status.active' | ||
}, | ||
[UserStatusEnum.forbidden]: { | ||
label: 'support.user.status.forbidden' | ||
} | ||
}; | ||
|
||
export enum OAuthEnum { | ||
github = 'github', | ||
google = 'google' | ||
} | ||
|
||
export enum UserAuthTypeEnum { | ||
register = 'register', | ||
findPassword = 'findPassword' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ import type { Logger } from 'winston'; | |
|
||
declare global { | ||
var mongodb: Mongoose | undefined; | ||
var logger: Logger; | ||
} |
Oops, something went wrong.