This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
835 additions
and
143 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const axios = require("axios"); | ||
const FormData = require("form-data"); | ||
|
||
const OPENAI_API_KEY = "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"; | ||
|
||
const client = axios.create({ | ||
headers: { | ||
Authorization: "Bearer " + OPENAI_API_KEY, | ||
}, | ||
}); | ||
|
||
const params = { | ||
id: "cmpl-7BlVtrcMHjzfvlpPDw8O7yKYx8FLI", | ||
prompt: "How are you?", | ||
model: "text-davinci-003", | ||
max_tokens: 10, | ||
temperature: 0, | ||
}; | ||
|
||
const openai = axios.create({ | ||
headers: { | ||
Authorization: "Bearer " + OPENAI_API_KEY, | ||
}, | ||
}); | ||
|
||
async function createCompletions(params) { | ||
let aa = await openai | ||
.post("https://api.openai.com/v1/completions", params) | ||
.then((result) => { | ||
return result; | ||
}) | ||
.catch((err) => { | ||
return err; | ||
}); | ||
return aa; | ||
} | ||
|
||
async function aa() { | ||
let aaa = await createCompletions(params); | ||
console.log(aaa); | ||
} | ||
|
||
aa(); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.