feat: wire Sam21Client into _deps and config

Adds services.sam21 (base_url + timeout_s) and grasp.use_sam21 toggle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal PastroandClaude Opus 4.7 committed 2026-05-11 14:43:18 +02:00
1 parent 0bc1e02f11
commit 748f5f58f7
3 files changed
+17 -2

No files matched your search

+9 -1
View File
@@ -6,7 +6,7 @@ from __future__ import annotations
from pathlib import Path
from typing import Any
from ..clients import G1Client, MarkerClient, NuwaClient, YoloClient
from ..clients import G1Client, MarkerClient, NuwaClient, Sam21Client, YoloClient
from ..config import data_dir, get_config
@@ -29,6 +29,14 @@ def yolo() -> YoloClient:
return YoloClient(c["base_url"], timeout_s=c.get("timeout_s", 10.0))
def sam21() -> Sam21Client:
c = _svc(get_config(), "sam21")
return Sam21Client(
base_url=c.get("base_url", "http://localhost:8002"),
timeout_s=float(c.get("timeout_s", 10.0)),
)
def active_robot_key() -> str:
"""Which robot the orchestrator is currently bound to ('g1' or 'h1').
Read from `robot.active` in config; defaults to 'g1' for backward compat."""
+4 -1
View File
@@ -3,9 +3,12 @@
from .g1 import G1Client, G1StatusError, G1Unavailable
from .marker import MarkerClient
from .nuwa import NuwaClient, NuwaError
from .sam21 import Sam21Client, Sam21Error, Sam21Unavailable
from .yolo import YoloClient
__all__ = [
"G1Client", "G1StatusError", "G1Unavailable",
"MarkerClient", "NuwaClient", "NuwaError", "YoloClient",
"MarkerClient", "NuwaClient", "NuwaError",
"Sam21Client", "Sam21Error", "Sam21Unavailable",
"YoloClient",
]