Skip to content

Instantly share code, notes, and snippets.

@davila7
Last active December 15, 2022 19:56
Show Gist options
  • Select an option

  • Save davila7/f7649910566e85c8e707d7acbcd20f69 to your computer and use it in GitHub Desktop.

Select an option

Save davila7/f7649910566e85c8e707d7acbcd20f69 to your computer and use it in GitHub Desktop.
const zero_shot_text = 'Write a function in Javascript';
async function main() {
const completion = await openai.createCompletion({
model: "text-davinci-003",
prompt: zero_shot_text,
temperature: 0.3,
max_tokens: 100,
top_p: 1.0,
frequency_penalty: 0.5,
presence_penalty: 0.0,
stop: ["END", '.'],
});
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