refactor: simplify to see/interact/exec and split server modules
All checks were successful
python-syntax / syntax-check (push) Successful in 6s
All checks were successful
python-syntax / syntax-check (push) Successful in 6s
This commit is contained in:
@@ -15,24 +15,25 @@ if TOKEN:
|
||||
def main():
|
||||
health = requests.get(f"{BASE_URL}/health", headers=headers, timeout=10)
|
||||
health.raise_for_status()
|
||||
print("health ok:", health.json().get("ok"))
|
||||
print("health:", health.json()["data"])
|
||||
|
||||
observe = requests.post(
|
||||
f"{BASE_URL}/v2/observe",
|
||||
see = requests.post(
|
||||
f"{BASE_URL}/see",
|
||||
headers=headers,
|
||||
params={"screen": SCREEN},
|
||||
json={
|
||||
"mode": "screen",
|
||||
"include_image": False,
|
||||
"ocr_mode": "none",
|
||||
"screen": SCREEN,
|
||||
"with_grid": True,
|
||||
"grid_rows": 12,
|
||||
"grid_cols": 12,
|
||||
"image_format": "jpeg",
|
||||
"jpeg_quality": 70,
|
||||
},
|
||||
timeout=20,
|
||||
timeout=30,
|
||||
)
|
||||
observe.raise_for_status()
|
||||
payload = observe.json()["data"]
|
||||
print("observation_id:", payload["observation_id"])
|
||||
print("region:", payload["region"])
|
||||
print("timing_ms:", payload["timing_ms"])
|
||||
see.raise_for_status()
|
||||
payload = see.json()["data"]
|
||||
print("region:", payload["meta"]["region"])
|
||||
print("grid:", payload["meta"].get("grid", {}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user