SDK
Official Python SDK — connect a robot in a few lines instead of hand-building HTTP requests.
Install
pip install "mevratek-sdk @ git+https://github.com/difast/brain#subdirectory=sdk/python"
Quick start
from mevratek import BrainClient
# 1. Register once (save bot.token to reuse next time)
bot = BrainClient.register(
"https://api.mevratek.ru/api/v1",
name="rover-01",
robot_type="rover",
capabilities=[
{"type": "move_forward", "value": {"type": "number", "min": 0, "max": 1}},
{"type": "turn_left", "value": {"type": "number", "min": 0, "max": 180}},
{"type": "stop"},
],
)
print("token:", bot.token)
# 2. Liveness + telemetry
bot.heartbeat()
bot.send_telemetry(battery=82, speed=0.0, x=0, y=0)
# 3. Ask the brain what to do
decision = bot.decide(
task="find and approach the bottle",
state={"battery": 82, "obstacle_distance_m": 1.4},
image_bytes=open("frame.jpg", "rb").read(), # optional
)
for action in decision["actions"]:
print("execute", action["type"], action["value"])Reuse an existing token
bot = BrainClient("https://api.mevratek.ru/api/v1", token="eyJ...")Task Engine
task = bot.next_task() # pull next queued task (or None)
if task:
decision = bot.decide(task=task["description"], state={...})
# ... execute actions ...
bot.report_task_result(task["id"], status="completed", result="done")Methods
| Method | Description |
|---|---|
| BrainClient.register(url, name, robot_type, capabilities, meta) | Register and return a client |
| BrainClient(url, token=...) | Construct from an existing token |
| .heartbeat(status) | Report liveness |
| .decide(task, state, image_bytes/image_b64, frame_url, task_id) | Get a decision |
| .send_telemetry(battery, speed, x, y, z, errors, extra) | Send telemetry |
| .next_task() | Pull next queued task (or None) |
| .report_task_result(task_id, status, result) | Report task outcome |
Other languages: any HTTP client works — see the Documentation and the interactive OpenAPI / Swagger page.