Skip to main content

Snowglobe SDK Integration Guide

These examples are for snowglobe<=0.4.x. See the documentation for the latest version here.

Overview

Snowglobe is a simulation engine designed for testing and evaluating AI agents and chatbots through automated conversation generation and analysis. This guide demonstrates how to integrate Snowglobe into your continuous integration (CI) pipeline and programmatic workflows for comprehensive agent testing.

Table of Contents

Prerequisites

Before integrating Snowglobe, ensure you have:
  • Python 3.10+ installed
  • Snowglobe SDK package (pip install snowglobe-sdk)
  • Valid API credentials (API key and Organization ID) from here.
  • OpenAI API key (or other supported LLM provider credentials)
  • Access to a Snowglobe control plane instance

Required Dependencies

Authentication Setup

Environment Variables

Set up your credentials as environment variables or configuration constants:

Client Configuration

Initialize the Snowglobe client with proper authentication headers:

Core Components

1. Agent Creation

Agents represent the AI systems you want to test. Each agent requires:
  • Name and Description: Identifiers for your agent
  • Icon: Visual representation (optional)
  • Connection Info: LLM provider configuration
  • System Prompt: Instructions defining the agent’s behavior
Note:
Agents utilizing a code integration via snowglobe-connect require a two-step setup:
  1. Create the agent using the Snowglobe API as shown above.
  2. Configure the agent in your snowglobe-connect deployment by mapping the agent’s ID and settings in the agents.json file.
  3. Run snowglobe-connect start. This ensures Snowglobe can route simulation traffic to your custom integration correctly.

2. Simulation Configuration

Simulations define how conversations will be generated and evaluated:

CI Integration Workflow

Step 1: Create and Configure Agent

Step 2: Launch Simulation

Step 3: Monitor Simulation Progress

Step 4: Retrieve Results

Complete CI Integration Example

Error Handling

CI Pipeline Integration

Simulation States

Understanding simulation states helps with monitoring:
  • States 0-5: Initialization and setup
  • States 6-10: Persona and topic generation
  • States 11-16: Conversation generation and agent testing
  • State 17+: Evaluation complete, results available

Troubleshooting

Common Issues

Authentication Errors
  • Verify API key and organization ID are correct
  • Ensure headers are properly formatted
  • Check network connectivity to control plane
Simulation Failures
  • Review agent configuration for missing required fields
  • Verify LLM provider API key is valid and has sufficient quota
  • Check simulation parameters are within acceptable ranges
Timeout Issues
  • Increase timeout duration for complex simulations
  • Reduce persona count or length for faster completion