AI Generated Stories
These are terrible, AI isn't a great author.
This blog has sort of become a personal pet project instead of a professional pet product. It's probably obvious by now that a lot of the content here doesn't exactly seem all that human. That is part of a bunch of projects that I've been working on that was trying to push what OpenAI's API could do. I'm not really sure why, but it felt interesting to try. I was getting sick of one-shot products. An example of that would be any blog made right after chat GPT came out (I am guilty of this for sure.) At this point in OpenAI's global takeover, you've probably tried something like this too.
The blogs thus far and the short stories after are tests of running a series of prompts to create the content. Instead of asking "write me a blog post about X", I ask it 5 prompts: "write a summary for a blog about x, write an introduction for that blog, write a middle, write an FAQ, " etc.
import json
import requests
import openai
import functions_framework
import random
import datetime
import os
openai.api_key = "USE API KEY"
....
def generate_article(input_string):
short_story_prompt = [f"Using Markdown formatting, Write a fascinating short story with the following criteria:'{input_string}'. The audience are casual readers. Come up with a title for the story, and a description (synopis) for it. The first lines of the blog should be this format. --- title:TITLE description: DESCRIPTION date: [LEAVE BLANK] --- BODY. If there are multiple characters, include dialog if nessesary. Start by writing a 3 to 6 paragraph introduction and exposition to the story.",
f"Continue the story. Write 6 paragraphs around the conflict and rising action.",
f"Continue the story. Write a Climax to the story. Keep the criteria in mind: {input_string}.",
f"Continue the story. Write a Falling Action and Conclusion. These should be 3 to 6 paragraphs in total. "
]
role = "You are a short story author and collaborator. You learned how to write from reading YA books."
messages = [
{"role": "system", "content": role },
]
for p in short_story_prompt:
messages.append({"role":"user","content":p})
response = openai.ChatCompletion.create(
model="gpt-4",
messages= messages
)
print(response['choices'][0]['message']['content'])
messages.append({"role":"assistant","content":response['choices'][0]['message']['content']})
return_string = ""
for index in range(1,len(messages)):
if index %2 == 0:
return_string+=messages[index]['content']
return return_string
....
A common pitfall that I've seen as AI tools have matured has been the tendency to push quantity over quality. There have been so many efforts to produce as much content as possible. My lesson from this little experiment has been to instead use AI tools to produce content that you could never do just on your own. AI should augment, assist, or automate. Frankly, even despite my best efforts and an expensive API key, AI on it's own cannot produce a finished product. I didn't hate any of the stories, but they were just... hollow, or boring, or sometimes contrite.
I could spend a long time talking about how just producing content for the sake of producing content is quietly contributing to several negative outcomes, so I will, but in a different blogpost. I think that a key takeaway here is that for now, AI can produce content, but not always 'art'.
If you like our content, please consider subscribing to our weekly newsletter. I'm biased, but it's pretty great.Sign Up