Change embedding (#1463)

* rebuild embedding queue

* dataset menu

* feat: rebuild data api

* feat: ui change embedding model

* dataset ui

* feat: rebuild index ui

* rename collection
This commit is contained in:
Archer
2024-05-13 14:51:42 +08:00
committed by GitHub
parent 59fd94384d
commit 80a84a5733
37 changed files with 1260 additions and 419 deletions

View File

@@ -2,7 +2,7 @@ import { connectionMongo, type Model } from '../../mongo';
const { Schema, model, models } = connectionMongo;
import { RawTextBufferSchemaType } from './type';
export const collectionName = 'buffer.rawText';
export const collectionName = 'buffer_rawtexts';
const RawTextBufferSchema = new Schema({
sourceId: {

View File

@@ -2,7 +2,7 @@ import { connectionMongo, type Model } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo;
import { TTSBufferSchemaType } from './type.d';
export const collectionName = 'buffer.tts';
export const collectionName = 'buffer_tts';
const TTSBufferSchema = new Schema({
bufferId: {

View File

@@ -12,8 +12,6 @@ export const mongoSessionRun = async <T = unknown>(fn: (session: ClientSession)
return result as T;
} catch (error) {
console.log(error);
await session.abortTransaction();
await session.endSession();
return Promise.reject(error);

View File

@@ -98,12 +98,15 @@ export const deleteDatasetDataVector = async (
return `${teamIdWhere} ${datasetIdWhere}`;
}
if ('idList' in props && props.idList) {
if ('idList' in props && Array.isArray(props.idList)) {
if (props.idList.length === 0) return;
return `${teamIdWhere} id IN (${props.idList.map((id) => `'${String(id)}'`).join(',')})`;
}
return Promise.reject('deleteDatasetData: no where');
})();
if (!where) return;
try {
await PgClient.delete(PgDatasetTableName, {
where: [where]