Skip to content

Repository files navigation

Implementing AI Agents in Python

Using frameworks, MCP, and RAG for agentic AI

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.



Changing codespace idle timeout value



2. Click on the button below to start a new codespace from this repository.

Click here ➡️ Open in GitHub Codespaces



3. Then click on the option to create a new codespace.

Creating new codespace from button

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.

Final prep

The codespace is ready to use when you see a prompt like the one shown below in its terminal.

Ready to use



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

API keys

c. Then click the Create API Key button.

Create API Key

d. Fill in the information, verify you're human if asked, and click Submit.

Create API Key

e. Copy the key (you can't view it again later).

Copy the key



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.

Getting API key



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.)

Run warmup script



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.



Opening labs

Now, you are ready for the labs!



NOTE: If your codespace times out and you need to reopen it

  1. Go to https://github.com/your_github_userid/codespaces
  2. Find the codespace in the list, right-click, and select Open in browser
  3. Repeat steps 5 & 6 from the main section above to set the Groq env keys and run the warmup script again.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages