mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-12-03 17:06:22 +03:00
Update openai.js
This commit is contained in:
parent
2ae13e6079
commit
8ed77ea3f9
1 changed files with 3 additions and 2 deletions
|
@ -15,16 +15,17 @@
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Configuration, OpenAIApi } from "openai";
|
||||
import OpenAi from "openai";
|
||||
|
||||
async function Complete(text) {
|
||||
document.body.style.cursor = "wait";
|
||||
|
||||
let initText = text;
|
||||
|
||||
const configuration = new Configuration({
|
||||
const configuration = new OpenAi({
|
||||
apiKey: settings.openAiKey,
|
||||
});
|
||||
|
||||
const openai = new OpenAIApi(configuration);
|
||||
const response = await openai.createCompletion({
|
||||
model: "text-davinci-003",
|
||||
|
|
Loading…
Add table
Reference in a new issue