lint: ruff-clean testbed (blocking file write to thread, unused vars)
This commit is contained in:
+7
-3
@@ -417,7 +417,7 @@ async def run_scripted_agent(
|
||||
detour_turns += 1
|
||||
t = (await client.call_tool("turn", {"yaw_deg": 45.0})).output
|
||||
summary["tool_calls"] += 1
|
||||
log("tool", f'turn({{"yaw_deg": 45.0}}) [detour]')
|
||||
log("tool", 'turn({"yaw_deg": 45.0}) [detour]')
|
||||
log("bridge", f"ok {json.dumps(t)}")
|
||||
else:
|
||||
detour_steps -= 1
|
||||
@@ -516,8 +516,12 @@ async def run_demo(args: argparse.Namespace) -> dict[str, Any]:
|
||||
frame = (await client.call_tool("vision", {})).output
|
||||
if args.frame:
|
||||
raw = base64.b64decode(frame["png_b64"])
|
||||
with open(args.frame, "wb") as fh:
|
||||
fh.write(raw)
|
||||
|
||||
def _write_frame() -> None:
|
||||
with open(args.frame, "wb") as fh:
|
||||
fh.write(raw)
|
||||
|
||||
await asyncio.to_thread(_write_frame)
|
||||
print(f"\n[final frame saved] {args.frame}")
|
||||
print(
|
||||
f"\n[demo done] steps={summary['steps']} tool_calls={summary['tool_calls']} "
|
||||
|
||||
Reference in New Issue
Block a user