| Duration | 30 minutes |
| Module | M1.1 - Introduction to Voice AI |
Objectives
- Install the SignalWire Agents SDK
- Configure development environment
- Verify installation with CLI tools
Prerequisites
- Python 3.10+ installed
- Terminal/command line access
- Text editor or IDE (VS Code recommended)
Exercise 1: Create Working Directory
Create a dedicated directory for training:
mkdir -p ~/signalwire-training
cd ~/signalwire-training
Checkpoint: You should be in the signalwire-training directory.
Exercise 2: Create Virtual Environment
Set up an isolated Python environment:
# Create virtual environment
python3 -m venv .venv
# Activate it
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
Checkpoint: Your prompt should show (.venv) prefix.
Exercise 3: Install SDK
Install the SignalWire Agents SDK:
pip install signalwire-agents
Wait for installation to complete.
Checkpoint: No errors in installation output.
Exercise 4: Verify Core Import
Test that the SDK loads correctly:
python -c "from signalwire_agents import AgentBase; print('SUCCESS: AgentBase imported')"
Expected Output:
SUCCESS: AgentBase imported
Exercise 5: Verify CLI Tools
Test the command-line tools:
# Test swaig-test
swaig-test --help
# Test sw-agent-init
sw-agent-init --help
Checkpoint: Both commands show help text without errors.
Exercise 6: Create Environment File (Optional)
Environment files (.env) store configuration. To use them, first install python-dotenv:
pip install python-dotenv
Create a .env file for configuration:
cat > .env << 'EOF'
# SignalWire Credentials (fill in later)
SIGNALWIRE_SPACE_NAME=
SIGNALWIRE_PROJECT_ID=
SIGNALWIRE_TOKEN=
# Agent Authentication (SDK reads these automatically when loaded)
SWML_BASIC_AUTH_USER=signalwire
SWML_BASIC_AUTH_PASSWORD=training123
EOF
Note: The
.envfile is not loaded automatically. You must addfrom dotenv import load_dotenvand callload_dotenv()at the start of your agent script. We’ll cover this in Module 1.4.
Checkpoint: File .env exists with template content.
Exercise 7: Create Test Agent
Create a simple test agent:
cat > test_agent.py << 'EOF'
#!/usr/bin/env python3
"""Test agent for environment verification."""
from signalwire_agents import AgentBase
agent = AgentBase(name="test-agent")
agent.prompt_add_section("Role", "You are a test agent.")
if __name__ == "__main__":
print("Environment setup successful!")
print("Agent name:", agent.name)
EOF
Run it:
python test_agent.py
Expected Output:
Environment setup successful!
Agent name: test-agent
Exercise 8: Test SWML Generation
Use swaig-test to verify agent output:
swaig-test test_agent.py --dump-swml
Expected Output: JSON document with SWML structure including your prompt.
Verification Checklist
- Virtual environment created and activated
- SDK installed without errors
AgentBaseimports successfullyswaig-test --helpworkssw-agent-init --helpworks.envfile created- Test agent runs
- SWML generation works
Troubleshooting
“python: command not found”
Try python3 instead of python.
“No module named signalwire_agents”
Ensure virtual environment is activated (you see (.venv) in prompt).
“Permission denied”
On Unix, you may need: chmod +x test_agent.py
swaig-test not found
Ensure you’re in the activated virtual environment where SDK was installed.
Summary
You have successfully:
- Created a dedicated training directory
- Set up an isolated Python environment
- Installed the SignalWire Agents SDK
- Verified all components work correctly
Next: Module 1.2 - Your First Agent