Python client SDK for the RoboActions automation platform.
Project description
RoboActions Python SDK
Official Python SDK for the RoboActions platform. It provides a typed, ergonomic Python interface for interacting with deployed VLA policies, enabling you to retrieve policy metadata, check health status, and run inference directly from Python applications, scripts, or notebooks.
Status: Pre-release (
0.1.0). The surface area will grow as additional endpoints become publicly available. Follow the release notes before upgrading minor versions.
Installation
pip install roboactions
Quick Start
from roboactions import RemotePolicy
# Create a policy client (automatically reads ROBOACTIONS_API_KEY from environment)
policy = RemotePolicy(policy_id="my-policy-id")
# Check policy health
status = policy.status()
print(f"Policy status: {status.value}")
# Get input/output feature schemas
input_features = policy.input_features()
output_features = policy.output_features()
# Run inference
observation = {
"observation_image": image_array,
"observation_state": state_array,
"task": "pick up the cup"
}
action = policy.select_action(observation)
print(f"Predicted action: {action}")
Authentication
All requests require an API key with access to the RoboActions workspace. Create and manage keys in the RoboActions dashboard.
The SDK automatically reads the ROBOACTIONS_API_KEY environment variable:
from roboactions import RemotePolicy
# Automatically uses ROBOACTIONS_API_KEY from environment
policy = RemotePolicy(policy_id="my-policy-id")
You can also provide the API key explicitly:
from roboactions import RemotePolicy
policy = RemotePolicy(
policy_id="my-policy-id",
api_key="rk_live_abc123" # Explicit API key
)
For security, it's recommended to use environment variables rather than hardcoding keys in your source code.
Core Features
Health Checks
# Simple boolean check
if policy.ping():
print("Policy is reachable")
# Detailed status with enum
from roboactions import PolicyStatus
status = policy.status()
if status == PolicyStatus.HEALTHY:
print("Policy is ready for inference")
elif status == PolicyStatus.DEPLOYING:
print("Policy is still deploying...")
Wait for Deployment
# Block until policy is deployed
final_status = policy.wait_until_deployed(interval=5.0)
if final_status == PolicyStatus.HEALTHY:
print("Policy is now ready!")
Reset Policy State
# Reset the policy state (useful for stateful policies between episodes)
result = policy.reset()
if result.get("reset"):
print("Policy reset successfully")
else:
print(f"Reset failed: {result.get('error')}")
Inference
# Single action prediction
action = policy.select_action(observation)
# Action chunk prediction (for temporal policies)
action_chunk = policy.predict_action_chunk(observation)
Sample Input Generation
# Generate random sample inputs (useful for testing)
sample_inputs = policy.sample_observation()
action = policy.select_action(sample_inputs)
Configuration
- Retries: Configure automatic retries with
RemotePolicy(..., retries=RetryConfig()) - Timeouts: Set per-request timeouts via
policy.status(timeout=5.0) - Custom base URL: Override
base_urlto point at staging or self-hosted deployments - Context Manager: Use
with RemotePolicy(...) as policy:for automatic session cleanup
Exception Handling
from roboactions import (
RemotePolicy,
RoboActionsError,
AuthenticationError,
RateLimitError
)
try:
policy = RemotePolicy(policy_id="my-policy", api_key="invalid-key")
action = policy.select_action(observation)
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after} seconds")
except RoboActionsError as e:
print(f"API error: {e}")
Development
- Create a virtual environment and install dependencies with
pip install -e .[dev]. - Run formatting and lint checks using
ruff check .. - Execute the test suite via
pytest.
Releasing
- Update
src/roboactions/_version.py. - Build artifacts:
python -m build. - Upload to PyPI (test or prod) using
twine upload dist/*.
License
Apache License 2.0 © RoboActions
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 roboactions-0.1.1.tar.gz.
File metadata
- Download URL: roboactions-0.1.1.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4b3890c0bf078e90783e5dd813b80e46f47f9fec10d27e73affe43b28345fa6
|
|
| MD5 |
e00563d2da12ef6cfede67b6af33d147
|
|
| BLAKE2b-256 |
b96adf5ef87917fc7f9f8a9a82086a1d311ac7e955090e249724778c8acfa039
|
File details
Details for the file roboactions-0.1.1-py3-none-any.whl.
File metadata
- Download URL: roboactions-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e37da1179228e9bdeffb33f9cdc218df11b5ab24f84aecccbb6066dc0dbf373
|
|
| MD5 |
85e24d4313c7d8038b581daaa110f190
|
|
| BLAKE2b-256 |
77a286954a92ebf0d30909ed148035cbb6959a17c7507a8235e248e32f0ebb58
|