API Reference¶
Complete reference for the BotManifold Python SDK.
BotManifoldClient¶
The main client class for interacting with BotManifold.
Constructor¶
| Parameter | Type | Default | Description |
|---|---|---|---|
api_url |
str | "https://botmanifold.com/api" |
Base URL for the API |
timeout |
int | 30 |
Request timeout in seconds |
Methods¶
submit()¶
Submit a policy for evaluation.
| Parameter | Type | Description |
|---|---|---|
policy_path |
str | Path to policy zip file |
scenario |
str | Scenario ID (e.g., "messy_room_v1") |
Returns: Submission object
Example:
get_submission()¶
Get the status of a submission.
| Parameter | Type | Description |
|---|---|---|
submission_id |
str | UUID of the submission |
Returns: Submission object with current status
Example:
status = client.get_submission("abc123-def456-...")
print(status.status) # "COMPLETED"
print(status.verdict) # "PASS"
list_submissions()¶
List all submissions.
| Parameter | Type | Default | Description |
|---|---|---|---|
scenario |
str | None |
Filter by scenario ID |
limit |
int | 20 |
Max results to return |
offset |
int | 0 |
Pagination offset |
Returns: List of Submission objects
get_scenarios()¶
List available scenarios.
Returns: List of Scenario objects
Example:
download_video()¶
Download the result video for a submission.
| Parameter | Type | Description |
|---|---|---|
submission_id |
str | UUID of the submission |
output_path |
str | Local path to save the video |
Example:
Data Classes¶
Submission¶
Represents a policy submission.
| Attribute | Type | Description |
|---|---|---|
id |
str | Unique submission ID |
scenario_id |
str | Scenario this submission is for |
status |
str | Current status (see below) |
verdict |
str | Judge verdict (PASS/FAIL/PARTIAL) |
score |
float | Numerical score |
video_url |
str | URL to result video |
error |
str | Error message if failed |
created_at |
datetime | Submission timestamp |
Status Values:
| Status | Description |
|---|---|
PENDING |
Submission received, awaiting upload |
UPLOADED |
Policy uploaded, waiting for queue |
QUEUED |
In simulation queue |
RUNNING |
Simulation in progress |
JUDGING |
AI judge evaluating results |
COMPLETED |
Evaluation complete |
FAILED |
Error during processing |
Scenario¶
Represents an evaluation scenario.
| Attribute | Type | Description |
|---|---|---|
id |
str | Unique scenario ID |
name |
str | Display name |
description |
str | Short description |
difficulty |
str | easy/medium/hard |
time_limit_seconds |
int | Max episode duration |
max_score |
int | Maximum achievable score |
Exceptions¶
BotManifoldError¶
Base exception for all SDK errors.
from botmanifold import BotManifoldError
try:
client.submit(...)
except BotManifoldError as e:
print(f"Error: {e}")
APIError¶
Raised when the API returns an error response.
| Attribute | Type | Description |
|---|---|---|
status_code |
int | HTTP status code |
message |
str | Error message |
ValidationError¶
Raised when input validation fails.
from botmanifold import ValidationError
try:
client.submit(policy_path="nonexistent.zip", ...)
except ValidationError as e:
print(f"Invalid input: {e}")
Environment Variables¶
| Variable | Description | Default |
|---|---|---|
BOTMANIFOLD_API_URL |
Override API base URL | https://botmanifold.com/api |
BOTMANIFOLD_TIMEOUT |
Request timeout (seconds) | 30 |