perf: bill framwork
This commit is contained in:
7
src/types/mongoSchema.d.ts
vendored
7
src/types/mongoSchema.d.ts
vendored
@@ -3,9 +3,11 @@ import {
|
||||
ModelStatusEnum,
|
||||
ModelNameEnum,
|
||||
ModelVectorSearchModeEnum,
|
||||
ChatModelType
|
||||
ChatModelType,
|
||||
EmbeddingModelType
|
||||
} from '@/constants/model';
|
||||
import type { DataType } from './data';
|
||||
import { BillTypeEnum } from '@/constants/user';
|
||||
|
||||
export interface UserModelSchema {
|
||||
_id: string;
|
||||
@@ -89,7 +91,8 @@ export interface ChatPopulate extends ChatSchema {
|
||||
export interface BillSchema {
|
||||
_id: string;
|
||||
userId: string;
|
||||
type: 'chat' | 'splitData' | 'return';
|
||||
type: `${BillTypeEnum}`;
|
||||
modelName: ChatModelType | EmbeddingModelType;
|
||||
chatId: string;
|
||||
time: Date;
|
||||
textLen: number;
|
||||
|
||||
8
src/types/user.d.ts
vendored
8
src/types/user.d.ts
vendored
@@ -1,3 +1,4 @@
|
||||
import type { BillSchema } from './mongoSchema';
|
||||
export interface UserType {
|
||||
_id: string;
|
||||
username: string;
|
||||
@@ -17,11 +18,10 @@ export interface UserUpdateParams {
|
||||
|
||||
export interface UserBillType {
|
||||
id: string;
|
||||
time: string;
|
||||
type: 'chat' | 'splitData' | 'return';
|
||||
time: Date;
|
||||
modelName: BillSchema['modelName'];
|
||||
type: BillSchema['type'];
|
||||
textLen: number;
|
||||
tokenLen: number;
|
||||
userId: string;
|
||||
chatId: string;
|
||||
price: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user