Skip to main content

Python SDK for the AMPA API

Project description

AMPA SDK

The AMPA SDK is a Python library that provides a convenient, high-level interface for interacting with the AMPA API. It is designed to simplify agent management, versioning, and execution from any Python application, script, or notebook.

Overview

  • Easy integration: Manage agents and their versions with simple Python calls
  • Handles authentication: Securely connect to the AMPA API with username/password or environment variables
  • Request/response abstraction: No need to manually format HTTP requests
  • Extensible: Add custom methods or extend for new API endpoints

Features

  • Create, update, delete, and run agents from Python
  • List and manage agent versions
  • Automatic handling of API authentication and errors
  • Works with both local and remote AMPA API deployments

Installation

To install the AMPA SDK, use pip:

pip install the37lab_ampa_sdk

Configuration

You can configure the SDK via parameters or environment variables:

Environment variables:

  • AMPA_API_URL
  • AMPA_API_USERNAME
  • AMPA_API_PASSWORD

Usage Example

from the37lab_ampa_sdk import AMPAClient

# Initialize the client (parameters or env vars)
client = AMPAClient(
    ampa_url="http://localhost:8000",
    username="your_username",
    password="your_password",
)

# Create an agent
data = {
    "agent_name": "My Agent",
    "description": "A helpful assistant",
    "purpose": "You are a helpful assistant",
    "instruction": "Tell a story about Sweden"
}
agent = client.create_agent(data)

# Run the agent
response = client.call_agent(
    "My Agent",
    variables={"name": "John"},
    prompt="Tell me a story"
)

# List agent versions
versions = client.list_agent_versions(agent["id"])

Use Cases

  • Integrate agent management into Python apps, scripts, or notebooks
  • Automate agent creation and execution in pipelines
  • Rapid prototyping and experimentation with LLM agents

Extensibility

  • Add new methods for custom API endpoints
  • Subclass AMPAClient to add custom logic or error handling

Troubleshooting

  • Ensure the AMPA API is running and accessible
  • Check credentials and API URL
  • Review exception messages for error details

License

This project is proprietary software. All rights reserved.

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

the37lab_ampa_sdk-0.1.1750237114.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

the37lab_ampa_sdk-0.1.1750237114-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file the37lab_ampa_sdk-0.1.1750237114.tar.gz.

File metadata

File hashes

Hashes for the37lab_ampa_sdk-0.1.1750237114.tar.gz
Algorithm Hash digest
SHA256 efa8f524f02b49be736353301d4d4b417f00f60a6ff4be46b0cbe8c72e3724ee
MD5 00a9f7d79b4de0592f4d5403fe367b3c
BLAKE2b-256 3a3a87d2855bb6e9dc76595fd97126c8ac857fbb9c33c1755f3c77a752b8b48b

See more details on using hashes here.

File details

Details for the file the37lab_ampa_sdk-0.1.1750237114-py3-none-any.whl.

File metadata

File hashes

Hashes for the37lab_ampa_sdk-0.1.1750237114-py3-none-any.whl
Algorithm Hash digest
SHA256 320a0e98b772b8ae128050413ade234ddcf2c3ee15f94b6ea043e01703d0a9f2
MD5 d6a813925210e66fac424df0dad74b9e
BLAKE2b-256 bebe93352eaa70616e109ad83fc2004d970ea9c61a70dc693901f22f61dc713f

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