Skip to content

Instantly share code, notes, and snippets.

@sleebapaul
Last active July 19, 2022 12:03
Embed
What would you like to do?
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