Skip to content

Commit

Permalink
v4.6 -1 (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Nov 9, 2023
1 parent 661ee79 commit 8bb5588
Show file tree
Hide file tree
Showing 402 changed files with 9,944 additions and 6,012 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
[//]: # '方框内填 x 表示打钩'

- [ ] 我已确认目前没有类似 issue
- [ ] 我已完整查看过项目 README,以及[项目文档](https://doc.fastgpt.run/docs/intro/)
- [ ] 我已完整查看过项目 README,以及[项目文档](https://doc.fastgpt.in/docs/intro/)
- [ ] 我使用了自己的 key,并确认我的 key 是可正常使用的
- [ ] 我理解并愿意跟进此 issue,协助测试和提供反馈
- [x] 我理解并认可上述内容,并理解项目维护者精力有限,**不遵循规则的 issue 可能会被无视或直接关闭**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 微信交流群
url: https://doc.fastgpt.run/wechat-fastgpt.webp
url: https://doc.fastgpt.in/wechat-fastgpt.webp
about: FastGPT 全是问题群
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开
<a href="https://fastgpt.run/">
<img height="21" src="https://img.shields.io/badge/在线使用-d4eaf7?style=flat-square&logo=spoj&logoColor=7d09f1" alt="cloud">
</a>
<a href="https://doc.fastgpt.run/docs/intro">
<a href="https://doc.fastgpt.in/docs/intro">
<img height="21" src="https://img.shields.io/badge/相关文档-7d09f1?style=flat-square" alt="document">
</a>
<a href="https://doc.fastgpt.run/docs/development">
<a href="https://doc.fastgpt.in/docs/development">
<img height="21" src="https://img.shields.io/badge/本地开发-%23d4eaf7?style=flat-square&logo=xcode&logoColor=7d09f1" alt="development">
</a>
<a href="/#-%E7%9B%B8%E5%85%B3%E9%A1%B9%E7%9B%AE">
Expand Down Expand Up @@ -119,7 +119,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b

## 🤝 第三方生态

- [OnWeChat 个人微信/企微机器人](https://doc.fastgpt.run/docs/use-cases/onwechat/)
- [OnWeChat 个人微信/企微机器人](https://doc.fastgpt.in/docs/use-cases/onwechat/)

## 🌟 Star History

Expand All @@ -132,4 +132,4 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。
2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。
3. 完整请查看 [FastGPT Open Source License](./LICENSE)
4. 联系方式:[email protected][点击查看商业版定价策略](https://doc.fastgpt.run/docs/commercial)
4. 联系方式:[email protected][点击查看商业版定价策略](https://doc.fastgpt.in/docs/commercial)
94 changes: 59 additions & 35 deletions docSite/content/docs/development/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,91 +21,115 @@ weight: 520
```json
{
"SystemParams": {
"pluginBaseUrl": "", // 商业版接口地址
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
"pgHNSWEfSearch": 100 // pg vector 索引参数,越大精度高但速度慢
},
"ChatModels": [
{
"model": "gpt-3.5-turbo", // 实际调用的模型
"name": "GPT35-4k", // 展示的名字
"maxToken": 4000, // 最大token,均按 gpt35 计算
"quoteMaxToken": 2000, // 引用内容最大 token
"maxTemperature": 1.2, // 最大温度
"price": 0,
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"price": 0, // 除以 100000 后等于1个token的价格
"maxContext": 16000, // 最大上下文长度
"maxResponse": 4000, // 最大回复长度
"quoteMaxToken": 2000, // 最大引用内容长度
"maxTemperature": 1.2, // 最大温度值
"censor": false, // 是否开启敏感词过滤(商业版)
"defaultSystemChatPrompt": ""
},
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxToken": 16000,
"maxContext": 16000,
"maxResponse": 16000,
"price": 0,
"quoteMaxToken": 8000,
"maxTemperature": 1.2,
"price": 0,
"censor": false,
"defaultSystemChatPrompt": ""
},
{
"model": "gpt-4",
"name": "GPT4-8k",
"maxToken": 8000,
"maxContext": 8000,
"maxResponse": 8000,
"price": 0,
"quoteMaxToken": 4000,
"maxTemperature": 1.2,
"price": 0,
"censor": false,
"defaultSystemChatPrompt": ""
}
],
"QAModels": [ // QA 拆分模型
{
"QAModels": [
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxToken": 16000,
"maxContext": 16000,
"maxResponse": 16000,
"price": 0
}
],
"ExtractModels": [ // 内容提取模型
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxToken": 16000,
"price": 0,
"functionCall": true, // 是否支持 function call
"functionPrompt": "" // 自定义非 function call 提示词
}
],
"CQModels": [ // Classify Question: 问题分类模型
"CQModels": [
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxToken": 16000,
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 16000,
"maxResponse": 4000,
"price": 0,
"functionCall": true,
"functionPrompt": ""
},
{
"model": "gpt-4",
"name": "GPT4-8k",
"maxToken": 8000,
"maxContext": 8000,
"maxResponse": 8000,
"price": 0,
"functionCall": true,
"functionPrompt": ""
}
],
"ExtractModels": [
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 16000,
"maxResponse": 4000,
"price": 0,
"functionCall": true,
"functionPrompt": ""
}
],
"QGModels": [ // Question Generation: 生成下一步指引模型
{
"model": "gpt-3.5-turbo",
"name": "GPT35-4k",
"maxToken": 4000,
"QGModels": [
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 1600,
"maxResponse": 4000,
"price": 0
}
],
"VectorModels": [
{
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"price": 0,
"defaultToken": 500,
"price": 0.2,
"defaultToken": 700,
"maxToken": 3000
}
],
"AudioSpeechModels": [
{
"model": "tts-1",
"name": "OpenAI TTS1",
"price": 0
},
{
"model": "tts-1-hd",
"name": "OpenAI TTS1HD",
"price": 0
}
]
}
```
2 changes: 1 addition & 1 deletion docSite/content/docs/development/openApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ curl --location --request POST 'https://fastgpt.run/api/core/dataset/searchTest'
**请求示例**

```bash
curl --location --request POST 'https://fastgpt.run/api/common/bill/createTrainingBill' \
curl --location --request POST 'https://fastgpt.run/api/support/wallet/bill/createTrainingBill' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw ''
Expand Down
4 changes: 2 additions & 2 deletions docSite/content/docs/installation/one-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ CHAT_API_KEY=sk-xxxxxx
{
"model": "ERNIE-Bot", // 这里的模型需要对应 One API 的模型
"name": "文心一言", // 对外展示的名称
"maxToken": 4000, // 最大长下文 token,无论什么模型都按 GPT35 的计算。GPT 外的模型需要自行大致计算下这个值。可以调用官方接口去比对 Token 的倍率,然后在这里粗略计算。
"maxContext": 8000, // 最大长下文 token,无论什么模型都按 GPT35 的计算。GPT 外的模型需要自行大致计算下这个值。可以调用官方接口去比对 Token 的倍率,然后在这里粗略计算。
"maxResponse": 4000, // 最大回复 token
// 例如:文心一言的中英文 token 基本是 1:1,而 GPT 的中文 Token 是 2:1,如果文心一言官方最大 Token 是 4000,那么这里就可以填 8000,保险点就填 7000.
"price": 0, // 1个token 价格 => 1.5 / 100000 * 1000 = 0.015元/1k token
"quoteMaxToken": 2000, // 引用知识库的最大 Token
"maxTemperature": 1, // 最大温度
"defaultSystemChatPrompt": "" // 默认的系统提示词
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/installation/upgrading/447.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'V4.4.7'
title: 'V4.4.7(需执行升级脚本)'
description: 'FastGPT V4.4.7 更新(需执行升级脚本)'
icon: 'upgrade'
draft: false
Expand Down
45 changes: 45 additions & 0 deletions docSite/content/docs/installation/upgrading/46.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: 'V4.6(需要初始化)'
description: 'FastGPT V4.6 更新'
icon: 'upgrade'
draft: false
toc: true
weight: 837
---

未正式发布。

V4.6 版本加入了简单的团队功能,可以邀请其他用户进来管理资源。该版本升级后无法执行旧的升级脚本,且无法回退。

## 1. 更新镜像并变更配置文件

更新镜像至 latest 或者 v4.6 版本。商业版镜像更新至 V0.2.

最新配置可参考: [V46版本最新 config.json](/docs/development/configuration),商业镜像配置文件也更新,参考最新的飞书文档。


## 2. 执行初始化 API

发起 1 个 HTTP 请求({{rootkey}} 替换成环境变量里的`rootkey`,{{host}}替换成自己域名)

1. https://xxxxx/api/admin/initv46

```bash
curl --location --request POST 'https://{{host}}/api/admin/initv46' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```

初始化内容:
1. 创建默认团队
2. 初始化 Mongo 所有资源的团队字段
3. 初始化 Pg 的字段

**该初始化接口可能速度很慢,返回超时不用管,注意看日志即可**


## 功能介绍

### Fast GPT V4.6

1. 新增 - 团队空间
2 changes: 1 addition & 1 deletion docSite/content/docs/use-cases/kb.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ weight: 340
![手动录入知识库结果](/imgs/9.png)

导入结果如上图。可以看到,我们均采用的是问答对的格式,而不是粗略的直接导入。目的就是为了模拟用户问题,进一步的提高向量搜索的匹配效果。可以为同一个问题设置多种问法,效果更佳。
FastGPT 还提供了 openapi 功能,你可以在本地对特殊格式的文件进行处理后,再上传到 FastGPT,具体可以参考:[FastGPT Api Docs](https://doc.fastgpt.run/docs/development/openapi)
FastGPT 还提供了 openapi 功能,你可以在本地对特殊格式的文件进行处理后,再上传到 FastGPT,具体可以参考:[FastGPT Api Docs](https://doc.fastgpt.in/docs/development/openapi)

## 知识库微调和参数调整

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@
},
"devDependencies": {
"husky": "^8.0.3",
"i18next": "^22.5.1",
"lint-staged": "^13.2.1",
"next-i18next": "^13.3.0",
"prettier": "^3.0.3",
"i18next": "^22.5.1",
"react-i18next": "^12.3.1",
"next-i18next": "^13.3.0"
"zhlint": "^0.7.1"
},
"lint-staged": {
"./**/**/*.{ts,tsx,scss}": "npm run format-code",
"./**/**/*.md": "npm run format-doc"
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"openai": "4.16.1"
}
}
1 change: 0 additions & 1 deletion packages/global/common/bill/constants.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/global/common/bill/types/billReq.d.ts

This file was deleted.

28 changes: 28 additions & 0 deletions packages/global/common/error/code/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ErrType } from '../errorCode';

/* dataset: 502000 */
export enum AppErrEnum {
unExist = 'unExist',
unAuthApp = 'unAuthApp'
}
const appErrList = [
{
statusText: AppErrEnum.unExist,
message: '应用不存在'
},
{
statusText: AppErrEnum.unAuthApp,
message: '无权操作该应用'
}
];
export default appErrList.reduce((acc, cur, index) => {
return {
...acc,
[cur.statusText]: {
code: 502000 + index,
statusText: cur.statusText,
message: cur.message,
data: null
}
};
}, {} as ErrType<`${AppErrEnum}`>);
23 changes: 23 additions & 0 deletions packages/global/common/error/code/chat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ErrType } from '../errorCode';

/* dataset: 504000 */
export enum ChatErrEnum {
unAuthChat = 'unAuthChat'
}
const errList = [
{
statusText: ChatErrEnum.unAuthChat,
message: '无权操作该对话记录'
}
];
export default errList.reduce((acc, cur, index) => {
return {
...acc,
[cur.statusText]: {
code: 504000 + index,
statusText: cur.statusText,
message: cur.message,
data: null
}
};
}, {} as ErrType<`${ChatErrEnum}`>);
Loading

0 comments on commit 8bb5588

Please sign in to comment.