mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-12-04 09:16:21 +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/>.
|
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) {
|
async function Complete(text) {
|
||||||
document.body.style.cursor = "wait";
|
document.body.style.cursor = "wait";
|
||||||
|
|
||||||
let initText = text;
|
let initText = text;
|
||||||
|
|
||||||
const configuration = new Configuration({
|
const configuration = new OpenAi({
|
||||||
apiKey: settings.openAiKey,
|
apiKey: settings.openAiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
const openai = new OpenAIApi(configuration);
|
const openai = new OpenAIApi(configuration);
|
||||||
const response = await openai.createCompletion({
|
const response = await openai.createCompletion({
|
||||||
model: "text-davinci-003",
|
model: "text-davinci-003",
|
||||||
|
|
Loading…
Add table
Reference in a new issue