feat: pg vector 0.8.0;perf: app pdf enhance parse (#3962)

* perf: app pdf enhance parse

* feat: pg vector 0.8.0

* update schema default

* model sort and default image

* perf: i18n

* perf: ui tip
This commit is contained in:
Archer
2025-03-04 13:43:50 +08:00
committed by archer
parent adf5377ebe
commit 54eb5c0547
33 changed files with 181 additions and 66 deletions

View File

@@ -5,6 +5,8 @@ import { MongoDatasetCollection } from '@fastgpt/service/core/dataset/collection
import { DatasetCollectionDataProcessModeEnum } from '@fastgpt/global/core/dataset/constants';
import { MongoDatasetData } from '@fastgpt/service/core/dataset/data/schema';
import { DatasetDataIndexTypeEnum } from '@fastgpt/global/core/dataset/data/constants';
import { PgClient } from '@fastgpt/service/common/vectorStore/pg';
import { PG_ADDRESS } from '@fastgpt/service/common/vectorStore/constants';
// 所有 trainingType=auto 的 collection都改成 trainingType=chunk
const updateCollections = async () => {
@@ -48,10 +50,19 @@ const updateData = async () => {
}
]);
};
const upgradePgVector = async () => {
if (!PG_ADDRESS) return;
await PgClient.query(`
ALTER EXTENSION vector UPDATE;
`);
};
async function handler(req: NextApiRequest, _res: NextApiResponse) {
await authCert({ req, authRoot: true });
console.log('升级 PG vector 插件');
await upgradePgVector();
console.log('变更所有 collection 的 trainingType 为 chunk');
await updateCollections();