Movie night
Find a film by name, call TMDB through a tool, and capture its director, release year, and runtime as typed values.
1. Get the program
Download the program into your project directory. Its movie lookup tool is supplied by the tmdb registry package.
2. Prepare the environment
In a uv project with Python 3.11 or newer, install Kedi and the Google model provider:
uv add kedi 'pydantic-ai-slim[google]'Add the TMDB package to your Kedi registry:
uv run kedi add tmdbThe package installs its HTTPX dependency into the same environment. See the tmdb package and the Kedi installation guide.
3. Configure your keys
In that directory, create a local .env with your Google API key and your TMDB API Read Access Token. The TMDB token is sent as a Bearer header; it is not the shorter API key.
GOOGLE_API_KEY=your-google-api-key
TMDB_API_KEY=your-tmdb-read-access-tokenKeep .env out of version control. The keys are used by your local program, never by this website. TMDB setup
4. Run the program
uv run kedi movie_night.kedi --adapter-model google/gemini-3-flash-previewThe model can call movie_details to search for the title and read its details. The template binds three values; the final statement returns the director. Model and TMDB requests use your accounts.
# Load the movie lookup tool.
> import: tmdb
# Let the model use it.
> approval: allow
> use: movie_details
# Find the film by name and capture its details.
>> Look up Spirited Away using movie_details. Its director is [director: str], release year [year: int], and runtime [minutes: int] minutes.
# Use the result as a program value.
= <director>
For a remake or an ambiguous title, include its release year in the template. The tool accepts a year and rejects ambiguous matches.