Skip to content

NitinKumar1-1/ai-podcast-script-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ™οΈ AI Podcast Script Generator

Transform articles and transcripts into engaging, multi-speaker podcast scripts using AI-powered enhancement. Create natural conversations between hosts and guests from any written content.

✨ Key Features

  • πŸ—£οΈ Multi-Speaker Conversations: Convert articles into natural dialogue between host and guest
  • 🎭 Flexible Formats: Interview, multi-host, or single-host podcast styles
  • πŸ€– AI Enhancement: Improve content quality using OpenAI or Anthropic Claude
  • πŸ“ Smart Processing: Automatically segment and structure content
  • 🎯 Complete Scripts: Generate intro, main content, outro, and show notes
  • 🌐 Web Interface: User-friendly interface with step-by-step workflow
  • ⚑ Serverless API: Cloudflare Workers deployment for scalability
  • πŸ”’ Secure: Environment-based API key management

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/Garvgupta06/ai-podcast-script-generator.git
cd ai-podcast-script-generator

2. Set Up Environment Variables

Create your environment file:

# Windows
copy .env.example .env

# Linux/Mac
cp .env.example .env

Edit .env with your API keys:

# Required: At least one LLM API key
OPENAI_API_KEY=sk-your-openai-key-here
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here

# Optional: Model preferences
OPENAI_MODEL=gpt-3.5-turbo
ANTHROPIC_MODEL=claude-3-sonnet-20240229

# Optional: Customize defaults
SHOW_NAME=Your Amazing Podcast
HOST_NAME=Your Name
SHOW_TAGLINE=Your podcast description

3. Deploy the API

Option A: Quick Deploy (Windows)

cd cloudflare-workers
setup-api-keys.bat
deploy-with-env.bat

Option B: Manual Deploy

cd cloudflare-workers
npm install
npx wrangler login
npx wrangler secret put OPENAI_API_KEY    # Enter your OpenAI key
npx wrangler secret put ANTHROPIC_API_KEY # Enter your Anthropic key
npx wrangler deploy

4. Open the Web Interface

  1. Open web-interface/index.html in your browser
  2. The interface will connect to your deployed API automatically
  3. Start creating podcast scripts!

🎯 How It Works

Transform Any Article Into a Podcast Conversation

Input (Article):

Climate change is affecting global weather patterns. Scientists have recorded 
unprecedented temperature increases. Recent studies show renewable energy 
solutions are becoming more cost-effective...

Output (Podcast Script):

Host: So tell us about the data you've been looking at.

Guest: Climate change is affecting global weather patterns. Scientists have 
recorded unprecedented temperature increases across the globe.

Host: Those are fascinating numbers. What makes them particularly significant?

Guest: Recent studies show renewable energy solutions are becoming more 
cost-effective. This really shows us where the trends are heading.

Host: That puts things in a whole new perspective.

πŸŽͺ Podcast Formats

🎀 Interview Format (Host + Guest)

Perfect for expert interviews and educational content:

  • Host asks engaging questions
  • Guest provides expertise and insights
  • Natural back-and-forth conversation
  • Professional interview flow

πŸ‘₯ Multi-Host Format (Co-hosted)

Great for discussion-style podcasts:

  • Both hosts contribute equally
  • Natural banter and conversation
  • Shared insights and perspectives
  • Dynamic co-host interaction

πŸ—£οΈ Single Host Format (Monologue)

Traditional podcast style:

  • Single speaker presentation
  • Professional narration
  • Structured content delivery
  • Perfect for solo shows

πŸ“ Project Structure

ai-podcast-script/
β”œβ”€β”€ πŸ“„ README.md              # This comprehensive guide
β”œβ”€β”€ πŸ”§ .env.example          # Environment template
β”œβ”€β”€ πŸ“‹ requirements.txt      # Python dependencies
β”‚
β”œβ”€β”€ ☁️ cloudflare-workers/   # Serverless API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ πŸš€ index.js      # Main API handler
β”‚   β”‚   β”œβ”€β”€ handlers/        # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ script.js    # Script generation (NEW!)
β”‚   β”‚   β”‚   β”œβ”€β”€ llm.js       # AI enhancement
β”‚   β”‚   β”‚   └── content.js   # Content processing
β”‚   β”‚   └── utils/           # Utilities
β”‚   β”œβ”€β”€ πŸš€ deploy-with-env.bat # Windows deployment
β”‚   └── βš™οΈ wrangler.toml     # Cloudflare config
β”‚
β”œβ”€β”€ 🌐 web-interface/        # Web application
β”‚   └── πŸ“± index.html        # Complete web UI
β”‚
β”œβ”€β”€ 🐍 python-scripts/      # Python implementations
β”‚   β”œβ”€β”€ env_loader.py       # Environment management
β”‚   β”œβ”€β”€ llm_integration.py  # LLM API clients
β”‚   β”œβ”€β”€ script_generator.py # Script generation
β”‚   └── transcript_processor.py # Content processing
β”‚
β”œβ”€β”€ βš™οΈ config/              # Configuration
β”‚   └── config.py           # Settings management
β”‚
└── πŸ§ͺ tests/               # Testing
    └── test_all.py         # Comprehensive tests

🎬 Step-by-Step Usage

Web Interface Workflow

  1. πŸ“ Input Content

    • Paste article text or transcript
    • Upload text files
    • Manual text input
  2. πŸ€– AI Enhancement

    • Skip: Basic cleanup only
    • Comprehensive: Full AI enhancement
    • Conversational: Perfect for articles (NEW!)
    • Minimal: Light touch improvements
  3. 🎭 Configure Podcast

    • Choose format: Interview/Multi-host/Single-host
    • Set show name and tagline
    • Enter host and guest names
    • Customize episode details
  4. 🎯 Generate Script

    • Creates complete podcast script
    • Includes intro, main content, outro
    • Generates show notes and timestamps
    • Natural speaker conversations
  5. πŸ“€ Export & Use

    • Download as text, markdown, or JSON
    • Copy individual segments
    • Use in your podcast production

πŸ”„ Enhancement Types

Type Best For What It Does
Skip Demo/Testing Basic cleanup only
Conversational Articles Transforms written content into natural dialogue
Comprehensive Transcripts Full AI enhancement with improvements
Minimal Clean Content Light touch, preserves original style

πŸ› οΈ API Reference

Base URL

https://your-worker-name.your-username.workers.dev

Key Endpoints

POST /api/process-transcript

Process and segment content for podcast use.

{
  "transcript": "Your article or transcript content...",
  "source_type": "article"
}

POST /api/enhance-content

AI-powered content enhancement.

{
  "content": "Content to enhance...",
  "enhancement_type": "conversational"
}

POST /api/generate-script

Generate complete podcast script with conversations.

{
  "processed_transcript": { "segments": [...] },
  "show_config": {
    "show_name": "Tech Insights",
    "speakers": {
      "format": "interview",
      "host_name": "Sarah",
      "guest_name": "Dr. Johnson"
    }
  }
}

πŸ”§ Advanced Configuration

Environment Variables

Variable Description Default
OPENAI_API_KEY OpenAI API key Required
ANTHROPIC_API_KEY Anthropic API key Alternative
OPENAI_MODEL OpenAI model gpt-3.5-turbo
ANTHROPIC_MODEL Anthropic model claude-3-sonnet-20240229

Customization Options

  • Show Configuration: Name, tagline, host details
  • Speaker Formats: Interview, multi-host, single-host
  • Enhancement Levels: Skip, minimal, conversational, comprehensive
  • Export Formats: TXT, MD, JSON

🎨 Examples

Article Input

"Artificial intelligence is transforming healthcare. Machine learning algorithms 
can now analyze medical images with 95% accuracy. This technology is being 
implemented in hospitals worldwide."

Generated Interview Script

Sarah: So tell us about the data you've been looking at.

Dr. Martinez: Artificial intelligence is transforming healthcare. Machine 
learning algorithms can now analyze medical images with 95% accuracy.

Sarah: Those are fascinating numbers. What makes them particularly significant?

Dr. Martinez: This technology is being implemented in hospitals worldwide. 
This really shows us where the trends are heading.

Sarah: That puts things in a whole new perspective.

[PAUSE FOR EMPHASIS]

πŸš€ Deployment Options

Cloudflare Workers (Recommended)

cd cloudflare-workers
npm install
npx wrangler deploy

Local Development

cd cloudflare-workers
npm run dev

Python Scripts (Standalone)

pip install -r requirements.txt
python python-scripts/script_generator.py

πŸ”’ Security Features

  • No Data Persistence: Content is not stored permanently
  • Environment Variables: Secure API key management
  • HTTPS Only: All communications encrypted
  • Local Processing: Can run entirely offline (Python version)
  • CORS Protection: Secure cross-origin requests

πŸ§ͺ Testing

Run All Tests

cd tests
python test_all.py

Test Individual Components

# Test API deployment
curl https://your-worker.workers.dev/api/health

# Test web interface
python -m http.server 8000
# Open http://localhost:8000/web-interface/

πŸ“‹ Requirements

System Requirements

  • Node.js 16+ (for Cloudflare Workers)
  • Python 3.8+ (for Python scripts, optional)
  • Modern Browser (for web interface)

API Requirements

  • OpenAI API Key OR Anthropic API Key (at least one required)
  • Cloudflare Account (free tier sufficient)

Optional Requirements

  • Git (for version control)
  • VS Code (recommended editor)

πŸ†˜ Troubleshooting

Common Issues

"No LLM provider configured"

  • Ensure API keys are set in environment variables
  • Check that secrets are properly deployed to Cloudflare Workers

"Failed to generate script"

  • Verify API deployment is successful
  • Check browser console for detailed error messages
  • Ensure input content is not empty

"Enhancement failed, using fallback"

  • API quota may be exceeded
  • Check API key validity
  • Try different enhancement type

Getting Help

🚧 What's New

v2.0 - Conversational AI (Latest)

  • βœ… Multi-speaker conversation generation
  • βœ… Interview and multi-host formats
  • βœ… Conversational enhancement for articles
  • βœ… Intelligent content distribution between speakers
  • βœ… Varied conversation starters and natural flow

v1.0 - Foundation

  • βœ… Basic transcript processing
  • βœ… Single-host script generation
  • βœ… Web interface
  • βœ… Cloudflare Workers API

🎯 Roadmap

Upcoming Features

  • Voice Integration: AI voice generation for scripts
  • Template System: Custom script templates
  • Batch Processing: Multiple files at once
  • Advanced Analytics: Script quality metrics
  • Multi-language Support: International podcasts
  • WordPress Plugin: Direct website integration

Long-term Goals

  • Mobile App: Native iOS/Android apps
  • Team Collaboration: Multi-user workspaces
  • Premium Features: Advanced customization
  • Podcast Networks: Multi-show management

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenAI and Anthropic for powerful LLM APIs
  • Cloudflare for serverless computing platform
  • Bootstrap for beautiful web interface
  • Font Awesome for icons

πŸŽ™οΈ Built with ❀️ for podcast creators who want to turn any content into engaging conversations

Transform your articles into podcast gold!

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors