This commit is contained in:
@@ -60,6 +60,30 @@ class ClickthroughSkill:
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
def plan_with_planner(
|
||||
self,
|
||||
grid_id: str,
|
||||
preferred_label: str | None = None,
|
||||
action: str = "click",
|
||||
text: str | None = None,
|
||||
comment: str | None = None,
|
||||
) -> Dict[str, Any]:
|
||||
payload = {
|
||||
"preferred_label": preferred_label,
|
||||
"action": action,
|
||||
"text": text,
|
||||
"comment": comment or "planner-generated",
|
||||
}
|
||||
response = self._client.post(f"/grid/{grid_id}/plan", json=payload)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
def refresh_grid(self, grid_id: str, screenshot_base64: str, memo: str | None = None) -> Dict[str, Any]:
|
||||
payload = {"screenshot_base64": screenshot_base64, "memo": memo}
|
||||
response = self._client.post(f"/grid/{grid_id}/refresh", json=payload)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import base64
|
||||
|
||||
Reference in New Issue
Block a user