Skip to content

https-deeplearning-ai/pydantic-student1-project

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/pydantic-student1-project.git
cd pydantic-student1-project

# Install dependencies
pip install -r requirements.txt

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

# Run the application
uvicorn src.main: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://pydantic-student1-project.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/
├── src/
│   └── main.py          # FastAPI application with endpoints and UI
├── requirements.txt      # Python dependencies
├── Dockerfile           # Container configuration
├── .env.example         # Environment template
└── README.md

Built as part of the DeepLearning.AI Pydantic Course

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published