Fix: pdf version (#853)

* doc

* perf: mongo index

* perf: chat item index

* fix: packages
This commit is contained in:
Archer
2024-02-16 12:19:05 +08:00
committed by GitHub
parent 91bcf8c53e
commit bf7ee919b6
14 changed files with 471 additions and 430 deletions

View File

@@ -57,7 +57,7 @@ Sealos 的服务器在国外,不需要额外处理网络问题,无需服务
### 简介
FastGPT 商业版共包含了3个应用fastgpt, fastgpt-plus, fastgpt-admin和2个数据库使用多 Api Key 时候需要安装 OneAPI一个应用和一个数据库总计4个应用和3个数据库。
FastGPT 商业版共包含了2个应用fastgpt, fastgpt-plus和2个数据库使用多 Api Key 时候需要安装 OneAPI一个应用和一个数据库总计3个应用和3个数据库。
![](/imgs/onSealos1.png)
@@ -122,10 +122,7 @@ SYSTEM_FAVICON 可以是一个网络地址
![](/imgs/onsealos8.png)
### 管理后台
![](/imgs/onsealos9.png)
### 管理后台(已合并到plus)
### 商业版镜像配置文件

View File

@@ -90,11 +90,8 @@ try {
close custom feedback;
*/
ChatItemSchema.index({ appId: 1, chatId: 1, dataId: 1 }, { background: true });
// admin charts
ChatItemSchema.index({ time: -1, obj: 1 }, { background: true });
ChatItemSchema.index({ userGoodFeedback: 1 }, { background: true });
ChatItemSchema.index({ userBadFeedback: 1 }, { background: true });
ChatItemSchema.index({ customFeedbacks: 1 }, { background: true });
ChatItemSchema.index({ adminFeedback: 1 }, { background: true });
} catch (error) {
console.log(error);
}

View File

@@ -76,13 +76,13 @@ try {
ChatSchema.index({ chatId: 1 }, { background: true });
// get user history
ChatSchema.index({ tmbId: 1, appId: 1, top: -1, updateTime: -1 }, { background: true });
// delete by appid; clear history; init chat; update chat; auth chat;
// delete by appid; clear history; init chat; update chat; auth chat; get chat;
ChatSchema.index({ appId: 1, chatId: 1 }, { background: true });
// get chat logs;
ChatSchema.index({ teamId: 1, appId: 1, updateTime: -1 }, { background: true });
// get share chat history
ChatSchema.index({ shareId: 1, outLinkUid: 1 }, { background: true });
ChatSchema.index({ shareId: 1, outLinkUid: 1, updateTime: -1, source: 1 }, { background: true });
} catch (error) {
console.log(error);
}

View File

@@ -43,6 +43,7 @@ export const addCustomFeedbacks = async ({
try {
await MongoChatItem.findOneAndUpdate(
{
appId,
chatId,
dataId: chatItemId
},

View File

@@ -105,8 +105,7 @@ try {
// lock training data; delete training data
TrainingDataSchema.index({ teamId: 1, collectionId: 1 });
// get training data and sort
TrainingDataSchema.index({ weight: -1 });
TrainingDataSchema.index({ lockTime: 1 });
TrainingDataSchema.index({ lockTime: 1, mode: 1, weight: -1 });
TrainingDataSchema.index({ expireAt: 1 }, { expireAfterSeconds: 7 * 24 * 60 * 60 }); // 7 days
} catch (error) {
console.log(error);

View File

@@ -43,7 +43,8 @@ const TeamMemberSchema = new Schema({
});
try {
TeamMemberSchema.index({ teamId: 1 });
TeamMemberSchema.index({ teamId: 1 }, { background: true });
TeamMemberSchema.index({ userId: 1 }, { background: true });
} catch (error) {
console.log(error);
}

View File

@@ -40,7 +40,8 @@ const TeamSchema = new Schema({
});
try {
// TeamSchema.index({ createTime: -1 });
TeamSchema.index({ name: 1 });
TeamSchema.index({ ownerId: 1 });
} catch (error) {
console.log(error);
}

View File

@@ -17,7 +17,7 @@
"i18next": "^22.5.1",
"joplin-turndown-plugin-gfm": "^1.0.12",
"next-i18next": "^13.3.0",
"pdfjs-dist": "^4.0.269",
"pdfjs-dist": "4.0.269",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "^12.3.1",

856
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,6 @@ import { authApp } from '@fastgpt/service/support/permission/auth/app';
import { MongoChatItem } from '@fastgpt/service/core/chat/chatItemSchema';
import { mongoSessionRun } from '@fastgpt/service/common/mongo/sessionRun';
/* 获取我的模型 */
export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
try {
await connectToDatabase();

View File

@@ -27,8 +27,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const { tmbId } = await authCert({ req, authToken: true });
return {
appId,
tmbId,
appId,
source: ChatSourceEnum.online
};
}

View File

@@ -36,8 +36,8 @@ export async function generateQA(): Promise<any> {
try {
const data = await MongoDatasetTraining.findOneAndUpdate(
{
mode: TrainingModeEnum.qa,
lockTime: { $lte: new Date(Date.now() - 6 * 60 * 1000) }
lockTime: { $lte: new Date(Date.now() - 6 * 60 * 1000) },
mode: TrainingModeEnum.qa
},
{
lockTime: new Date()

View File

@@ -32,8 +32,8 @@ export async function generateVector(): Promise<any> {
try {
const data = await MongoDatasetTraining.findOneAndUpdate(
{
mode: TrainingModeEnum.chunk,
lockTime: { $lte: new Date(Date.now() - 1 * 60 * 1000) }
lockTime: { $lte: new Date(Date.now() - 1 * 60 * 1000) },
mode: TrainingModeEnum.chunk
},
{
lockTime: new Date()

View File

@@ -36,10 +36,8 @@ export async function saveChat({
try {
const chat = await MongoChat.findOne(
{
chatId,
teamId,
tmbId,
appId
appId,
chatId
},
'_id metadata'
);