This commit is contained in:
Archer
2023-11-09 09:46:57 +08:00
committed by GitHub
parent 661ee79943
commit 8bb5588305
402 changed files with 9899 additions and 5967 deletions

View File

@@ -1,3 +1,5 @@
export const PgDatasetTableName = 'modeldata';
export enum DatasetTypeEnum {
folder = 'folder',
dataset = 'dataset'

View File

@@ -1,20 +1,26 @@
import { PermissionTypeEnum } from '../../support/permission/constant';
import { DatasetCollectionTypeEnum, DatasetTypeEnum, TrainingModeEnum } from './constant';
export type DatasetSchemaType = {
_id: string;
userId: string;
parentId: string;
userId: string;
teamId: string;
tmbId: string;
updateTime: Date;
avatar: string;
name: string;
vectorModel: string;
tags: string[];
type: `${DatasetTypeEnum}`;
permission: `${PermissionTypeEnum}`;
};
export type DatasetCollectionSchemaType = {
_id: string;
userId: string;
teamId: string;
tmbId: string;
datasetId: string;
parentId?: string;
name: string;
@@ -30,6 +36,8 @@ export type DatasetCollectionSchemaType = {
export type DatasetTrainingSchemaType = {
_id: string;
userId: string;
teamId: string;
tmbId: string;
datasetId: string;
datasetCollectionId: string;
billId: string;
@@ -42,17 +50,35 @@ export type DatasetTrainingSchemaType = {
a: string;
};
export type CollectionWithDatasetType = Omit<DatasetCollectionSchemaType, 'datasetId'> & {
datasetId: DatasetSchemaType;
};
/* ================= dataset ===================== */
/* ================= collection ===================== */
export type DatasetCollectionItemType = DatasetCollectionSchemaType & {
canWrite: boolean;
};
/* ================= data ===================== */
export type PgRawDataItemType = {
id: string;
q: string;
a: string;
team_id: string;
tmb_id: string;
dataset_id: string;
collection_id: string;
};
export type PgDataItemType = {
id: string;
q: string;
a: string;
dataset_id: string;
collection_id: string;
teamId: string;
tmbId: string;
datasetId: string;
collectionId: string;
};
export type DatasetChunkItemType = {
q: string;
@@ -66,8 +92,24 @@ export type DatasetDataItemType = DatasetChunkItemType & {
sourceId?: string;
};
/* --------------- file ---------------------- */
export type DatasetFileSchema = {
_id: string;
length: number;
chunkSize: number;
uploadDate: Date;
filename: string;
contentType: string;
metadata: {
contentType: string;
datasetId: string;
teamId: string;
tmbId: string;
};
};
/* ============= search =============== */
export type SearchDataResultItemType = PgDataItemType & {
export type SearchDataResultItemType = PgRawDataItemType & {
score: number;
};
export type SearchDataResponseItemType = DatasetDataItemType & {