Hey team, any ideas if you can use https://www.npmjs.com/package/openai version 4 to interact with chatgpt v3.5?
I've tried an automatic migration from v3 npm module to v4 version npm exec openai migrate
here is my new code:
async createCompletionViaOpenAI(
messages: OpenAI.Chat.ChatCompletionMessageParam[]
) {
return await this.openai.chat.completions.create(
{
model: 'gpt-3.5-turbo',
messages: messages,
},
{
headers: {
'Content-Type': 'application/json',
'X-User-Agent': 'OpenAPI-Generator/1.0/Javascript',
},
}
);
}
const completion = await this.chatService.createCompletionViaOpenAI(
this.messages
);
console.log(completion); //returns null
the actual error that I am getting now completion is null
a bit more background, I am running the openai library in browser using angular v17, found that related issue https://github.com/openai/openai-node/issues/232
if roll back to v3, all works....