mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
perf: response store
This commit is contained in:
@@ -25,7 +25,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
// 删除一条数据库记录
|
||||
await Chat.updateOne(
|
||||
{
|
||||
_id: chatId,
|
||||
chatId,
|
||||
userId
|
||||
},
|
||||
{ $pull: { content: { _id: contentId } } }
|
||||
|
@@ -8,6 +8,7 @@ import { authApp } from '@/service/utils/auth';
|
||||
import mongoose from 'mongoose';
|
||||
import type { ChatSchema } from '@/types/mongoSchema';
|
||||
import { getSpecialModule } from '@/components/ChatBox';
|
||||
import { TaskResponseKeyEnum } from '@/constants/chat';
|
||||
|
||||
/* 初始化我的聊天框,需要身份验证 */
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
@@ -67,7 +68,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
$project: {
|
||||
_id: '$content._id',
|
||||
obj: '$content.obj',
|
||||
value: '$content.value'
|
||||
value: '$content.value',
|
||||
[TaskResponseKeyEnum.responseData]: `$content.${TaskResponseKeyEnum.responseData}`
|
||||
}
|
||||
}
|
||||
])
|
||||
|
@@ -46,7 +46,7 @@ export function gpt_chatItemTokenSlice({
|
||||
maxToken
|
||||
}: {
|
||||
messages: ChatItemType[];
|
||||
model?: ModelType;
|
||||
model?: string;
|
||||
maxToken: number;
|
||||
}) {
|
||||
let result: ChatItemType[] = [];
|
||||
|
@@ -68,7 +68,7 @@ export function setDefaultData() {
|
||||
model: 'gpt-3.5-turbo',
|
||||
name: 'FastAI-4k',
|
||||
contextMaxToken: 4000,
|
||||
systemMaxToken: 2400,
|
||||
quoteMaxToken: 2400,
|
||||
maxTemperature: 1.2,
|
||||
price: 1.5
|
||||
},
|
||||
@@ -76,7 +76,7 @@ export function setDefaultData() {
|
||||
model: 'gpt-3.5-turbo-16k',
|
||||
name: 'FastAI-16k',
|
||||
contextMaxToken: 16000,
|
||||
systemMaxToken: 8000,
|
||||
quoteMaxToken: 8000,
|
||||
maxTemperature: 1.2,
|
||||
price: 3
|
||||
},
|
||||
@@ -84,7 +84,7 @@ export function setDefaultData() {
|
||||
model: 'gpt-4',
|
||||
name: 'FastAI-Plus',
|
||||
contextMaxToken: 8000,
|
||||
systemMaxToken: 4000,
|
||||
quoteMaxToken: 4000,
|
||||
maxTemperature: 1.2,
|
||||
price: 45
|
||||
}
|
||||
|
Reference in New Issue
Block a user