When using createCompletion I get a response but it doesn't have the actual text response. In textPayload it has "text: 'package com.example.demo.controller;',"
Below is my code
const openai = new OpenAIApi(configuration);
async function step1() {
currentResponse = await openai.createCompletion({
model: "text-davinci-003",
prompt: currentMessage,
temperature: 0,
max_tokens: 2292,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
stop: ["\n\n"],
});
} //end step1
return step1().then(function(response) {
var currentResponseNew = currentResponse.data
//this is where I get the text payload value
console.log(currentResponseNew)
res.send("done")
})