Created
December 15, 2022 20:03
-
-
Save davila7/f62141782b39a594c193addbfeb09b57 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 one_shot_text = 'Bot: Ask me any question. '+ | |
| 'Me: Can I ask you something about programming?. '+ | |
| 'Bot: Yes, of course. Tell me your question and I will answer it. '+ | |
| 'Me: My question about Javascript is: Write a JavaScript function to apply Bubble Sort algorithm.'+ | |
| 'Bot:'; | |
| async function main() { | |
| const completion = await openai.createCompletion({ | |
| model: "text-davinci-003", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 250, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["Bot:", 'Me:'], | |
| }); | |
| console.log(completion.data.choices[0].text) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment