Fellows,
I’m writing an app and want to use the gpt-3.5 model instead of the text-davinci since I want to build a kind of chatbot. Theoretically, I should just change the variable model in the following JS code:
let maxTokens = 256;
let model = 'text-davinci-003';
//let model = 'gpt-3.5-turbo-0301';
async generateText(prompt)
try {
const response = await this.openai.createCompletion({
model: model,
prompt: prompt,
max_tokens: maxTokens
});
return response.data.choices[0].text;
} catch (error) {
return '';
}
}
However, when I change its value, I get the following error:
{
"error": {
"message": "You didn’t provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you’re accessing the API from your browser and are prompted for a username and password. You can obtain an API key from OpenAI API",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
It makes no sense since the davinci option is working. I even created a new key and the error is exactly the same. Any idea what am I doing wrong? Thanks.