From 8ed77ea3f9fbddaee7dcd0202e89448fbe740ffe Mon Sep 17 00:00:00 2001 From: Artemy Date: Mon, 11 Sep 2023 10:53:21 +0300 Subject: [PATCH] Update openai.js --- src/components/openai.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/openai.js b/src/components/openai.js index 4366455..554ad94 100644 --- a/src/components/openai.js +++ b/src/components/openai.js @@ -15,16 +15,17 @@ along with this program. If not, see . */ -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",