Skip to main content

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 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


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.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_diff-0.0.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file agent_diff-0.0.4.tar.gz.

File metadata

  • Download URL: agent_diff-0.0.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for agent_diff-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f80939629a24a6f34d0aaf5aae9be869784df17b327c28904aae12c6b1804a78
MD5 c65eb50eb7c388c9a4926d10bea73284
BLAKE2b-256 2c7ee1f49e8a81e4be98b5d1a8872d77c07a1ab325f70e4fbdb8274b265ac335

See more details on using hashes here.

File details

Details for the file agent_diff-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_diff-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e33df8e9c8e20c57b1fb168ace38e4788e6ae434b39b2df2944a115ccb6dda7
MD5 75ce0eecf846f2e51f75d74235ecce40
BLAKE2b-256 5de85f8e248bf494548825fb3ae5d9d0fe1199b8511d01b02105d8df57d41b8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page