~jheckt/audio-notes

0e00b15e6b42a2ba54a06d43ac6e56a23775b4f7 — turnipsoup 1 year, 7 months ago 7258996
added quick program to use gpt3 to listify text
1 files changed, 21 insertions(+), 0 deletions(-)

A listify.py
A listify.py => listify.py +21 -0
@@ 0,0 1,21 @@
#!/usr/bin/env python3
#

"""
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-002",
  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())
\ No newline at end of file