Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ async def update_robot(self, robot_id: str, updates: dict):
async def delete_robot(self, robot_id: str):
await self._handle(self.client.delete(f"/robots/{robot_id}"))

async def duplicate_robot(self, robot_id: str, target_url: str):
return await self._handle(
self.client.post(f"/robots/{robot_id}/duplicate", json={"targetUrl": target_url})
)

async def execute_robot(self, robot_id: str, options: Optional[dict] = None):
return await self._handle(
self.client.post(
Expand Down
4 changes: 4 additions & 0 deletions robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ async def update(self, updates: dict) -> None:
updated = await self.client.update_robot(self.id, updates)
self.robot_data = updated

async def duplicate(self, target_url: str):
new_robot_data = await self.client.duplicate_robot(self.id, target_url)
return Robot(self.client, new_robot_data)

async def delete(self) -> None:
await self.client.delete_robot(self.id)

Expand Down