Skip to content

About

An app that recommends horror movies for you

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Horror Movie Recommender (LLM + tool use)

A command line app that recommends horror movies based on your keywords (rating, year, keyword). Uses Anthropic Claude model with tool use (API). The model calls a Python function that fetches data from IMDb's open dataset.

Setup

  1. python -m venv venv
  2. venv\Scripts\activate (Windows) source venv/bin/activate (Mac/Linux)
  3. pip install -r requirements.txt
  4. copy .env.example .env (Windows) cp .env.example .env (Mac/Linux)
  5. open .env and add your own ANTHROPIC_API_KEY

API key

  1. Go to console.anthropic.com and create an account.
  2. Add a payment method. Creating a key is free, but using the API is billed per token :(
  3. Go to 'API keys' and click 'create key'
  4. Copy the key immediately. It should look something like "sk-ant-api03-...".
  5. Paste it into your .env-file

Use

  1. Build the database (downloads IMDb's datasets): python data_loader.py

  2. Start the recommender: python main.py

  3. Type, for example: You: "psychological horror from 2015-2022, rating above 7", "clown horror, rating under 5", or "anything from 2008"

The app currently prints its answers in Finnish. "Switching the app to English" is below if you'd rather it run fully in English.

Switching the app to English

You can change the texts in 'llm_agent.py' and the 'SYSTEM_PROMPT' string, which instructs the model in Finnish.

Troubleshooting

  • 'ModuleNotFoundError' - you haven't activated the venv, or skipped 'pip install -r requirements.txt'.
  • 'KeyError: 'ANTHROPIC_API_KEY'' - .env-file is missing or not in the same folder as 'main.py', or the key name doesn't match exactly.
  • 'authentication_error' from the API** - the key was copied incorrectly or your account has no credits.
  • Network error in 'data_loader.py' - check your network settings.

Future development

  • Content-based keyword search (adding the TMDb API so you can search by theme)
  • Web UI (replace the CLI with an app)

Data source

IMDb Non-Commercial Datasets: https://developer.imdb.com/non-commercial-datasets/ (non-commercial use only)

About

An app that recommends horror movies for you

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages