Last active
December 2, 2022 06:09
-
-
Save turnipsoup/604dfd2bfe3d969b578b271384a37fa9 to your computer and use it in GitHub Desktop.
Take an input text file and have GPT-3 return a numbered list of action items
This file contains 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
""" | |
Takes the passed text file and sends it to OpenAI GPT-3 to turn it into a To-Do list. | |
""" | |
import os, sys, openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
text = open(sys.argv[1], "r").read().strip() | |
res = openai.Completion.create( | |
model="text-davinci-003", | |
prompt=f"extract action items from the following and create a numbered list: {text}\n-----", | |
max_tokens=256, | |
temperature=0.1 | |
) | |
print(res.choices[0].text.strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment