Repository for Implementing AI Agents in Python hands-on workshop
These instructions will guide you through configuring a GitHub Codespaces environment that you can use to run the course labs.
1. Change your codespace's default timeout from 30 minutes to longer. To do this, when logged in to GitHub, go to https://github.com/settings/codespaces and scroll down on that page until you see the Default idle timeout section. Adjust the value as desired.
2. Click on the button below to start a new codespace from this repository.
3. Then click on the option to create a new codespace.
This will run for several minutes while it gets everything ready.
After the initial startup, it will run a script to setup the python environment, install needed python pieces, install Ollama, and then download the models we will use. This will take several more minutes to run. It will look like this while this is running.
The codespace is ready to use when you see a prompt like the one shown below in its terminal.
4. Get a free API key for groq to enable use of more powerful models for some of the labs.
a. In a browser, go to https://console.groq.com and create an account. (If you have an email with a button to confirm, make sure the link is trying to open in the same browser where you were using groq before. If not, you can copy the link from the "click here" section and paste into the right browser.)
b. In the top right of the Groq screen, click on API Keys
c. Then click the Create API Key button.
d. Fill in the information, verify you're human if asked, and click Submit.
e. Copy the key (you can't view it again later).
5. Setup your groq key in your codespace.
Back in the codespace TERMINAL, run the command below to set your key for all terminals. Paste your key when prompted and then hit Enter:
source scripts/setup-key.sh
Afterwards, you should see output that indicates two environment variables (AGENT_PROVIDER and GROQ_API_KEY) are set.
6. Run the warm-up script for faster LLM interactions.
python scripts/warmup.py --embed --keep-alive 300m --auto-pull &
After this runs, you'll see a READY FOR WORKSHOP! message. You can just hit Enter to get back to a prompt.
(If you happen to hit an error where the script gets interrupted, just run it again.)
7. Open up the labs.md file so you can follow along with the labs. You can either open it in a separate browser instance or open it in the codespace.
Now, you are ready for the labs!
NOTE: If your codespace times out and you need to reopen it
- Go to https://github.com/your_github_userid/codespaces
- Find the codespace in the list, right-click, and select Open in browser
- Repeat steps 5 & 6 from the main section above to set the Groq env keys and run the warmup script again.










