feat: kb crud
This commit is contained in:
9
src/types/model.d.ts
vendored
9
src/types/model.d.ts
vendored
@@ -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;
|
||||
|
||||
21
src/types/mongoSchema.d.ts
vendored
21
src/types/mongoSchema.d.ts
vendored
@@ -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
3
src/types/pg.d.ts
vendored
@@ -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
15
src/types/plugin.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user