doc gpt V0.2

This commit is contained in:
archer
2023-02-19 14:35:25 +08:00
parent cc5cf99e7a
commit 0ecf576e4e
124 changed files with 11780 additions and 573 deletions

16
src/types/chat.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
import type { ModelType } from './model';
export interface ChatSiteType {
name: string;
avatar: string;
modelId: string;
chatModel: string;
secret: ModelType.security;
}
export type ChatItemType = {
obj: 'Human' | 'AI' | 'SYSTEM';
value: string;
};
export type ChatSiteItemType = {
status: 'loading' | 'finish';
} & ChatItemType;

40
src/types/model.d.ts vendored Normal file
View File

@@ -0,0 +1,40 @@
import { ModelStatusEnum } from '@/constants/model';
export interface ModelType {
_id: string;
userId: string;
name: string;
avatar: string;
status: `${ModelStatusEnum}`;
updateTime: Date;
trainingTimes: number;
systemPrompt: string;
service: {
company: 'openai'; // 关联的厂商
trainId: string; // 训练时需要的ID
chatModel: string; // 聊天时用的模型
modelName: string; // 关联的模型
};
security: {
domain: string[];
contentMaxLen: number;
contextMaxLen: number;
expiredTime: number;
maxLoadAmount: number;
};
}
export interface ModelUpdateParams {
name: string;
systemPrompt: string;
service: {
company: 'openai'; // 关联的厂商
modelName: string; // 关联的模型
};
security: {
domain: string[];
contentMaxLen: number;
contextMaxLen: number;
expiredTime: number;
maxLoadAmount: number;
};
}

9
src/types/training.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
import { TrainingStatusEnum } from '@/constants/model';
export type TrainingItemType = {
_id: string;
serviceName: string;
tuneId: string;
modelId: string;
status: `${TrainingStatusEnum}`;
};

21
src/types/user.d.ts vendored Normal file
View File

@@ -0,0 +1,21 @@
export enum UserNumberEnum {
phone = 'phone',
wx = 'wx'
}
export interface UserType {
_id: string;
email: string;
accounts: {
type: string;
value: string;
}[];
balance: number;
}
export interface UserUpdateParams {
accounts?: {
type: string;
value: string;
}[];
}