Get the status of a task. Args: task_id: The ID of the task to get. use_v3: When True, query apiv3 GET /v3/tasks/{id} (required for segment v2 tasks). Returns: The task data. Raises: TripoRequestError: If the request
(self, task_id: str, *, use_v3: bool = False)
| 175 | await self.close() |
| 176 | |
| 177 | async def get_task(self, task_id: str, *, use_v3: bool = False) -> Task: |
| 178 | """ |
| 179 | Get the status of a task. |
| 180 | |
| 181 | Args: |
| 182 | task_id: The ID of the task to get. |
| 183 | use_v3: When True, query apiv3 GET /v3/tasks/{id} (required for segment v2 tasks). |
| 184 | |
| 185 | Returns: |
| 186 | The task data. |
| 187 | |
| 188 | Raises: |
| 189 | TripoRequestError: If the request fails. |
| 190 | TripoAPIError: If the API returns an error. |
| 191 | """ |
| 192 | if use_v3: |
| 193 | data = await self._v3_get_task(task_id) |
| 194 | else: |
| 195 | response = await self._impl._request("GET", f"/task/{task_id}") |
| 196 | data = response["data"] |
| 197 | return Task.from_dict(self._normalize_v3_task_data(data) if use_v3 else data) |
| 198 | |
| 199 | |
| 200 | async def create_task(self, task_data: Dict[str, Any]) -> str: |