feat: qa生成

This commit is contained in:
archer
2023-03-24 01:19:38 +08:00
parent 8b72dca533
commit d8290f0809
15 changed files with 321 additions and 121 deletions

View File

@@ -9,7 +9,7 @@ import { jsonRes } from '@/service/response';
import type { ModelSchema } from '@/types/mongoSchema';
import { PassThrough } from 'stream';
import { ModelList } from '@/constants/model';
import { pushBill } from '@/service/events/bill';
import { pushBill } from '@/service/events/pushChatBill';
/* 发送提示词 */
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
@@ -98,7 +98,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}
);
console.log('api response time:', `time: ${(Date.now() - startTime) / 1000}s`);
console.log('api response time:', `${(Date.now() - startTime) / 1000}s`);
// 创建响应流
res.setHeader('Content-Type', 'text/event-stream;charset-utf-8');

View File

@@ -6,7 +6,7 @@ import { getOpenAIApi, authChat } from '@/service/utils/chat';
import { ChatItemType } from '@/types/chat';
import { httpsAgent } from '@/service/utils/tools';
import { ModelList } from '@/constants/model';
import { pushBill } from '@/service/events/bill';
import { pushBill } from '@/service/events/pushChatBill';
/* 发送提示词 */
export default async function handler(req: NextApiRequest, res: NextApiResponse) {