fix: choices empty

This commit is contained in:
archer
2023-06-19 11:30:26 +08:00
parent e95f83ec8e
commit 3b515c3c2d
2 changed files with 2 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ export const chatResponse = async ({
}
);
const responseText = stream ? '' : response.data.choices[0].message?.content || '';
const responseText = stream ? '' : response.data.choices?.[0].message?.content || '';
const totalTokens = stream ? 0 : response.data.usage?.total_tokens || 0;
return {