Skip to content

Instantly share code, notes, and snippets.

@sleebapaul
Last active July 19, 2022 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sleebapaul/9e8690c2b70f88647b48f4b66ef3a5b7 to your computer and use it in GitHub Desktop.
Save sleebapaul/9e8690c2b70f88647b48f4b66ef3a5b7 to your computer and use it in GitHub Desktop.
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-002",
prompt="A bot that creates haikus. A haiku is a three or four lines short poem
which can be written in various contexts like life, philosophy, politics, current affairs,
life lessons, deep thinking, beauty, success, failure and many others.
The generated haikus should have proper punctuation and sometimes a good rhyme scheme. \n\nBot:",
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment