Skip to content

Commit 30a6cc1

Browse files
committed
fix chat_completion error
1 parent 2acf734 commit 30a6cc1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: src/api/generate.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ export const chat_completion = async (
5858
}
5959
) => {
6060
const completion = await openai.chat.completions.create(config)
61-
const result = completion.choices[0]?.message
62-
return { 'question': question, answer: result }
61+
return { 'question': question, answer: completion.choices[0]?.message.content }
6362
}
6463

6564
export const stream_completion = async (

0 commit comments

Comments
 (0)