Skip to content

Commit b362d5e

Browse files
committed
Introduce new variables to use desired models and other tweaks
1 parent 1336b4d commit b362d5e

File tree

6 files changed

+527
-490
lines changed

6 files changed

+527
-490
lines changed

labspace/01-introduction.md

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,15 @@ This Labspace comes with everything you need to get started:
2929

3030
## Prerequisites
3131

32-
Before starting this workshop, you should have:
32+
Before starting this workshop, you should have an API key to a model provider. The following providers are supported:
3333

34-
1. **cagent installed** - Follow the installation instructions below
35-
2. **AI API access** - Choose one of:
36-
- OpenAI API key (for GPT-4, GPT-4o)
37-
- Anthropic API key (for Claude models)
38-
- Google API key (for Gemini models)
34+
- OpenAI
35+
- Anthropic
36+
- Google (for Gemini models)
3937

40-
## Step 1: Install cagent
38+
Additionally, this lab will make use of Docker's MCP Gateway, which should already be up and running.
4139

42-
Since you're running this lab on Ubuntu Linux, let's install cagent directly. Run the following commands:
43-
44-
```bash
45-
# Download the latest cagent Linux binary
46-
curl -L -o /tmp/cagent https://github.com/docker/cagent/releases/latest/download/cagent-linux-amd64
47-
48-
# Make it executable
49-
chmod +x /tmp/cagent
50-
51-
# Move it to a location in your PATH
52-
sudo mv /tmp/cagent /usr/local/bin/cagent
53-
54-
# Verify installation
55-
cagent version
56-
```
57-
58-
You should see output showing the cagent version.
59-
60-
## Step 2: Verify Pre-Configured Services
61-
62-
Let's make sure the Labspace services are running:
40+
Verify it's running by running the following command:
6341

6442
```bash
6543
# Check MCP Gateway
@@ -68,6 +46,7 @@ curl http://labspace-mcp-gateway:8080/sse
6846

6947
If the command returns successfully, you're ready to go!
7048

49+
7150
## Workshop Overview
7251

7352
In this workshop we will learn the basics of creating agents and teams of
@@ -82,12 +61,11 @@ agents that do things for you.
8261

8362
| Step | Topic | Description |
8463
|------|-------|-------------|
85-
| 2 | Getting Started | Create your first agent and set up API keys |
64+
| 2 | Getting Started | Create your first agent |
8665
| 3 | Built-in Tools | File operations, shell commands, memory, and todo tracking |
8766
| 4 | MCP Integration | Connect to external services (fetch, search, documentation) |
8867
| 5 | Sharing Agents | Push and pull agents via Docker Hub |
8968
| 6 | Sub-agents | Build multi-agent teams with specialized roles |
9069
| 7 | Model Runner | Run local AI models on your local machine (reference only) |
9170
| 8 | Conclusion | Next steps and advanced topics |
9271

93-
Let's get started!

labspace/02-getting-started.md

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,101 @@
11
# Step 2: Getting Started with cagent
22

3-
## First, let's set up your API keys
3+
## Install cagent
44

5-
To use cagent, you'll need at least one API key from your preferred AI provider. Please provide the API key(s) you want to use:
5+
1. Run the following commands to install cagent into your lab environment:
66

7-
::variableDefinition[openaikey]{prompt="Enter your OpenAI API key (or leave blank if not using OpenAI)"}
7+
```bash
8+
# Download the latest cagent Linux binary
9+
curl -L -o /tmp/cagent https://github.com/docker/cagent/releases/latest/download/cagent-linux-amd64
810

9-
::variableDefinition[anthropickey]{prompt="Enter your Anthropic API key (or leave blank if not using Anthropic)"}
11+
# Make it executable
12+
chmod +x /tmp/cagent
1013

11-
::variableDefinition[googlekey]{prompt="Enter your Google/Gemini API key (or leave blank if not using Google)"}
14+
# Move it to a location in your PATH
15+
sudo mv /tmp/cagent /usr/local/bin/cagent
16+
```
1217

13-
## Setting Up Your Environment
18+
2. Once the install is completed, verify it by checking the version information:
1419

15-
Now that you've provided your API key(s), let's set them in your environment. Copy and run the following commands in the terminal based on the provider(s) you're using:
20+
```bash
21+
cagent version
22+
```
1623

17-
```bash
18-
# For OpenAI models (if you provided an OpenAI key)
19-
export OPENAI_API_KEY=$$openaikey$$
24+
You should see output showing the cagent version.
2025

21-
# For Anthropic models (if you provided an Anthropic key)
22-
export ANTHROPIC_API_KEY=$$anthropickey$$
2326

24-
# For Gemini models (if you provided a Google key)
25-
export GOOGLE_API_KEY=$$googlekey$$
26-
```
27+
## API setup
28+
29+
In order to complete this lab, you will need an API key from one of the following providers:
30+
31+
::variableSetButton[Use OpenAI]{variables="provider=openai,model=openai/gpt-5-nano,modelShort=gpt-5-nano"}
32+
33+
::variableSetButton[Use Anthropic]{variables="provider=anthropic,model=anthropic/claude-sonnet-4-6,modelShort=claude-sonnet-4-6"}
2734

28-
> **Note:** You only need to set the API keys for the providers you plan to use. At minimum, you need one valid API key to proceed.
35+
::variableSetButton[Use Gemini]{variables="provider=gemini,model=google/gemini-2.5-flash,modelShort=gemini-2.5-flash"}
2936

30-
## Your First Agent
37+
 
3138

32-
Let's create the simplest possible agent. Run this command in the terminal to create `basic_hello.yaml`:
39+
:::conditionalDisplay{variable="provider" requiredValue="openai"}
40+
### OpenAI configuration
41+
42+
::variableDefinition[openaikey]{prompt="Enter your OpenAI API key (or leave blank if not using OpenAI)"}
3343

3444
```bash
35-
cat > basic_hello.yaml << 'EOF'
36-
agents:
37-
root:
38-
model: openai/gpt-4o
39-
instruction: You talk like a pirate
40-
EOF
45+
export OPENAI_API_KEY=$$openaikey$$
4146
```
47+
:::
4248

43-
Now let's run this amazing agent:
49+
50+
:::conditionalDisplay{variable="provider" requiredValue="anthropic"}
51+
### Anthropic configuration
52+
53+
::variableDefinition[anthropickey]{prompt="Enter your Anthropic API key (or leave blank if not using Anthropic)"}
4454

4555
```bash
46-
cagent run basic_hello.yaml
56+
# For Anthropic models (if you provided an Anthropic key)
57+
export ANTHROPIC_API_KEY=$$anthropickey$$
4758
```
59+
:::
4860

49-
If everything is setup correctly, you should see the TUI and be able to ask a
50-
question to your agent and it should answer in pirate speak.
5161

62+
:::conditionalDisplay{variable="provider" requiredValue="gemini"}
63+
### Gemini configuration
5264

65+
::variableDefinition[googlekey]{prompt="Enter your Google/Gemini API key (or leave blank if not using Google)"}
5366

54-
To exit the TUI, press `Ctrl+C`.
67+
```bash
68+
export GOOGLE_API_KEY=$$googlekey$$
69+
```
70+
:::
5571

56-
## Choosing Different Models
5772

58-
If you don't have access to OpenAI, or want to use a different provider, you can easily swap the model in your YAML configuration. Visit [models.dev](https://models.dev) and look for models that exist for your provider.
73+
## Writing your First Agent
5974

60-
`cagent` supports these providers:
75+
Let's create the simplest possible agent.
6176
62-
- **`openai`** - OpenAI models (GPT-4, GPT-4o, etc.)
63-
- **`anthropic`** - Anthropic models (Claude 3.5 Sonnet, etc.)
64-
- **`google`** - Google Gemini models
65-
- **`dmr`** - Use any local [Docker Model Runner](https://docs.docker.com/ai/model-runner/) model that you already have pulled locally
77+
1. Create a file named `basic_hello.yaml` with the following contents:
6678
67-
For example, to use Anthropic's Claude instead, create a new file:
79+
```yaml save-as=basic_hello.yaml
80+
agents:
81+
root:
82+
model: $$model$$
83+
instruction: You talk like a pirate
84+
```
6885
69-
```bash
70-
cat > basic_hello_claude.yaml << 'EOF'
71-
agents:
72-
root:
73-
model: anthropic/claude-3-5-sonnet-20241022
74-
instruction: You talk like a pirate
75-
EOF
76-
```
86+
2. Run this amazing agent using the following command:
7787
78-
Then run it:
88+
```bash
89+
cagent run basic_hello.yaml
90+
```
7991
80-
```bash
81-
cagent run basic_hello_claude.yaml
82-
```
92+
3. Ask your agent a simple question to see it answer in pirate speak:
93+
94+
```console
95+
Give me an interesting and lesser-known fact about Docker
96+
```
97+
98+
4. To exit the agent's interface, press `Ctrl+C`.
8399

84100

85101
## Next Steps

0 commit comments

Comments
 (0)