fix: unstream response type
This commit is contained in:
@@ -169,7 +169,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
|||||||
model: model.chat.chatModel,
|
model: model.chat.chatModel,
|
||||||
usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 },
|
usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 },
|
||||||
choices: [
|
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,
|
model: model.chat.chatModel,
|
||||||
usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: tokens },
|
usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: tokens },
|
||||||
choices: [
|
choices: [
|
||||||
{ message: [{ role: 'assistant', content: answer }], finish_reason: 'stop', index: 0 }
|
{ message: { role: 'assistant', content: answer }, finish_reason: 'stop', index: 0 }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user