Skip to content

Instantly share code, notes, and snippets.

@justaguywhocodes
Created March 4, 2022 04:21
Show Gist options
  • Save justaguywhocodes/434bbe17803602309e8a41dd6d9bf0fd to your computer and use it in GitHub Desktop.
Save justaguywhocodes/434bbe17803602309e8a41dd6d9bf0fd to your computer and use it in GitHub Desktop.
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("text-davinci-001", {
prompt: "Product description: A home milkshake maker\nSeed words: fast, healthy, compact.\nProduct names: HomeShaker, Fit Shaker, QuickShake, Shake Maker\n\nProduct description: A pair of shoes that can fit any foot size.\nSeed words: adaptable, fit, omni-fit.",
temperature: 0.8,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.0,
presence_penalty: 0.0,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment