fearflixai / story.py
LittleLirow's picture
Update return story size
80b4d74
raw history blame
No virus
573 Bytes
import os
import openai
def text2story(text, auth):
openai.api_key = auth
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a psychedelic horror storywriter."},
{"role": "user", "content": f"Write a narrated story about {text} with a bad ending. It must have between 150 and 450 characters. It must have {text}."}
],
max_tokens=1000,
temperature=0.7)
return response["choices"][0]["message"]["content"]