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:
ampa_url: The base URL of the AMPA API (default: https://ampa.the37lab.com:13002/)username: API usernamepassword: API password
Environment variables:
AMPA_API_URLAMPA_API_USERNAMEAMPA_API_PASSWORD
Usage Example
from the37lab_ampa_sdk import AgentAPI
# Initialize the client (parameters or env vars)
client = AgentAPI(
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
AgentAPIto 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
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 the37lab_ampa_sdk-0.1.1750343421.tar.gz.
File metadata
- Download URL: the37lab_ampa_sdk-0.1.1750343421.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f87357a07ea050a2f8d4a14992284edda9238ef0bfa43c15d07edce7cecbb3d
|
|
| MD5 |
270af137b1ce62bf3ea23bdbdbc63628
|
|
| BLAKE2b-256 |
a8d7d877271c539874e4bb964edcc01d67bfc77f25fc7a28303d3c06e6a12411
|
File details
Details for the file the37lab_ampa_sdk-0.1.1750343421-py3-none-any.whl.
File metadata
- Download URL: the37lab_ampa_sdk-0.1.1750343421-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10caeae6e9faa94e943f78606fff12f305473ad4aedcb2d1d5da5887009e973
|
|
| MD5 |
7c3fbcd59d17dece3af2c63d0d5c2889
|
|
| BLAKE2b-256 |
ab5b24f08e9416cc0287e34755228f33a35ca4cd20c35fc7e8e6eb5eef029737
|