diff --git a/lib/utils.js b/lib/utils.js index 7188ecb..91be599 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -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