This repo is my attempt to automate every single part of my girlfriend’s internship using AI. She writes short articles for an online publication about AI and communication (yes, really). Naturally, I saw an opportunity.
So, did the experiment work? Her exact words for the AI's articles were 'perfect'. Make of that what you will.
OpenAI’s API.
There are a few steps involved, mostly to keep the model from hallucinating or being painfully generic. In the first version I used just OpenAI's API, in this version I am using its Agents SDK. There are 4 agents in this system:
- topics extractor: given the article url, uses a tool to download its contents and extracts 5 key topics discussed in the article.
- topic searcher: given a topic, uses Open AI's Web Search tool to learn about the topic and generate a summary.
- main writer: given the main article and research, drafts the article body.
- headline agent: given the article body generates a catchy headline + subtitle combo.
Here’s the general flow:
Want to see it in action? Here’s how to set it up:
-
Python Required: Make sure you have Python installed (developed with 3.13).
-
Virtual Environment (Recommended): Keeps things neat.
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
-
Install Dependencies: In your project folder, run:
pip install -r requirements.txt
This grabs
openai,openai-agents,requests,trafilatura, and other necessary bits. -
OpenAI API Key: You'll need an API key from a paid OpenAI account (https://openai.com/api/). Article generation is relatively cheap (around 20-30 cents per run).
-
Configure API Key: Create a
.envfile in the main project directory and add your key like this:OPENAI_API_KEY=YOUR_API_KEY_HERE
The
utils.pyscript looks for this file. -
Run It: Execute the main script:
python article_maker3000.py
It'll ask for the source article URL to kick things off.
