我收到错误:
const openai = new OpenAIApi({ key: apiKey });
^
TypeError: OpenAIApi is not a constructor
Run Code Online (Sandbox Code Playgroud)
当我尝试使用nodejs(v16.7.0)创建openai api时。我已按照文档中的代码安装了 openai api (v4.3.1)
我使用的代码:
const { OpenAIApi } = require('openai');
const openai = new OpenAIApi({ key: apiKey });
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?