diff --git a/README.md b/README.md index a24c0a7..8a39f42 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ - [PCD](#pcd) - [Sequential PCD](#sequential-pcd) - [DICOM](#dicom) + - [Robotics](#robotics) - [Common](#common) - [Appendix](#appendix) - [Annotation](#annotation) @@ -2064,6 +2065,23 @@ Example of a single dicom task object } ``` +### Robotics + +Supported following project types: + +- Robotics - Task Classification + +#### Create Tasks + +Create a new task (Content creation is required separately). + +```python +task_id = client.create_robotics_task( + project="YOUR_PROJECT_SLUG", + name="TASK_NAME", +) +``` + ### Common APIs for update and delete and count are same over all tasks. diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 24b0348..97cc308 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -1975,6 +1975,53 @@ def create_sequential_pcd_task( return self.api.post_request(endpoint, payload=payload) + def create_robotics_task( + self, + project: str, + name: str, + status: Optional[str] = None, + external_status: Optional[str] = None, + priority: Optional[Priority] = None, + tags: Optional[list[str]] = None, + **kwargs, + ) -> str: + """ + Create a single robotics task without content. + + project is slug of your project (Required). + name is an unique identifier of task in your project (Required). + status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). + external_status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, + tags is a list of tag to be set in advance (Optional). + assignee is slug of assigned user (Optional). + reviewer is slug of review user (Optional). + approver is slug of approve user (Optional). + external_assignee is slug of external assigned user (Optional). + external_reviewer is slug of external review user (Optional). + external_approver is slug of external approve user (Optional). + """ + endpoint = "tasks/robotics" + + payload = {"project": project, "name": name} + if status: + payload["status"] = status + if external_status: + payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority + if tags: + payload["tags"] = tags or [] + + self.__fill_assign_users(payload, **kwargs) + + return self.api.post_request(endpoint, payload=payload) + def import_appendix_file( self, project: str,