Created
December 4, 2022 23:18
-
-
Save davila7/9662f560a01f3d12b60c9b49bf4b53b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const { Configuration, OpenAIApi } = require("openai"); | |
| const configuration = new Configuration({ | |
| apiKey: process.env.OPENAI_API_KEY, | |
| }); | |
| const openai = new OpenAIApi(configuration); | |
| const response = await openai.createCompletion({ | |
| model: "code-davinci-002", | |
| prompt: "Can you print 'Hello World' in Javascript?", | |
| temperature: 0, | |
| max_tokens: 60, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["."], | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment