mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
feat: 修改chat的数据结构
This commit is contained in:
75
src/types/mongoSchema.d.ts
vendored
Normal file
75
src/types/mongoSchema.d.ts
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import type { ChatItemType } from './chat';
|
||||
import { ModelStatusEnum, TrainingStatusEnum, ChatModelNameEnum } from '@/constants/model';
|
||||
|
||||
export type ServiceName = 'openai';
|
||||
|
||||
export interface UserModelSchema {
|
||||
_id: string;
|
||||
email: string;
|
||||
password: string;
|
||||
balance: number;
|
||||
accounts: { type: 'openai'; value: string }[];
|
||||
createTime: number;
|
||||
}
|
||||
|
||||
export interface AuthCodeSchema {
|
||||
_id: string;
|
||||
email: string;
|
||||
code: string;
|
||||
type: 'register' | 'findPassword';
|
||||
expiredTime: number;
|
||||
}
|
||||
|
||||
export interface ModelSchema {
|
||||
_id: string;
|
||||
name: string;
|
||||
avatar: string;
|
||||
systemPrompt: string;
|
||||
userId: string;
|
||||
status: `${ModelStatusEnum}`;
|
||||
updateTime: number;
|
||||
trainingTimes: number;
|
||||
service: {
|
||||
company: ServiceName;
|
||||
trainId: string;
|
||||
chatModel: `${ChatModelNameEnum}`;
|
||||
modelName: string;
|
||||
};
|
||||
security: {
|
||||
domain: string[];
|
||||
contextMaxLen: number;
|
||||
contentMaxLen: number;
|
||||
expiredTime: number;
|
||||
maxLoadAmount: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ModelPopulate extends ModelSchema {
|
||||
userId: UserModelSchema;
|
||||
}
|
||||
|
||||
export interface TrainingSchema {
|
||||
_id: string;
|
||||
serviceName: ServiceName;
|
||||
tuneId: string;
|
||||
modelId: string;
|
||||
status: `${TrainingStatusEnum}`;
|
||||
}
|
||||
|
||||
export interface TrainingPopulate extends TrainingSchema {
|
||||
modelId: ModelSchema;
|
||||
}
|
||||
|
||||
export interface ChatSchema {
|
||||
_id: string;
|
||||
userId: string;
|
||||
modelId: string;
|
||||
expiredTime: number;
|
||||
loadAmount: number;
|
||||
updateTime: number;
|
||||
content: ChatItemType[];
|
||||
}
|
||||
export interface ChatPopulate extends ChatSchema {
|
||||
userId: UserModelSchema;
|
||||
modelId: ModelSchema;
|
||||
}
|
Reference in New Issue
Block a user