|
36 | 36 | from .payload_constructor import ( |
37 | 37 | construct_append_scenes_payload, |
38 | 38 | construct_model_run_creation_payload, |
| 39 | + construct_taxonomy_payload, |
39 | 40 | ) |
40 | 41 |
|
41 | 42 | WARN_FOR_LARGE_UPLOAD = 50000 |
@@ -408,10 +409,22 @@ def create_image_index(self): |
408 | 409 | return AsyncJob.from_json(response, self._client) |
409 | 410 |
|
410 | 411 | def add_taxonomy( |
411 | | - self, taxonomy_name: str, taxonomy_type: str, labels: List[str] |
| 412 | + self, |
| 413 | + taxonomy_name: str, |
| 414 | + taxonomy_type: str, |
| 415 | + labels: List[str], |
412 | 416 | ): |
413 | | - return self._client.add_taxonomy( |
414 | | - self.id, taxonomy_name, taxonomy_type, labels |
| 417 | + """ |
| 418 | + Creates a new taxonomy. |
| 419 | + Returns a response with dataset_id, taxonomy_name and type for the new taxonomy. |
| 420 | + :param taxonomy_name: name of the taxonomy |
| 421 | + :param type: type of the taxonomy |
| 422 | + :param labels: list of possible labels for the taxonomy |
| 423 | + """ |
| 424 | + return self._client.make_request( |
| 425 | + construct_taxonomy_payload(taxonomy_name, taxonomy_type, labels), |
| 426 | + f"dataset/{self.id}/add_taxonomy", |
| 427 | + requests_command=requests.post, |
415 | 428 | ) |
416 | 429 |
|
417 | 430 | def check_index_status(self, job_id: str): |
|
0 commit comments