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 } ] }); }