Skip to content

AI-powered movie recommendation engine with structured output validation and a clean web interface

Notifications You must be signed in to change notification settings

https-deeplearning-ai/movie-recommender-ralph-test-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Recommendation Generator

AI-powered movie recommendation engine with structured output validation and a clean web interface.

Live Demo API Docs

Features

  • AI-Powered Recommendations - Natural language queries transformed into personalized movie suggestions using GPT-4o-mini
  • Structured Output - Pydantic validation ensures consistent, reliable data format with title, genre, year, rating, synopsis, and cast information
  • Web Interface - Clean, responsive UI for easy interaction without technical setup
  • RESTful API - FastAPI backend with automatic OpenAPI documentation
  • Production Ready - Containerized with Docker, deployed on Render, health monitoring included

Tech Stack

FastAPI OpenAI Pydantic Docker Render

  • Backend: FastAPI (Python 3.11)
  • AI Model: OpenAI GPT-4o-mini
  • Validation: Pydantic v2
  • Deployment: Docker on Render
  • Frontend: Vanilla JavaScript

Getting Started

Local Development

# Clone the repository
git clone https://github.com/davidleocadio94/movie-recommender-ralph-test-1.git
cd movie-recommender-ralph-test-1

# Install dependencies
pip install -r requirements.txt

# Set up environment
cp .env.example .env  # Add your OpenAI API key

# Run the application
uvicorn src.api:app --reload

Visit http://localhost:8000 to use the web interface.

Docker

# Build and run with Docker
docker build -t movie-recommender .
docker run -p 8000:8000 -e OPENAI_API_KEY=your-key-here movie-recommender

API Documentation

Interactive API documentation is available at:

Example API Request

curl -X POST "https://movie-recommender-ralph-test-1.onrender.com/recommend" \
  -H "Content-Type: application/json" \
  -d '{"query": "Recommend a sci-fi movie for a relaxing weekend"}'

Example Response

{
  "title": "Arrival",
  "genre": "sci-fi",
  "year": 2016,
  "rating": 8.0,
  "synopsis": "A linguist is recruited by the military to communicate with alien lifeforms after twelve mysterious spacecraft appear around the world.",
  "director": "Denis Villeneuve",
  "lead_actor": "Amy Adams"
}

Project Structure

movie-recommender-ralph-test-1/
├── src/
│   ├── main.py          # Pydantic model + core recommendation function
│   ├── api.py           # FastAPI application with endpoints
│   └── static/
│       └── index.html   # Web UI
├── requirements.txt     # Python dependencies
├── Dockerfile          # Container configuration
├── render.yaml         # Render deployment config
├── .env.example        # Environment template
└── README.md

Built as part of the DeepLearning.AI Pydantic Course

About

AI-powered movie recommendation engine with structured output validation and a clean web interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •