

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Build an AI Agent
incomplete
2: Python Setup
incomplete
3: OpenRouter API
incomplete
4: Token Metadata
incomplete
5: User Input
incomplete
6: Multiple Messages
incomplete
7: Verbose Output
incomplete
This lesson's interactive features are locked, please to keep using them
Let's set up a virtual environment for our project.
Virtual environments are Python's way to keep dependencies (e.g., the OpenAI library we're going to use) separate from other projects on our machine.
Throughout this project, we'll suggest file names and locations to keep your code organized. If you're unsure, follow our structure. You can organize things differently, but keep any paths required by the CLI tests.
uv init --no-package your-project-name
cd your-project-nameuv venvMake sure your virtual environment directory, usually .venv or venv, is added to your .gitignore file.
source .venv/bin/activateYou should see something like (your-project-name) in your terminal prompt; for example, mine is:
(aiagent) wagslane@MacBook-Pro-2 aiagent %Always make sure your virtual environment is activated when running code or using the Boot.dev CLI in this course.
uv add openai==2.44.0
uv add python-dotenv==1.1.0This tells Python that this project requires openai version 2.44.0 and python-dotenv version 1.1.0.
To run the project using the uv virtual environment, you can use the following command:
uv run main.pyIn your terminal, you should see something like Hello from YOUR PROJECT NAME.
Submit the CLI tests while in your virtual environment.