From 4515c76b273327526376647fa8c865c29c284fd8 Mon Sep 17 00:00:00 2001 From: Jerome Covington Date: Fri, 5 Jan 2024 14:09:49 -0500 Subject: [PATCH] Correctly access content --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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