Skip to content

LetsBuildAndChange/OpenAI-API-Pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

AI Content Pipeline

A two-step LLM automation pipeline that takes raw unstructured input (emails, briefs, notes) and outputs a structured content plan using the OpenAI API.

What it does

Step 1 — Extract: Sends raw text through GPT-4o-mini to pull out topic, audience, tone, goals, deadlines, and key points as structured JSON.

Step 2 — Plan: Feeds that JSON into a second prompt to generate a summary, action items, content calendar, and suggested channels.

Final output is saved to output.json.

Setup

git clone <your-repo-url>
cd ai-content-pipeline
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install openai python-dotenv

Copy .env.example to .env and add your OpenAI API key:

OPENAI_API_KEY=your-key-here

Run

python pipeline.py

Paste any raw text (an email, a brief, meeting notes), type END on a new line, and press Enter.

Example input

Hey team, we need to launch a campaign for our new app by end of June.
Target audience is college students aged 18-24. We want a casual, fun tone.
Main goals are brand awareness and app downloads. Key talking points: free to use,
easy onboarding, community-focused. We have 6 weeks.

Example output

{
  "brief": {
    "topic": "App launch campaign",
    "audience": "College students aged 18-24",
    "tone": "Casual, fun",
    "goals": ["brand awareness", "app downloads"],
    "deadlines": ["end of June"],
    "key_points": ["free to use", "easy onboarding", "community-focused"]
  },
  "content_plan": {
    "summary": "A 6-week campaign targeting college students to drive awareness and downloads of a free, community-focused app.",
    "action_items": ["Create social media assets", "Write launch blog post", "Set up download tracking"],
    "content_calendar": [
      { "week": 1, "deliverable": "Teaser posts on Instagram and TikTok" },
      { "week": 2, "deliverable": "Launch announcement + app store assets" },
      { "week": 3, "deliverable": "User testimonial content" }
    ],
    "suggested_channels": ["Instagram", "TikTok", "Reddit", "Email"]
  }
}

Tech

  • Python 3.10+
  • OpenAI API (gpt-4o-mini)
  • Prompt chaining (two-step pipeline)
  • Structured JSON outputs via response_format

About

Python pipeline using the OpenAI API to process raw inputs into structured JSON outputs through multi-stage prompt workflows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages