From 65cab349b07e250215f561e97ed11df5d00ff402 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Thu, 29 Jun 2023 16:07:24 +0800 Subject: [PATCH] fix: unstream response type --- client/src/pages/api/openapi/v1/chat/completions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/pages/api/openapi/v1/chat/completions.ts b/client/src/pages/api/openapi/v1/chat/completions.ts index 6a480af46..11929e6aa 100644 --- a/client/src/pages/api/openapi/v1/chat/completions.ts +++ b/client/src/pages/api/openapi/v1/chat/completions.ts @@ -169,7 +169,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex model: model.chat.chatModel, usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 }, choices: [ - { message: [{ role: 'assistant', content: response }], finish_reason: 'stop', index: 0 } + { message: { role: 'assistant', content: response }, finish_reason: 'stop', index: 0 } ] }); } @@ -298,7 +298,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex model: model.chat.chatModel, usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: tokens }, choices: [ - { message: [{ role: 'assistant', content: answer }], finish_reason: 'stop', index: 0 } + { message: { role: 'assistant', content: answer }, finish_reason: 'stop', index: 0 } ] }); }