Skip to content

Commit

Permalink
Correctly access content
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecovington committed Jan 5, 2024
1 parent f1d5838 commit 4515c76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function getCompletion (prompt, model = 'gpt-3.5-turbo') {
temperature: 0 // This is the degree of randomness of the model's output
})

return response?.data?.choices?.[0]?.text
return response?.choices?.[0]?.message?.content
} catch (error) {
console.error('Error:', error)
return null
Expand Down

0 comments on commit 4515c76

Please sign in to comment.