perf: model framwork

This commit is contained in:
archer
2023-04-29 15:55:47 +08:00
parent cd9acab938
commit 78762498eb
30 changed files with 649 additions and 757 deletions

View File

@@ -1,5 +1,5 @@
import { Schema, model, models, Model } from 'mongoose';
import { modelList } from '@/constants/model';
import { ChatModelMap } from '@/constants/model';
import { BillSchema as BillType } from '@/types/mongoSchema';
import { BillTypeMap } from '@/constants/user';
@@ -16,7 +16,7 @@ const BillSchema = new Schema({
},
modelName: {
type: String,
enum: [...modelList.map((item) => item.model), 'text-embedding-ada-002'],
enum: [...Object.keys(ChatModelMap), 'text-embedding-ada-002'],
required: true
},
chatId: {