Python SDK for Agent Diff - test AI agents and train models against replicas of services
Project description
Agent Diff Python SDK
Python SDK for testing AI agents against isolated replicas of production services.
Installation
uv add agent-diff
# or
pip install agent-diff
Quick Start
from agent_diff import AgentDiff
client = AgentDiff(
api_key="your-api-key",
base_url="https://api.yourdomain.com"
)
# 1. Create an isolated environment
env = client.init_env(
templateService="slack",
templateName="slack_default",
impersonateUserId="U123456",
ttlSeconds=1800
)
# 2. Take before snapshot of the environment
run = client.start_run(envId=env.environmentId)
# 3. Agents does it's thing to replica
# (Use env.environmentUrl to call the service API)
# 4. Compute the diff
diff = client.diff_run(runId=run.runId)
# Inspect changes
diff.diff['inserts'] # New records
diff.diff['updates'] # Modified records
diff.diff['deletes'] # Deleted records
# 5. Cleanup
client.delete_env(env.environmentId)
Environments
Create isolated, ephemeral replicas of services:
env = client.init_env(
templateService="slack",
templateName="slack_default",
impersonateUserId="U123",
ttlSeconds=3600
)
# Access environment details
env.environmentId
env.environmentUrl
env.expiresAt
# Delete when done
client.delete_env(env.environmentId)
Templates
List and create environment templates:
# List available templates
templates = client.list_templates()
# Create custom template - you can populate the replica and turn it into a template with custom data
custom = client.create_template_from_environment(
environmentId=env.environmentId,
service="slack",
name="my_template",
description="Custom template",
ownerScope="user" # user means only you can view the template
)
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agent_diff-0.0.8.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_diff-0.0.8.tar.gz.
File metadata
- Download URL: agent_diff-0.0.8.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b8980066c208b1fe2e06785d167d5c9ff5ebdd94fd72a9b60a505bf270fd52b
|
|
| MD5 |
f80762a13e01004cf1ef8175c907e07e
|
|
| BLAKE2b-256 |
88443135eb9ce82a819b0687e8120bf914a7ee78d0a360149f18a500cec6db79
|
File details
Details for the file agent_diff-0.0.8-py3-none-any.whl.
File metadata
- Download URL: agent_diff-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3412587cb039e766daaf2d2616e0bfe35dcf0a5d3b3afb9c0a9a74c4d3c342
|
|
| MD5 |
5a16d12eeca00699e74aac720b7d1b03
|
|
| BLAKE2b-256 |
973e72577a30e2946b9efac62a7401d9362d99a0733813859f867e99a4b37eab
|