perf: response tag;feat: history quote

This commit is contained in:
archer
2023-08-15 09:55:00 +08:00
parent b8a65e1742
commit cc57a7e27e
9 changed files with 39 additions and 32 deletions

View File

@@ -5,6 +5,7 @@ import { authUser } from '@/service/utils/auth';
import { connectToDatabase, Chat } from '@/service/mongo';
import { Types } from 'mongoose';
import type { ChatItemType } from '@/types/chat';
import { TaskResponseKeyEnum } from '@/constants/chat';
export type Props = {
chatId?: string;
@@ -55,10 +56,12 @@ export async function getChatHistory({
{
$project: {
obj: '$content.obj',
value: '$content.value'
value: '$content.value',
[TaskResponseKeyEnum.responseData]: `$content.responseData`
}
}
]);
console.log(history);
return { history };
}