feat: kb crud

This commit is contained in:
archer
2023-05-17 19:30:43 +08:00
parent 021add2af4
commit a79429fdcd
57 changed files with 1186 additions and 788 deletions

View File

@@ -16,15 +16,6 @@ export interface ModelUpdateParams {
security: ModelSchema['security'];
}
export interface ModelDataItemType {
id: string;
status: 'waiting' | 'ready';
q: string; // 提问词
a: string; // 原文
modelId: string;
userId: string;
}
export interface ShareModelItem {
_id: string;
avatar: string;

View File

@@ -69,19 +69,11 @@ export interface CollectionSchema {
}
export type ModelDataType = 0 | 1;
export interface ModelDataSchema {
_id: string;
modelId: string;
userId: string;
a: string;
q: string;
status: ModelDataType;
}
export interface ModelSplitDataSchema {
export interface SplitDataSchema {
_id: string;
userId: string;
modelId: string;
kbId: string;
prompt: string;
errorText: string;
textList: string[];
@@ -148,3 +140,12 @@ export interface ShareChatSchema {
maxContext: number;
lastTime: Date;
}
export interface kbSchema {
_id: string;
userId: string;
updateTime: Date;
avatar: string;
name: string;
tags: string[];
}

3
src/types/pg.d.ts vendored
View File

@@ -1,10 +1,11 @@
import { ModelDataStatusEnum } from '@/constants/model';
export interface PgModelDataItemType {
export interface PgKBDataItemType {
id: string;
q: string;
a: string;
status: `${ModelDataStatusEnum}`;
model_id: string;
user_id: string;
kb_id: string;
}

15
src/types/plugin.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
import type { kbSchema } from './mongoSchema';
/* kb type */
export interface KbItemType extends kbSchema {
totalData: number;
tags: string;
}
export interface KbDataItemType {
id: string;
status: 'waiting' | 'ready';
q: string; // 提问词
a: string; // 原文
kbId: string;
userId: string;
}