Skip to content

Latest commit

 

History

History
118 lines (82 loc) · 2.86 KB

File metadata and controls

118 lines (82 loc) · 2.86 KB

Installation Guide

Prerequisites

  • Python 3.10+ (3.11 or 3.12 recommended)
  • pip (included with Python)
  • An Anthropic API key (optional — all exercises work in mock mode without one)

Step 1: Clone the Repository

git clone https://github.com/achankra/agentic-ai-workshop.git
cd agentic-ai-workshop

Step 2: Create a Virtual Environment (Recommended)

python3 -m venv .venv

# macOS / Linux
source .venv/bin/activate

# Windows
.venv\Scripts\activate

Step 3: Install Dependencies

pip install -r requirements.txt

This installs the core packages: anthropic, pydantic, click, rich, and test tools.

Step 4: Verify Installation

python3 -m pytest tests/ -v

All 15 tests should pass — they use mock mode and require no API key.

Step 5: Run Your First Exercise

# Exercise 1: Diagnostic Agent with Tool Use
python3 -m agents.diagnostic.agent logs/sample.log

# Exercise 2: Quality Gates with Structured Outputs
python3 -m agents.release_readiness.agent --simulate good

# Exercise 3: Multi-Agent Orchestration
python3 -m agents.multi_agent.orchestrator --scenario balanced

# Exercise 4: Developer Portal
python3 -m agents.portal.agent --project notification-service

Step 6: Configure an API Key (Optional)

To use real Claude API calls instead of mock responses:

Option A: Environment variable

export ANTHROPIC_API_KEY=sk-ant-api03-...

Option B: .env file Create a .env file in the project root:

ANTHROPIC_API_KEY=sk-ant-api03-...

The client auto-detects the key and switches from mock to Anthropic.

Option C: Force mock mode (even with a key present)

export USE_MOCK_AI=true

Choosing a Model

By default, the client uses claude-sonnet-4-5-20250929. Override via environment variable:

# Use Haiku (cheapest — ~$0.07/exercise run)
export ANTHROPIC_MODEL=claude-haiku-4-5-20251001

# Use Opus (most capable — ~$0.35/exercise run)
export ANTHROPIC_MODEL=claude-opus-4-5-20251101

Estimated API Costs (Per Student, 10 Runs x 4 Exercises)

Model Input Output Est. Total
Haiku 4.5 $1/M tokens $5/M tokens ~$0.69
Sonnet 4.5 $3/M tokens $15/M tokens ~$2.07
Opus 4.5 $5/M tokens $25/M tokens ~$3.45

Troubleshooting

ModuleNotFoundError: No module named 'core' Make sure you're running from the repo root and using the -m flag:

cd agentic-ai-workshop
python3 -m agents.diagnostic.agent logs/sample.log

anthropic.AuthenticationError Your API key is invalid or expired. Check with echo $ANTHROPIC_API_KEY. Or use mock mode: export USE_MOCK_AI=true.

pydantic import errors Ensure you have Pydantic v2+: pip install 'pydantic>=2.5.0'

Tests fail with import errors Run from the repo root: cd agentic-ai-workshop && python3 -m pytest tests/ -v