perf: chat framwork

This commit is contained in:
archer
2023-05-03 15:28:25 +08:00
parent 91decc3683
commit 00a99261ae
23 changed files with 811 additions and 1011 deletions

View File

@@ -1,5 +1,6 @@
import { Schema, model, models, Model } from 'mongoose';
import { ChatSchema as ChatType } from '@/types/mongoSchema';
import { ChatRoleMap } from '@/constants/chat';
const ChatSchema = new Schema({
userId: {
@@ -36,7 +37,7 @@ const ChatSchema = new Schema({
obj: {
type: String,
required: true,
enum: ['Human', 'AI', 'SYSTEM']
enum: Object.keys(ChatRoleMap)
},
value: {
type: String,