label-studio-sdk 1.0.20__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of label-studio-sdk might be problematic. Click here for more details.

Files changed (410) hide show
  1. label_studio_sdk/__init__.py +325 -180
  2. label_studio_sdk/actions/__init__.py +4 -0
  3. label_studio_sdk/actions/client.py +46 -10
  4. label_studio_sdk/actions/types/__init__.py +4 -0
  5. label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
  6. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
  7. label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
  8. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
  9. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
  10. label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
  11. label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
  12. label_studio_sdk/annotations/__init__.py +2 -2
  13. label_studio_sdk/annotations/client.py +379 -243
  14. label_studio_sdk/annotations/types/__init__.py +4 -2
  15. label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
  16. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
  17. label_studio_sdk/base_client.py +28 -24
  18. label_studio_sdk/comments/client.py +378 -140
  19. label_studio_sdk/converter/README.md +207 -0
  20. label_studio_sdk/converter/imports/coco.py +132 -23
  21. label_studio_sdk/core/__init__.py +4 -0
  22. label_studio_sdk/core/unchecked_base_model.py +305 -0
  23. label_studio_sdk/environment.py +1 -1
  24. label_studio_sdk/errors/__init__.py +10 -1
  25. label_studio_sdk/errors/forbidden_error.py +9 -0
  26. label_studio_sdk/errors/method_not_allowed_error.py +9 -0
  27. label_studio_sdk/export_storage/__init__.py +1 -24
  28. label_studio_sdk/export_storage/azure/__init__.py +0 -3
  29. label_studio_sdk/export_storage/azure/client.py +231 -273
  30. label_studio_sdk/export_storage/client.py +5 -5
  31. label_studio_sdk/export_storage/gcs/__init__.py +0 -3
  32. label_studio_sdk/export_storage/gcs/client.py +231 -273
  33. label_studio_sdk/export_storage/local/__init__.py +0 -3
  34. label_studio_sdk/export_storage/local/client.py +211 -253
  35. label_studio_sdk/export_storage/redis/__init__.py +0 -3
  36. label_studio_sdk/export_storage/redis/client.py +239 -281
  37. label_studio_sdk/export_storage/s3/__init__.py +0 -3
  38. label_studio_sdk/export_storage/s3/client.py +254 -296
  39. label_studio_sdk/export_storage/s3s/client.py +694 -210
  40. label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
  41. label_studio_sdk/files/client.py +52 -71
  42. label_studio_sdk/import_storage/__init__.py +1 -24
  43. label_studio_sdk/import_storage/azure/__init__.py +0 -3
  44. label_studio_sdk/import_storage/azure/client.py +249 -299
  45. label_studio_sdk/import_storage/client.py +5 -5
  46. label_studio_sdk/import_storage/gcs/__init__.py +0 -3
  47. label_studio_sdk/import_storage/gcs/client.py +249 -299
  48. label_studio_sdk/import_storage/local/__init__.py +0 -3
  49. label_studio_sdk/import_storage/local/client.py +211 -257
  50. label_studio_sdk/import_storage/redis/__init__.py +0 -3
  51. label_studio_sdk/import_storage/redis/client.py +239 -285
  52. label_studio_sdk/import_storage/s3/__init__.py +0 -3
  53. label_studio_sdk/import_storage/s3/client.py +274 -324
  54. label_studio_sdk/import_storage/s3s/client.py +728 -434
  55. label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
  56. label_studio_sdk/jwt_settings/client.py +56 -58
  57. label_studio_sdk/label_interface/control_tags.py +48 -8
  58. label_studio_sdk/label_interface/interface.py +261 -56
  59. label_studio_sdk/ml/__init__.py +2 -16
  60. label_studio_sdk/ml/client.py +196 -179
  61. label_studio_sdk/ml/types/__init__.py +2 -12
  62. label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
  63. label_studio_sdk/model_providers/__init__.py +3 -0
  64. label_studio_sdk/model_providers/client.py +280 -228
  65. label_studio_sdk/model_providers/types/__init__.py +5 -0
  66. label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
  67. label_studio_sdk/organizations/__init__.py +5 -0
  68. label_studio_sdk/organizations/client.py +331 -0
  69. label_studio_sdk/organizations/members/__init__.py +2 -0
  70. label_studio_sdk/organizations/members/client.py +290 -0
  71. label_studio_sdk/predictions/client.py +29 -77
  72. label_studio_sdk/projects/__init__.py +18 -9
  73. label_studio_sdk/projects/client.py +905 -414
  74. label_studio_sdk/projects/exports/__init__.py +2 -2
  75. label_studio_sdk/projects/exports/client.py +336 -396
  76. label_studio_sdk/projects/exports/client_ext.py +30 -30
  77. label_studio_sdk/projects/exports/types/__init__.py +1 -2
  78. label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
  79. label_studio_sdk/projects/pauses/client.py +114 -105
  80. label_studio_sdk/projects/stats/__init__.py +5 -0
  81. label_studio_sdk/projects/stats/client.py +175 -0
  82. label_studio_sdk/projects/stats/types/__init__.py +8 -0
  83. label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
  84. label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
  85. label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
  86. label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
  87. label_studio_sdk/projects/types/__init__.py +10 -6
  88. label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
  89. label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
  90. label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
  91. label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
  92. label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
  93. label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
  94. label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
  95. label_studio_sdk/prompts/__init__.py +4 -10
  96. label_studio_sdk/prompts/client.py +511 -442
  97. label_studio_sdk/prompts/indicators/__init__.py +3 -0
  98. label_studio_sdk/prompts/indicators/client.py +47 -49
  99. label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
  100. label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
  101. label_studio_sdk/prompts/runs/client.py +113 -135
  102. label_studio_sdk/prompts/types/__init__.py +2 -12
  103. label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
  104. label_studio_sdk/prompts/versions/client.py +372 -312
  105. label_studio_sdk/tasks/__init__.py +2 -2
  106. label_studio_sdk/tasks/client.py +514 -213
  107. label_studio_sdk/tasks/types/__init__.py +1 -2
  108. label_studio_sdk/tokens/client.py +160 -152
  109. label_studio_sdk/tokens/client_ext.py +3 -3
  110. label_studio_sdk/types/__init__.py +258 -142
  111. label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
  112. label_studio_sdk/types/all_roles_project_list.py +197 -0
  113. label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
  114. label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
  115. label_studio_sdk/types/annotated_enum.py +5 -0
  116. label_studio_sdk/types/annotation.py +24 -10
  117. label_studio_sdk/types/annotation_last_action.py +3 -15
  118. label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
  119. label_studio_sdk/types/annotation_request_last_action.py +7 -0
  120. label_studio_sdk/types/assignment_settings.py +31 -0
  121. label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
  122. label_studio_sdk/types/assignment_settings_request.py +32 -0
  123. label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
  124. label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → associated_project.py} +9 -6
  125. label_studio_sdk/types/auth_method_enum.py +5 -0
  126. label_studio_sdk/types/azure_blob_export_storage.py +8 -12
  127. label_studio_sdk/types/azure_blob_import_storage.py +8 -12
  128. label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
  129. label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
  130. label_studio_sdk/types/blank_enum.py +5 -0
  131. label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
  132. label_studio_sdk/types/budget_reset_period_enum.py +5 -0
  133. label_studio_sdk/types/child_filter.py +44 -0
  134. label_studio_sdk/types/comment.py +39 -14
  135. label_studio_sdk/types/comment_request.py +32 -0
  136. label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
  137. label_studio_sdk/types/converted_format.py +5 -5
  138. label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
  139. label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
  140. label_studio_sdk/types/default_role_enum.py +5 -0
  141. label_studio_sdk/types/edition_enum.py +5 -0
  142. label_studio_sdk/types/export.py +7 -7
  143. label_studio_sdk/types/file_upload.py +5 -5
  144. label_studio_sdk/types/filter.py +9 -6
  145. label_studio_sdk/types/filter_group.py +3 -3
  146. label_studio_sdk/types/finished_enum.py +5 -0
  147. label_studio_sdk/types/gcs_export_storage.py +8 -12
  148. label_studio_sdk/types/gcs_import_storage.py +8 -12
  149. label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
  150. label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
  151. label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
  152. label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
  153. label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
  154. label_studio_sdk/types/local_files_export_storage.py +8 -12
  155. label_studio_sdk/types/local_files_import_storage.py +8 -12
  156. label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
  157. label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
  158. label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
  159. label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
  160. label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
  161. label_studio_sdk/types/lse_fields.py +49 -0
  162. label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
  163. label_studio_sdk/types/lse_fields_trial_role.py +8 -0
  164. label_studio_sdk/types/lse_key_indicator_value.py +35 -0
  165. label_studio_sdk/types/lse_organization.py +57 -0
  166. label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
  167. label_studio_sdk/types/lse_project_create.py +196 -0
  168. label_studio_sdk/types/lse_project_create_sampling.py +7 -0
  169. label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
  170. label_studio_sdk/types/lse_project_update.py +215 -0
  171. label_studio_sdk/types/lse_project_update_sampling.py +7 -0
  172. label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
  173. label_studio_sdk/types/lse_s3export_storage.py +134 -0
  174. label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
  175. label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
  176. label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
  177. label_studio_sdk/types/lse_task.py +117 -0
  178. label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
  179. label_studio_sdk/types/lse_task_filter_options.py +63 -0
  180. label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
  181. label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
  182. label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
  183. label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
  184. label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
  185. label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
  186. label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
  187. label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
  188. label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
  189. label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
  190. label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
  191. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
  192. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
  193. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
  194. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
  195. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
  196. label_studio_sdk/types/lse_user.py +49 -0
  197. label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
  198. label_studio_sdk/types/lseapi_token_create.py +21 -0
  199. label_studio_sdk/types/lseapi_token_list.py +21 -0
  200. label_studio_sdk/types/lsejwt_settings.py +32 -0
  201. label_studio_sdk/types/maybe_expanded_comment.py +7 -0
  202. label_studio_sdk/types/ml_backend.py +16 -17
  203. label_studio_sdk/types/mode_enum.py +5 -0
  204. label_studio_sdk/types/model_interface.py +44 -0
  205. label_studio_sdk/types/model_interface_request.py +40 -0
  206. label_studio_sdk/types/model_interface_serializer_get.py +45 -0
  207. label_studio_sdk/types/model_provider_connection.py +48 -17
  208. label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
  209. label_studio_sdk/types/model_provider_connection_request.py +71 -0
  210. label_studio_sdk/types/model_run.py +40 -0
  211. label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
  212. label_studio_sdk/types/null_enum.py +3 -0
  213. label_studio_sdk/types/onboarding_state_enum.py +7 -0
  214. label_studio_sdk/types/organization_billing.py +20 -0
  215. label_studio_sdk/types/organization_id.py +28 -0
  216. label_studio_sdk/types/organization_invite.py +20 -0
  217. label_studio_sdk/types/organization_member.py +37 -0
  218. label_studio_sdk/types/organization_membership.py +24 -0
  219. label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
  220. label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
  221. label_studio_sdk/types/pause.py +55 -14
  222. label_studio_sdk/types/pause_request.py +41 -0
  223. label_studio_sdk/types/prediction.py +7 -11
  224. label_studio_sdk/types/prediction_request.py +56 -0
  225. label_studio_sdk/types/project.py +32 -39
  226. label_studio_sdk/types/project_import.py +12 -13
  227. label_studio_sdk/types/project_label_config.py +2 -2
  228. label_studio_sdk/types/project_label_config_request.py +22 -0
  229. label_studio_sdk/types/project_sampling.py +3 -3
  230. label_studio_sdk/types/project_skip_queue.py +3 -1
  231. label_studio_sdk/types/project_subset_enum.py +5 -0
  232. label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
  233. label_studio_sdk/types/reason_enum.py +7 -0
  234. label_studio_sdk/types/redis_export_storage.py +8 -12
  235. label_studio_sdk/types/redis_import_storage.py +8 -12
  236. label_studio_sdk/types/refined_prompt_response.py +5 -6
  237. label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
  238. label_studio_sdk/types/review_criteria_enum.py +5 -0
  239. label_studio_sdk/types/review_settings.py +80 -0
  240. label_studio_sdk/types/review_settings_request.py +80 -0
  241. label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
  242. label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
  243. label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
  244. label_studio_sdk/types/review_settings_review_criteria.py +7 -0
  245. label_studio_sdk/types/reviewed_enum.py +5 -0
  246. label_studio_sdk/types/role_based_task.py +8 -0
  247. label_studio_sdk/types/s3export_storage.py +8 -12
  248. label_studio_sdk/types/s3import_storage.py +8 -12
  249. label_studio_sdk/types/sampling_enum.py +7 -0
  250. label_studio_sdk/types/scope_enum.py +5 -0
  251. label_studio_sdk/types/selected_items_request.py +23 -0
  252. label_studio_sdk/types/serialization_option.py +2 -6
  253. label_studio_sdk/types/serialization_option_request.py +22 -0
  254. label_studio_sdk/types/serialization_options.py +17 -5
  255. label_studio_sdk/types/serialization_options_request.py +47 -0
  256. label_studio_sdk/types/skill_name_enum.py +5 -0
  257. label_studio_sdk/types/skip_queue_enum.py +5 -0
  258. label_studio_sdk/types/skipped_enum.py +5 -0
  259. label_studio_sdk/types/state_enum.py +5 -0
  260. label_studio_sdk/types/status7bf_enum.py +5 -0
  261. label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
  262. label_studio_sdk/types/third_party_model_version.py +65 -0
  263. label_studio_sdk/types/third_party_model_version_request.py +54 -0
  264. label_studio_sdk/types/token_refresh_response.py +19 -0
  265. label_studio_sdk/types/token_rotate_response.py +19 -0
  266. label_studio_sdk/types/trial_role_enum.py +16 -0
  267. label_studio_sdk/types/user_simple.py +8 -5
  268. label_studio_sdk/types/user_simple_request.py +28 -0
  269. label_studio_sdk/types/version_response.py +49 -0
  270. label_studio_sdk/types/view.py +8 -15
  271. label_studio_sdk/types/webhook.py +9 -13
  272. label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
  273. label_studio_sdk/types/workspace.py +14 -34
  274. label_studio_sdk/types/workspace_member_create.py +27 -0
  275. label_studio_sdk/types/workspace_member_list.py +24 -0
  276. label_studio_sdk/users/client.py +604 -87
  277. label_studio_sdk/users/types/users_get_token_response.py +4 -11
  278. label_studio_sdk/users/types/users_reset_token_response.py +4 -11
  279. label_studio_sdk/versions/__init__.py +0 -3
  280. label_studio_sdk/versions/client.py +14 -14
  281. label_studio_sdk/views/client.py +227 -141
  282. label_studio_sdk/views/types/views_create_request_data.py +2 -2
  283. label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
  284. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
  285. label_studio_sdk/views/types/views_update_request_data.py +2 -2
  286. label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
  287. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
  288. label_studio_sdk/webhooks/__init__.py +36 -2
  289. label_studio_sdk/webhooks/client.py +173 -367
  290. label_studio_sdk/webhooks/types/__init__.py +34 -2
  291. label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
  292. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
  293. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
  294. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
  295. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
  296. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
  297. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
  298. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
  299. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
  300. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
  301. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
  302. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
  303. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
  304. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
  305. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
  306. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
  307. label_studio_sdk/workspaces/__init__.py +1 -2
  308. label_studio_sdk/workspaces/client.py +97 -117
  309. label_studio_sdk/workspaces/members/__init__.py +0 -3
  310. label_studio_sdk/workspaces/members/client.py +65 -81
  311. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/METADATA +1 -1
  312. label_studio_sdk-2.0.0.dist-info/RECORD +424 -0
  313. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/WHEEL +1 -1
  314. label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
  315. label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
  316. label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
  317. label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
  318. label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
  319. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
  320. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
  321. label_studio_sdk/export_storage/local/types/__init__.py +0 -6
  322. label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
  323. label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
  324. label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
  325. label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
  326. label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
  327. label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
  328. label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
  329. label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
  330. label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
  331. label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
  332. label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
  333. label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
  334. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
  335. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
  336. label_studio_sdk/import_storage/local/types/__init__.py +0 -6
  337. label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
  338. label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
  339. label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
  340. label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
  341. label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
  342. label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
  343. label_studio_sdk/ml/types/ml_create_response.py +0 -68
  344. label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
  345. label_studio_sdk/ml/types/ml_update_response.py +0 -68
  346. label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
  347. label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
  348. label_studio_sdk/projects/types/projects_create_response.py +0 -91
  349. label_studio_sdk/projects/types/projects_update_response.py +0 -96
  350. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
  351. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
  352. label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
  353. label_studio_sdk/types/annotation_completed_by.py +0 -6
  354. label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
  355. label_studio_sdk/types/base_task_updated_by.py +0 -7
  356. label_studio_sdk/types/comment_created_by.py +0 -5
  357. label_studio_sdk/types/converted_format_status.py +0 -5
  358. label_studio_sdk/types/data_manager_task_serializer.py +0 -118
  359. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
  360. label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
  361. label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
  362. label_studio_sdk/types/export_format.py +0 -25
  363. label_studio_sdk/types/export_snapshot_status.py +0 -5
  364. label_studio_sdk/types/export_status.py +0 -5
  365. label_studio_sdk/types/gcs_export_storage_status.py +0 -7
  366. label_studio_sdk/types/gcs_import_storage_status.py +0 -7
  367. label_studio_sdk/types/inference_run.py +0 -34
  368. label_studio_sdk/types/inference_run_created_by.py +0 -5
  369. label_studio_sdk/types/inference_run_organization.py +0 -5
  370. label_studio_sdk/types/inference_run_project_subset.py +0 -5
  371. label_studio_sdk/types/key_indicators.py +0 -6
  372. label_studio_sdk/types/key_indicators_item.py +0 -41
  373. label_studio_sdk/types/local_files_export_storage_status.py +0 -7
  374. label_studio_sdk/types/local_files_import_storage_status.py +0 -7
  375. label_studio_sdk/types/ml_backend_auth_method.py +0 -5
  376. label_studio_sdk/types/ml_backend_state.py +0 -5
  377. label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
  378. label_studio_sdk/types/model_provider_connection_organization.py +0 -5
  379. label_studio_sdk/types/model_provider_connection_provider.py +0 -7
  380. label_studio_sdk/types/model_provider_connection_scope.py +0 -5
  381. label_studio_sdk/types/pause_paused_by.py +0 -5
  382. label_studio_sdk/types/project_import_status.py +0 -5
  383. label_studio_sdk/types/prompt.py +0 -71
  384. label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
  385. label_studio_sdk/types/prompt_created_by.py +0 -5
  386. label_studio_sdk/types/prompt_organization.py +0 -5
  387. label_studio_sdk/types/prompt_version.py +0 -32
  388. label_studio_sdk/types/prompt_version_created_by.py +0 -5
  389. label_studio_sdk/types/prompt_version_organization.py +0 -5
  390. label_studio_sdk/types/redis_export_storage_status.py +0 -7
  391. label_studio_sdk/types/redis_import_storage_status.py +0 -7
  392. label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
  393. label_studio_sdk/types/s3export_storage_status.py +0 -7
  394. label_studio_sdk/types/s3import_storage_status.py +0 -7
  395. label_studio_sdk/types/s3s_export_storage.py +0 -73
  396. label_studio_sdk/types/s3s_import_storage_status.py +0 -7
  397. label_studio_sdk/types/task.py +0 -156
  398. label_studio_sdk/types/task_annotators_item.py +0 -5
  399. label_studio_sdk/types/task_comment_authors_item.py +0 -5
  400. label_studio_sdk/types/task_filter_options.py +0 -39
  401. label_studio_sdk/types/webhook_actions_item.py +0 -21
  402. label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
  403. label_studio_sdk/versions/types/__init__.py +0 -6
  404. label_studio_sdk/versions/types/versions_get_response.py +0 -73
  405. label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
  406. label_studio_sdk/workspaces/members/types/__init__.py +0 -6
  407. label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
  408. label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
  409. label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
  410. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/LICENSE +0 -0
@@ -5,15 +5,18 @@ from ..core.client_wrapper import SyncClientWrapper
5
5
  from ..core.request_options import RequestOptions
6
6
  from ..types.project_import import ProjectImport
7
7
  from ..core.jsonable_encoder import jsonable_encoder
8
- from ..core.pydantic_utilities import parse_obj_as
8
+ from ..core.unchecked_base_model import construct_type
9
9
  from json.decoder import JSONDecodeError
10
10
  from ..core.api_error import ApiError
11
11
  from .types.tasks_list_request_fields import TasksListRequestFields
12
12
  from ..core.pagination import SyncPager
13
- from ..types.task import Task
14
- from .types.tasks_list_response import TasksListResponse
15
- from ..types.base_task import BaseTask
16
- from ..types.data_manager_task_serializer import DataManagerTaskSerializer
13
+ from ..types.role_based_task import RoleBasedTask
14
+ from ..types.paginated_role_based_task_list import PaginatedRoleBasedTaskList
15
+ from ..errors.bad_request_error import BadRequestError
16
+ from ..errors.unauthorized_error import UnauthorizedError
17
+ from ..errors.forbidden_error import ForbiddenError
18
+ import datetime as dt
19
+ from ..types.lse_task import LseTask
17
20
  from ..core.client_wrapper import AsyncClientWrapper
18
21
  from ..core.pagination import AsyncPager
19
22
 
@@ -26,24 +29,17 @@ class TasksClient:
26
29
  self._client_wrapper = client_wrapper
27
30
 
28
31
  def create_many_status(
29
- self, id: int, import_pk: str, *, request_options: typing.Optional[RequestOptions] = None
32
+ self, id: int, import_pk: int, *, request_options: typing.Optional[RequestOptions] = None
30
33
  ) -> ProjectImport:
31
34
  """
32
-
33
- Get information about an async project import operation. This can be especially useful to monitor status, as large import jobs can take time.
34
-
35
- You will need the project ID and the unique ID of the import operation.
36
-
37
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
38
-
39
- The import ID is returned as part of the response when you call [Import tasks](import-tasks).
35
+ Return data related to async project import operation
40
36
 
41
37
  Parameters
42
38
  ----------
43
39
  id : int
44
- The project ID.
40
+ A unique integer value identifying this project import.
45
41
 
46
- import_pk : str
42
+ import_pk : int
47
43
 
48
44
  request_options : typing.Optional[RequestOptions]
49
45
  Request-specific configuration.
@@ -62,7 +58,7 @@ class TasksClient:
62
58
  )
63
59
  client.tasks.create_many_status(
64
60
  id=1,
65
- import_pk="import_pk",
61
+ import_pk=1,
66
62
  )
67
63
  """
68
64
  _response = self._client_wrapper.httpx_client.request(
@@ -74,7 +70,7 @@ class TasksClient:
74
70
  if 200 <= _response.status_code < 300:
75
71
  return typing.cast(
76
72
  ProjectImport,
77
- parse_obj_as(
73
+ construct_type(
78
74
  type_=ProjectImport, # type: ignore
79
75
  object_=_response.json(),
80
76
  ),
@@ -86,11 +82,8 @@ class TasksClient:
86
82
 
87
83
  def delete_all_tasks(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
88
84
  """
89
-
90
85
  Delete all tasks from a specific project.
91
86
 
92
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
93
-
94
87
  Parameters
95
88
  ----------
96
89
  id : int
@@ -130,66 +123,74 @@ class TasksClient:
130
123
  def list(
131
124
  self,
132
125
  *,
126
+ fields: typing.Optional[TasksListRequestFields] = None,
127
+ include: typing.Optional[str] = None,
128
+ only_annotated: typing.Optional[bool] = None,
133
129
  page: typing.Optional[int] = None,
134
130
  page_size: typing.Optional[int] = None,
135
- view: typing.Optional[int] = None,
136
131
  project: typing.Optional[int] = None,
132
+ query: typing.Optional[str] = None,
137
133
  resolve_uri: typing.Optional[bool] = None,
138
- fields: typing.Optional[TasksListRequestFields] = None,
139
134
  review: typing.Optional[bool] = None,
140
- include: typing.Optional[str] = None,
141
- query: typing.Optional[str] = None,
135
+ selected_items: typing.Optional[str] = None,
136
+ view: typing.Optional[int] = None,
142
137
  request_options: typing.Optional[RequestOptions] = None,
143
- ) -> SyncPager[Task]:
138
+ ) -> SyncPager[RoleBasedTask]:
144
139
  """
140
+ Retrieve a paginated list of tasks. The response format varies based on the user's role in the organization:
141
+ - **Admin/Owner**: Full task details with all annotations, reviews, and metadata
142
+ - **Reviewer**: Task details optimized for review workflow
143
+ - **Annotator**: Task details filtered to show only user's own annotations and assignments
145
144
 
146
- Retrieve a list of tasks.
145
+ Parameters
146
+ ----------
147
+ fields : typing.Optional[TasksListRequestFields]
148
+ Set to "all" if you want to include annotations and predictions in the response. Defaults to task_only
147
149
 
148
- You can use the query parameters to filter the list by project and/or view (a tab within the Data Manager). You can also optionally add pagination to make the response easier to parse.
150
+ include : typing.Optional[str]
151
+ Specify which fields to include in the response
149
152
 
150
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list). The view ID can be found using [List views](../views/list).
153
+ only_annotated : typing.Optional[bool]
154
+ Filter to show only tasks that have annotations
151
155
 
152
- Parameters
153
- ----------
154
156
  page : typing.Optional[int]
155
157
  A page number within the paginated result set.
156
158
 
157
159
  page_size : typing.Optional[int]
158
160
  Number of results to return per page.
159
161
 
160
- view : typing.Optional[int]
161
- View ID
162
-
163
162
  project : typing.Optional[int]
164
163
  Project ID
165
164
 
165
+ query : typing.Optional[str]
166
+ Additional query to filter tasks. It must be JSON encoded string of dict containing one of the following parameters: {"filters": ..., "selectedItems": ..., "ordering": ...}. Check Data Manager > Create View > see data field for more details about filters, selectedItems and ordering.
167
+
168
+ filters: dict with "conjunction" string ("or" or "and") and list of filters in "items" array. Each filter is a dictionary with keys: "filter", "operator", "type", "value". Read more about available filters
169
+ Example: {"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}
170
+ selectedItems: dictionary with keys: "all", "included", "excluded". If "all" is false, "included" must be used. If "all" is true, "excluded" must be used.
171
+ Examples: {"all": false, "included": [1, 2, 3]} or {"all": true, "excluded": [4, 5]}
172
+ ordering: list of fields to order by. Currently, ordering is supported by only one parameter.
173
+ Example: ["completed_at"]
174
+
166
175
  resolve_uri : typing.Optional[bool]
167
176
  Resolve task data URIs using Cloud Storage
168
177
 
169
- fields : typing.Optional[TasksListRequestFields]
170
- Set to "all" if you want to include annotations and predictions in the response
171
-
172
178
  review : typing.Optional[bool]
173
179
  Get tasks for review
174
180
 
175
- include : typing.Optional[str]
176
- Specify which fields to include in the response
177
-
178
- query : typing.Optional[str]
179
- Additional query to filter tasks. It must be JSON encoded string of dict containing one of the following parameters: `{"filters": ..., "selectedItems": ..., "ordering": ...}`. Check [Data Manager > Create View > see `data` field](#tag/Data-Manager/operation/api_dm_views_create) for more details about filters, selectedItems and ordering.
181
+ selected_items : typing.Optional[str]
182
+ JSON string of selected task IDs for review workflow
180
183
 
181
- * **filters**: dict with `"conjunction"` string (`"or"` or `"and"`) and list of filters in `"items"` array. Each filter is a dictionary with keys: `"filter"`, `"operator"`, `"type"`, `"value"`. [Read more about available filters](https://labelstud.io/sdk/data_manager.html)<br/> Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
182
- * **selectedItems**: dictionary with keys: `"all"`, `"included"`, `"excluded"`. If "all" is `false`, `"included"` must be used. If "all" is `true`, `"excluded"` must be used.<br/> Examples: `{"all": false, "included": [1, 2, 3]}` or `{"all": true, "excluded": [4, 5]}`
183
- * **ordering**: list of fields to order by. Currently, ordering is supported by only one parameter. <br/>
184
- Example: `["completed_at"]`
184
+ view : typing.Optional[int]
185
+ View ID
185
186
 
186
187
  request_options : typing.Optional[RequestOptions]
187
188
  Request-specific configuration.
188
189
 
189
190
  Returns
190
191
  -------
191
- SyncPager[Task]
192
- List of Tasks
192
+ SyncPager[RoleBasedTask]
193
+
193
194
 
194
195
  Examples
195
196
  --------
@@ -210,42 +211,76 @@ class TasksClient:
210
211
  "api/tasks/",
211
212
  method="GET",
212
213
  params={
214
+ "fields": fields,
215
+ "include": include,
216
+ "only_annotated": only_annotated,
213
217
  "page": page,
214
218
  "page_size": page_size,
215
- "view": view,
216
219
  "project": project,
220
+ "query": query,
217
221
  "resolve_uri": resolve_uri,
218
- "fields": fields,
219
222
  "review": review,
220
- "include": include,
221
- "query": query,
223
+ "selectedItems": selected_items,
224
+ "view": view,
222
225
  },
223
226
  request_options=request_options,
224
227
  )
225
228
  try:
226
229
  if 200 <= _response.status_code < 300:
227
230
  _parsed_response = typing.cast(
228
- TasksListResponse,
229
- parse_obj_as(
230
- type_=TasksListResponse, # type: ignore
231
+ PaginatedRoleBasedTaskList,
232
+ construct_type(
233
+ type_=PaginatedRoleBasedTaskList, # type: ignore
231
234
  object_=_response.json(),
232
235
  ),
233
236
  )
234
237
  _has_next = True
235
238
  _get_next = lambda: self.list(
239
+ fields=fields,
240
+ include=include,
241
+ only_annotated=only_annotated,
236
242
  page=page + 1,
237
243
  page_size=page_size,
238
- view=view,
239
244
  project=project,
245
+ query=query,
240
246
  resolve_uri=resolve_uri,
241
- fields=fields,
242
247
  review=review,
243
- include=include,
244
- query=query,
248
+ selected_items=selected_items,
249
+ view=view,
245
250
  request_options=request_options,
246
251
  )
247
252
  _items = _parsed_response.tasks
248
253
  return SyncPager(has_next=_has_next, items=_items, get_next=_get_next)
254
+ if _response.status_code == 400:
255
+ raise BadRequestError(
256
+ typing.cast(
257
+ typing.Optional[typing.Any],
258
+ construct_type(
259
+ type_=typing.Optional[typing.Any], # type: ignore
260
+ object_=_response.json(),
261
+ ),
262
+ )
263
+ )
264
+ if _response.status_code == 401:
265
+ raise UnauthorizedError(
266
+ typing.cast(
267
+ typing.Optional[typing.Any],
268
+ construct_type(
269
+ type_=typing.Optional[typing.Any], # type: ignore
270
+ object_=_response.json(),
271
+ ),
272
+ )
273
+ )
274
+ if _response.status_code == 403:
275
+ raise ForbiddenError(
276
+ typing.cast(
277
+ typing.Optional[typing.Any],
278
+ construct_type(
279
+ type_=typing.Optional[typing.Any], # type: ignore
280
+ object_=_response.json(),
281
+ ),
282
+ )
283
+ )
249
284
  _response_json = _response.json()
250
285
  except JSONDecodeError:
251
286
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -254,33 +289,78 @@ class TasksClient:
254
289
  def create(
255
290
  self,
256
291
  *,
257
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
292
+ data: typing.Optional[typing.Any] = OMIT,
293
+ meta: typing.Optional[typing.Optional[typing.Any]] = OMIT,
294
+ is_labeled: typing.Optional[bool] = OMIT,
295
+ overlap: typing.Optional[int] = OMIT,
296
+ inner_id: typing.Optional[int] = OMIT,
297
+ total_annotations: typing.Optional[int] = OMIT,
298
+ cancelled_annotations: typing.Optional[int] = OMIT,
299
+ total_predictions: typing.Optional[int] = OMIT,
300
+ comment_count: typing.Optional[int] = OMIT,
301
+ unresolved_comment_count: typing.Optional[int] = OMIT,
302
+ last_comment_updated_at: typing.Optional[dt.datetime] = OMIT,
258
303
  project: typing.Optional[int] = OMIT,
304
+ updated_by: typing.Optional[int] = OMIT,
305
+ file_upload: typing.Optional[int] = OMIT,
306
+ comment_authors: typing.Optional[typing.Sequence[int]] = OMIT,
259
307
  request_options: typing.Optional[RequestOptions] = None,
260
- ) -> BaseTask:
308
+ ) -> LseTask:
261
309
  """
310
+ Create a new task
262
311
 
263
- Create a new labeling task in Label Studio.
312
+ Parameters
313
+ ----------
314
+ data : typing.Optional[typing.Any]
264
315
 
265
- The data you provide depends on your labeling config and data type.
316
+ meta : typing.Optional[typing.Optional[typing.Any]]
266
317
 
267
- You will also need to provide a project ID. The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
318
+ is_labeled : typing.Optional[bool]
319
+ True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
268
320
 
269
- Parameters
270
- ----------
271
- data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
272
- Task data dictionary with arbitrary keys and values
321
+ overlap : typing.Optional[int]
322
+ Number of distinct annotators that processed the current task
323
+
324
+ inner_id : typing.Optional[int]
325
+ Internal task ID in the project, starts with 1
326
+
327
+ total_annotations : typing.Optional[int]
328
+ Number of total annotations for the current task except cancelled annotations
329
+
330
+ cancelled_annotations : typing.Optional[int]
331
+ Number of total cancelled annotations for the current task
332
+
333
+ total_predictions : typing.Optional[int]
334
+ Number of total predictions for the current task
335
+
336
+ comment_count : typing.Optional[int]
337
+ Number of comments in the task including all annotations
338
+
339
+ unresolved_comment_count : typing.Optional[int]
340
+ Number of unresolved comments in the task including all annotations
341
+
342
+ last_comment_updated_at : typing.Optional[dt.datetime]
343
+ When the last comment was updated
273
344
 
274
345
  project : typing.Optional[int]
275
- Project ID
346
+ Project ID for this task
347
+
348
+ updated_by : typing.Optional[int]
349
+ Last annotator or reviewer who updated this task
350
+
351
+ file_upload : typing.Optional[int]
352
+ Uploaded file used as data source for this task
353
+
354
+ comment_authors : typing.Optional[typing.Sequence[int]]
355
+ Users who wrote comments
276
356
 
277
357
  request_options : typing.Optional[RequestOptions]
278
358
  Request-specific configuration.
279
359
 
280
360
  Returns
281
361
  -------
282
- BaseTask
283
- Created task
362
+ LseTask
363
+
284
364
 
285
365
  Examples
286
366
  --------
@@ -290,8 +370,7 @@ class TasksClient:
290
370
  api_key="YOUR_API_KEY",
291
371
  )
292
372
  client.tasks.create(
293
- data={"image": "https://example.com/image.jpg", "text": "Hello, world!"},
294
- project=1,
373
+ data={"key": "value"},
295
374
  )
296
375
  """
297
376
  _response = self._client_wrapper.httpx_client.request(
@@ -299,7 +378,20 @@ class TasksClient:
299
378
  method="POST",
300
379
  json={
301
380
  "data": data,
381
+ "meta": meta,
382
+ "is_labeled": is_labeled,
383
+ "overlap": overlap,
384
+ "inner_id": inner_id,
385
+ "total_annotations": total_annotations,
386
+ "cancelled_annotations": cancelled_annotations,
387
+ "total_predictions": total_predictions,
388
+ "comment_count": comment_count,
389
+ "unresolved_comment_count": unresolved_comment_count,
390
+ "last_comment_updated_at": last_comment_updated_at,
302
391
  "project": project,
392
+ "updated_by": updated_by,
393
+ "file_upload": file_upload,
394
+ "comment_authors": comment_authors,
303
395
  },
304
396
  headers={
305
397
  "content-type": "application/json",
@@ -310,9 +402,9 @@ class TasksClient:
310
402
  try:
311
403
  if 200 <= _response.status_code < 300:
312
404
  return typing.cast(
313
- BaseTask,
314
- parse_obj_as(
315
- type_=BaseTask, # type: ignore
405
+ LseTask,
406
+ construct_type(
407
+ type_=LseTask, # type: ignore
316
408
  object_=_response.json(),
317
409
  ),
318
410
  )
@@ -321,11 +413,9 @@ class TasksClient:
321
413
  raise ApiError(status_code=_response.status_code, body=_response.text)
322
414
  raise ApiError(status_code=_response.status_code, body=_response_json)
323
415
 
324
- def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DataManagerTaskSerializer:
416
+ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RoleBasedTask:
325
417
  """
326
-
327
418
  Get task data, metadata, annotations and other attributes for a specific labeling task by task ID.
328
- The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
329
419
 
330
420
  Parameters
331
421
  ----------
@@ -337,8 +427,8 @@ class TasksClient:
337
427
 
338
428
  Returns
339
429
  -------
340
- DataManagerTaskSerializer
341
- Task
430
+ RoleBasedTask
431
+
342
432
 
343
433
  Examples
344
434
  --------
@@ -359,9 +449,9 @@ class TasksClient:
359
449
  try:
360
450
  if 200 <= _response.status_code < 300:
361
451
  return typing.cast(
362
- DataManagerTaskSerializer,
363
- parse_obj_as(
364
- type_=DataManagerTaskSerializer, # type: ignore
452
+ RoleBasedTask,
453
+ construct_type(
454
+ type_=RoleBasedTask, # type: ignore
365
455
  object_=_response.json(),
366
456
  ),
367
457
  )
@@ -372,12 +462,7 @@ class TasksClient:
372
462
 
373
463
  def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
374
464
  """
375
-
376
- Delete a task in Label Studio.
377
-
378
- You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
379
-
380
- <Warning>This action cannot be undone.</Warning>
465
+ Delete a task in Label Studio. This action cannot be undone!
381
466
 
382
467
  Parameters
383
468
  ----------
@@ -419,34 +504,89 @@ class TasksClient:
419
504
  self,
420
505
  id: str,
421
506
  *,
422
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
507
+ inner_id: typing.Optional[int] = OMIT,
508
+ cancelled_annotations: typing.Optional[int] = OMIT,
509
+ total_annotations: typing.Optional[int] = OMIT,
510
+ total_predictions: typing.Optional[int] = OMIT,
511
+ completed_at: typing.Optional[dt.datetime] = OMIT,
512
+ predictions_score: typing.Optional[float] = OMIT,
513
+ avg_lead_time: typing.Optional[float] = OMIT,
514
+ draft_exists: typing.Optional[bool] = OMIT,
515
+ reviewed: typing.Optional[bool] = OMIT,
516
+ reviews_accepted: typing.Optional[int] = OMIT,
517
+ reviews_rejected: typing.Optional[int] = OMIT,
518
+ ground_truth: typing.Optional[bool] = OMIT,
519
+ data: typing.Optional[typing.Optional[typing.Any]] = OMIT,
520
+ meta: typing.Optional[typing.Optional[typing.Any]] = OMIT,
521
+ is_labeled: typing.Optional[bool] = OMIT,
522
+ overlap: typing.Optional[int] = OMIT,
523
+ comment_count: typing.Optional[int] = OMIT,
524
+ unresolved_comment_count: typing.Optional[int] = OMIT,
525
+ last_comment_updated_at: typing.Optional[dt.datetime] = OMIT,
423
526
  project: typing.Optional[int] = OMIT,
424
527
  request_options: typing.Optional[RequestOptions] = None,
425
- ) -> BaseTask:
528
+ ) -> RoleBasedTask:
426
529
  """
427
-
428
530
  Update the attributes of an existing labeling task.
429
531
 
430
- You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
431
-
432
532
  Parameters
433
533
  ----------
434
534
  id : str
435
535
  Task ID
436
536
 
437
- data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
438
- Task data dictionary with arbitrary keys and values
537
+ inner_id : typing.Optional[int]
538
+
539
+ cancelled_annotations : typing.Optional[int]
540
+
541
+ total_annotations : typing.Optional[int]
542
+
543
+ total_predictions : typing.Optional[int]
544
+
545
+ completed_at : typing.Optional[dt.datetime]
546
+
547
+ predictions_score : typing.Optional[float]
548
+
549
+ avg_lead_time : typing.Optional[float]
550
+
551
+ draft_exists : typing.Optional[bool]
552
+
553
+ reviewed : typing.Optional[bool]
554
+
555
+ reviews_accepted : typing.Optional[int]
556
+
557
+ reviews_rejected : typing.Optional[int]
558
+
559
+ ground_truth : typing.Optional[bool]
560
+
561
+ data : typing.Optional[typing.Optional[typing.Any]]
562
+
563
+ meta : typing.Optional[typing.Optional[typing.Any]]
564
+
565
+ is_labeled : typing.Optional[bool]
566
+ True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
567
+
568
+ overlap : typing.Optional[int]
569
+ Number of distinct annotators that processed the current task
570
+
571
+ comment_count : typing.Optional[int]
572
+ Number of comments in the task including all annotations
573
+
574
+ unresolved_comment_count : typing.Optional[int]
575
+ Number of unresolved comments in the task including all annotations
576
+
577
+ last_comment_updated_at : typing.Optional[dt.datetime]
578
+ When the last comment was updated
439
579
 
440
580
  project : typing.Optional[int]
441
- Project ID
581
+ Project ID for this task
442
582
 
443
583
  request_options : typing.Optional[RequestOptions]
444
584
  Request-specific configuration.
445
585
 
446
586
  Returns
447
587
  -------
448
- BaseTask
449
- Updated task
588
+ RoleBasedTask
589
+
450
590
 
451
591
  Examples
452
592
  --------
@@ -457,15 +597,31 @@ class TasksClient:
457
597
  )
458
598
  client.tasks.update(
459
599
  id="id",
460
- data={"image": "https://example.com/image.jpg", "text": "Hello, world!"},
461
- project=1,
462
600
  )
463
601
  """
464
602
  _response = self._client_wrapper.httpx_client.request(
465
603
  f"api/tasks/{jsonable_encoder(id)}/",
466
604
  method="PATCH",
467
605
  json={
606
+ "inner_id": inner_id,
607
+ "cancelled_annotations": cancelled_annotations,
608
+ "total_annotations": total_annotations,
609
+ "total_predictions": total_predictions,
610
+ "completed_at": completed_at,
611
+ "predictions_score": predictions_score,
612
+ "avg_lead_time": avg_lead_time,
613
+ "draft_exists": draft_exists,
614
+ "reviewed": reviewed,
615
+ "reviews_accepted": reviews_accepted,
616
+ "reviews_rejected": reviews_rejected,
617
+ "ground_truth": ground_truth,
468
618
  "data": data,
619
+ "meta": meta,
620
+ "is_labeled": is_labeled,
621
+ "overlap": overlap,
622
+ "comment_count": comment_count,
623
+ "unresolved_comment_count": unresolved_comment_count,
624
+ "last_comment_updated_at": last_comment_updated_at,
469
625
  "project": project,
470
626
  },
471
627
  headers={
@@ -477,9 +633,9 @@ class TasksClient:
477
633
  try:
478
634
  if 200 <= _response.status_code < 300:
479
635
  return typing.cast(
480
- BaseTask,
481
- parse_obj_as(
482
- type_=BaseTask, # type: ignore
636
+ RoleBasedTask,
637
+ construct_type(
638
+ type_=RoleBasedTask, # type: ignore
483
639
  object_=_response.json(),
484
640
  ),
485
641
  )
@@ -494,24 +650,17 @@ class AsyncTasksClient:
494
650
  self._client_wrapper = client_wrapper
495
651
 
496
652
  async def create_many_status(
497
- self, id: int, import_pk: str, *, request_options: typing.Optional[RequestOptions] = None
653
+ self, id: int, import_pk: int, *, request_options: typing.Optional[RequestOptions] = None
498
654
  ) -> ProjectImport:
499
655
  """
500
-
501
- Get information about an async project import operation. This can be especially useful to monitor status, as large import jobs can take time.
502
-
503
- You will need the project ID and the unique ID of the import operation.
504
-
505
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
506
-
507
- The import ID is returned as part of the response when you call [Import tasks](import-tasks).
656
+ Return data related to async project import operation
508
657
 
509
658
  Parameters
510
659
  ----------
511
660
  id : int
512
- The project ID.
661
+ A unique integer value identifying this project import.
513
662
 
514
- import_pk : str
663
+ import_pk : int
515
664
 
516
665
  request_options : typing.Optional[RequestOptions]
517
666
  Request-specific configuration.
@@ -535,7 +684,7 @@ class AsyncTasksClient:
535
684
  async def main() -> None:
536
685
  await client.tasks.create_many_status(
537
686
  id=1,
538
- import_pk="import_pk",
687
+ import_pk=1,
539
688
  )
540
689
 
541
690
 
@@ -550,7 +699,7 @@ class AsyncTasksClient:
550
699
  if 200 <= _response.status_code < 300:
551
700
  return typing.cast(
552
701
  ProjectImport,
553
- parse_obj_as(
702
+ construct_type(
554
703
  type_=ProjectImport, # type: ignore
555
704
  object_=_response.json(),
556
705
  ),
@@ -562,11 +711,8 @@ class AsyncTasksClient:
562
711
 
563
712
  async def delete_all_tasks(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
564
713
  """
565
-
566
714
  Delete all tasks from a specific project.
567
715
 
568
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
569
-
570
716
  Parameters
571
717
  ----------
572
718
  id : int
@@ -614,66 +760,74 @@ class AsyncTasksClient:
614
760
  async def list(
615
761
  self,
616
762
  *,
763
+ fields: typing.Optional[TasksListRequestFields] = None,
764
+ include: typing.Optional[str] = None,
765
+ only_annotated: typing.Optional[bool] = None,
617
766
  page: typing.Optional[int] = None,
618
767
  page_size: typing.Optional[int] = None,
619
- view: typing.Optional[int] = None,
620
768
  project: typing.Optional[int] = None,
769
+ query: typing.Optional[str] = None,
621
770
  resolve_uri: typing.Optional[bool] = None,
622
- fields: typing.Optional[TasksListRequestFields] = None,
623
771
  review: typing.Optional[bool] = None,
624
- include: typing.Optional[str] = None,
625
- query: typing.Optional[str] = None,
772
+ selected_items: typing.Optional[str] = None,
773
+ view: typing.Optional[int] = None,
626
774
  request_options: typing.Optional[RequestOptions] = None,
627
- ) -> AsyncPager[Task]:
775
+ ) -> AsyncPager[RoleBasedTask]:
628
776
  """
777
+ Retrieve a paginated list of tasks. The response format varies based on the user's role in the organization:
778
+ - **Admin/Owner**: Full task details with all annotations, reviews, and metadata
779
+ - **Reviewer**: Task details optimized for review workflow
780
+ - **Annotator**: Task details filtered to show only user's own annotations and assignments
629
781
 
630
- Retrieve a list of tasks.
782
+ Parameters
783
+ ----------
784
+ fields : typing.Optional[TasksListRequestFields]
785
+ Set to "all" if you want to include annotations and predictions in the response. Defaults to task_only
631
786
 
632
- You can use the query parameters to filter the list by project and/or view (a tab within the Data Manager). You can also optionally add pagination to make the response easier to parse.
787
+ include : typing.Optional[str]
788
+ Specify which fields to include in the response
633
789
 
634
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list). The view ID can be found using [List views](../views/list).
790
+ only_annotated : typing.Optional[bool]
791
+ Filter to show only tasks that have annotations
635
792
 
636
- Parameters
637
- ----------
638
793
  page : typing.Optional[int]
639
794
  A page number within the paginated result set.
640
795
 
641
796
  page_size : typing.Optional[int]
642
797
  Number of results to return per page.
643
798
 
644
- view : typing.Optional[int]
645
- View ID
646
-
647
799
  project : typing.Optional[int]
648
800
  Project ID
649
801
 
802
+ query : typing.Optional[str]
803
+ Additional query to filter tasks. It must be JSON encoded string of dict containing one of the following parameters: {"filters": ..., "selectedItems": ..., "ordering": ...}. Check Data Manager > Create View > see data field for more details about filters, selectedItems and ordering.
804
+
805
+ filters: dict with "conjunction" string ("or" or "and") and list of filters in "items" array. Each filter is a dictionary with keys: "filter", "operator", "type", "value". Read more about available filters
806
+ Example: {"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}
807
+ selectedItems: dictionary with keys: "all", "included", "excluded". If "all" is false, "included" must be used. If "all" is true, "excluded" must be used.
808
+ Examples: {"all": false, "included": [1, 2, 3]} or {"all": true, "excluded": [4, 5]}
809
+ ordering: list of fields to order by. Currently, ordering is supported by only one parameter.
810
+ Example: ["completed_at"]
811
+
650
812
  resolve_uri : typing.Optional[bool]
651
813
  Resolve task data URIs using Cloud Storage
652
814
 
653
- fields : typing.Optional[TasksListRequestFields]
654
- Set to "all" if you want to include annotations and predictions in the response
655
-
656
815
  review : typing.Optional[bool]
657
816
  Get tasks for review
658
817
 
659
- include : typing.Optional[str]
660
- Specify which fields to include in the response
661
-
662
- query : typing.Optional[str]
663
- Additional query to filter tasks. It must be JSON encoded string of dict containing one of the following parameters: `{"filters": ..., "selectedItems": ..., "ordering": ...}`. Check [Data Manager > Create View > see `data` field](#tag/Data-Manager/operation/api_dm_views_create) for more details about filters, selectedItems and ordering.
818
+ selected_items : typing.Optional[str]
819
+ JSON string of selected task IDs for review workflow
664
820
 
665
- * **filters**: dict with `"conjunction"` string (`"or"` or `"and"`) and list of filters in `"items"` array. Each filter is a dictionary with keys: `"filter"`, `"operator"`, `"type"`, `"value"`. [Read more about available filters](https://labelstud.io/sdk/data_manager.html)<br/> Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
666
- * **selectedItems**: dictionary with keys: `"all"`, `"included"`, `"excluded"`. If "all" is `false`, `"included"` must be used. If "all" is `true`, `"excluded"` must be used.<br/> Examples: `{"all": false, "included": [1, 2, 3]}` or `{"all": true, "excluded": [4, 5]}`
667
- * **ordering**: list of fields to order by. Currently, ordering is supported by only one parameter. <br/>
668
- Example: `["completed_at"]`
821
+ view : typing.Optional[int]
822
+ View ID
669
823
 
670
824
  request_options : typing.Optional[RequestOptions]
671
825
  Request-specific configuration.
672
826
 
673
827
  Returns
674
828
  -------
675
- AsyncPager[Task]
676
- List of Tasks
829
+ AsyncPager[RoleBasedTask]
830
+
677
831
 
678
832
  Examples
679
833
  --------
@@ -702,42 +856,76 @@ class AsyncTasksClient:
702
856
  "api/tasks/",
703
857
  method="GET",
704
858
  params={
859
+ "fields": fields,
860
+ "include": include,
861
+ "only_annotated": only_annotated,
705
862
  "page": page,
706
863
  "page_size": page_size,
707
- "view": view,
708
864
  "project": project,
865
+ "query": query,
709
866
  "resolve_uri": resolve_uri,
710
- "fields": fields,
711
867
  "review": review,
712
- "include": include,
713
- "query": query,
868
+ "selectedItems": selected_items,
869
+ "view": view,
714
870
  },
715
871
  request_options=request_options,
716
872
  )
717
873
  try:
718
874
  if 200 <= _response.status_code < 300:
719
875
  _parsed_response = typing.cast(
720
- TasksListResponse,
721
- parse_obj_as(
722
- type_=TasksListResponse, # type: ignore
876
+ PaginatedRoleBasedTaskList,
877
+ construct_type(
878
+ type_=PaginatedRoleBasedTaskList, # type: ignore
723
879
  object_=_response.json(),
724
880
  ),
725
881
  )
726
882
  _has_next = True
727
883
  _get_next = lambda: self.list(
884
+ fields=fields,
885
+ include=include,
886
+ only_annotated=only_annotated,
728
887
  page=page + 1,
729
888
  page_size=page_size,
730
- view=view,
731
889
  project=project,
890
+ query=query,
732
891
  resolve_uri=resolve_uri,
733
- fields=fields,
734
892
  review=review,
735
- include=include,
736
- query=query,
893
+ selected_items=selected_items,
894
+ view=view,
737
895
  request_options=request_options,
738
896
  )
739
897
  _items = _parsed_response.tasks
740
898
  return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next)
899
+ if _response.status_code == 400:
900
+ raise BadRequestError(
901
+ typing.cast(
902
+ typing.Optional[typing.Any],
903
+ construct_type(
904
+ type_=typing.Optional[typing.Any], # type: ignore
905
+ object_=_response.json(),
906
+ ),
907
+ )
908
+ )
909
+ if _response.status_code == 401:
910
+ raise UnauthorizedError(
911
+ typing.cast(
912
+ typing.Optional[typing.Any],
913
+ construct_type(
914
+ type_=typing.Optional[typing.Any], # type: ignore
915
+ object_=_response.json(),
916
+ ),
917
+ )
918
+ )
919
+ if _response.status_code == 403:
920
+ raise ForbiddenError(
921
+ typing.cast(
922
+ typing.Optional[typing.Any],
923
+ construct_type(
924
+ type_=typing.Optional[typing.Any], # type: ignore
925
+ object_=_response.json(),
926
+ ),
927
+ )
928
+ )
741
929
  _response_json = _response.json()
742
930
  except JSONDecodeError:
743
931
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -746,33 +934,78 @@ class AsyncTasksClient:
746
934
  async def create(
747
935
  self,
748
936
  *,
749
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
937
+ data: typing.Optional[typing.Any] = OMIT,
938
+ meta: typing.Optional[typing.Optional[typing.Any]] = OMIT,
939
+ is_labeled: typing.Optional[bool] = OMIT,
940
+ overlap: typing.Optional[int] = OMIT,
941
+ inner_id: typing.Optional[int] = OMIT,
942
+ total_annotations: typing.Optional[int] = OMIT,
943
+ cancelled_annotations: typing.Optional[int] = OMIT,
944
+ total_predictions: typing.Optional[int] = OMIT,
945
+ comment_count: typing.Optional[int] = OMIT,
946
+ unresolved_comment_count: typing.Optional[int] = OMIT,
947
+ last_comment_updated_at: typing.Optional[dt.datetime] = OMIT,
750
948
  project: typing.Optional[int] = OMIT,
949
+ updated_by: typing.Optional[int] = OMIT,
950
+ file_upload: typing.Optional[int] = OMIT,
951
+ comment_authors: typing.Optional[typing.Sequence[int]] = OMIT,
751
952
  request_options: typing.Optional[RequestOptions] = None,
752
- ) -> BaseTask:
953
+ ) -> LseTask:
753
954
  """
955
+ Create a new task
754
956
 
755
- Create a new labeling task in Label Studio.
957
+ Parameters
958
+ ----------
959
+ data : typing.Optional[typing.Any]
756
960
 
757
- The data you provide depends on your labeling config and data type.
961
+ meta : typing.Optional[typing.Optional[typing.Any]]
758
962
 
759
- You will also need to provide a project ID. The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
963
+ is_labeled : typing.Optional[bool]
964
+ True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
760
965
 
761
- Parameters
762
- ----------
763
- data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
764
- Task data dictionary with arbitrary keys and values
966
+ overlap : typing.Optional[int]
967
+ Number of distinct annotators that processed the current task
968
+
969
+ inner_id : typing.Optional[int]
970
+ Internal task ID in the project, starts with 1
971
+
972
+ total_annotations : typing.Optional[int]
973
+ Number of total annotations for the current task except cancelled annotations
974
+
975
+ cancelled_annotations : typing.Optional[int]
976
+ Number of total cancelled annotations for the current task
977
+
978
+ total_predictions : typing.Optional[int]
979
+ Number of total predictions for the current task
980
+
981
+ comment_count : typing.Optional[int]
982
+ Number of comments in the task including all annotations
983
+
984
+ unresolved_comment_count : typing.Optional[int]
985
+ Number of unresolved comments in the task including all annotations
986
+
987
+ last_comment_updated_at : typing.Optional[dt.datetime]
988
+ When the last comment was updated
765
989
 
766
990
  project : typing.Optional[int]
767
- Project ID
991
+ Project ID for this task
992
+
993
+ updated_by : typing.Optional[int]
994
+ Last annotator or reviewer who updated this task
995
+
996
+ file_upload : typing.Optional[int]
997
+ Uploaded file used as data source for this task
998
+
999
+ comment_authors : typing.Optional[typing.Sequence[int]]
1000
+ Users who wrote comments
768
1001
 
769
1002
  request_options : typing.Optional[RequestOptions]
770
1003
  Request-specific configuration.
771
1004
 
772
1005
  Returns
773
1006
  -------
774
- BaseTask
775
- Created task
1007
+ LseTask
1008
+
776
1009
 
777
1010
  Examples
778
1011
  --------
@@ -787,11 +1020,7 @@ class AsyncTasksClient:
787
1020
 
788
1021
  async def main() -> None:
789
1022
  await client.tasks.create(
790
- data={
791
- "image": "https://example.com/image.jpg",
792
- "text": "Hello, world!",
793
- },
794
- project=1,
1023
+ data={"key": "value"},
795
1024
  )
796
1025
 
797
1026
 
@@ -802,7 +1031,20 @@ class AsyncTasksClient:
802
1031
  method="POST",
803
1032
  json={
804
1033
  "data": data,
1034
+ "meta": meta,
1035
+ "is_labeled": is_labeled,
1036
+ "overlap": overlap,
1037
+ "inner_id": inner_id,
1038
+ "total_annotations": total_annotations,
1039
+ "cancelled_annotations": cancelled_annotations,
1040
+ "total_predictions": total_predictions,
1041
+ "comment_count": comment_count,
1042
+ "unresolved_comment_count": unresolved_comment_count,
1043
+ "last_comment_updated_at": last_comment_updated_at,
805
1044
  "project": project,
1045
+ "updated_by": updated_by,
1046
+ "file_upload": file_upload,
1047
+ "comment_authors": comment_authors,
806
1048
  },
807
1049
  headers={
808
1050
  "content-type": "application/json",
@@ -813,9 +1055,9 @@ class AsyncTasksClient:
813
1055
  try:
814
1056
  if 200 <= _response.status_code < 300:
815
1057
  return typing.cast(
816
- BaseTask,
817
- parse_obj_as(
818
- type_=BaseTask, # type: ignore
1058
+ LseTask,
1059
+ construct_type(
1060
+ type_=LseTask, # type: ignore
819
1061
  object_=_response.json(),
820
1062
  ),
821
1063
  )
@@ -824,13 +1066,9 @@ class AsyncTasksClient:
824
1066
  raise ApiError(status_code=_response.status_code, body=_response.text)
825
1067
  raise ApiError(status_code=_response.status_code, body=_response_json)
826
1068
 
827
- async def get(
828
- self, id: str, *, request_options: typing.Optional[RequestOptions] = None
829
- ) -> DataManagerTaskSerializer:
1069
+ async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RoleBasedTask:
830
1070
  """
831
-
832
1071
  Get task data, metadata, annotations and other attributes for a specific labeling task by task ID.
833
- The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
834
1072
 
835
1073
  Parameters
836
1074
  ----------
@@ -842,8 +1080,8 @@ class AsyncTasksClient:
842
1080
 
843
1081
  Returns
844
1082
  -------
845
- DataManagerTaskSerializer
846
- Task
1083
+ RoleBasedTask
1084
+
847
1085
 
848
1086
  Examples
849
1087
  --------
@@ -872,9 +1110,9 @@ class AsyncTasksClient:
872
1110
  try:
873
1111
  if 200 <= _response.status_code < 300:
874
1112
  return typing.cast(
875
- DataManagerTaskSerializer,
876
- parse_obj_as(
877
- type_=DataManagerTaskSerializer, # type: ignore
1113
+ RoleBasedTask,
1114
+ construct_type(
1115
+ type_=RoleBasedTask, # type: ignore
878
1116
  object_=_response.json(),
879
1117
  ),
880
1118
  )
@@ -885,12 +1123,7 @@ class AsyncTasksClient:
885
1123
 
886
1124
  async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
887
1125
  """
888
-
889
- Delete a task in Label Studio.
890
-
891
- You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
892
-
893
- <Warning>This action cannot be undone.</Warning>
1126
+ Delete a task in Label Studio. This action cannot be undone!
894
1127
 
895
1128
  Parameters
896
1129
  ----------
@@ -940,34 +1173,89 @@ class AsyncTasksClient:
940
1173
  self,
941
1174
  id: str,
942
1175
  *,
943
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1176
+ inner_id: typing.Optional[int] = OMIT,
1177
+ cancelled_annotations: typing.Optional[int] = OMIT,
1178
+ total_annotations: typing.Optional[int] = OMIT,
1179
+ total_predictions: typing.Optional[int] = OMIT,
1180
+ completed_at: typing.Optional[dt.datetime] = OMIT,
1181
+ predictions_score: typing.Optional[float] = OMIT,
1182
+ avg_lead_time: typing.Optional[float] = OMIT,
1183
+ draft_exists: typing.Optional[bool] = OMIT,
1184
+ reviewed: typing.Optional[bool] = OMIT,
1185
+ reviews_accepted: typing.Optional[int] = OMIT,
1186
+ reviews_rejected: typing.Optional[int] = OMIT,
1187
+ ground_truth: typing.Optional[bool] = OMIT,
1188
+ data: typing.Optional[typing.Optional[typing.Any]] = OMIT,
1189
+ meta: typing.Optional[typing.Optional[typing.Any]] = OMIT,
1190
+ is_labeled: typing.Optional[bool] = OMIT,
1191
+ overlap: typing.Optional[int] = OMIT,
1192
+ comment_count: typing.Optional[int] = OMIT,
1193
+ unresolved_comment_count: typing.Optional[int] = OMIT,
1194
+ last_comment_updated_at: typing.Optional[dt.datetime] = OMIT,
944
1195
  project: typing.Optional[int] = OMIT,
945
1196
  request_options: typing.Optional[RequestOptions] = None,
946
- ) -> BaseTask:
1197
+ ) -> RoleBasedTask:
947
1198
  """
948
-
949
1199
  Update the attributes of an existing labeling task.
950
1200
 
951
- You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](list).
952
-
953
1201
  Parameters
954
1202
  ----------
955
1203
  id : str
956
1204
  Task ID
957
1205
 
958
- data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
959
- Task data dictionary with arbitrary keys and values
1206
+ inner_id : typing.Optional[int]
1207
+
1208
+ cancelled_annotations : typing.Optional[int]
1209
+
1210
+ total_annotations : typing.Optional[int]
1211
+
1212
+ total_predictions : typing.Optional[int]
1213
+
1214
+ completed_at : typing.Optional[dt.datetime]
1215
+
1216
+ predictions_score : typing.Optional[float]
1217
+
1218
+ avg_lead_time : typing.Optional[float]
1219
+
1220
+ draft_exists : typing.Optional[bool]
1221
+
1222
+ reviewed : typing.Optional[bool]
1223
+
1224
+ reviews_accepted : typing.Optional[int]
1225
+
1226
+ reviews_rejected : typing.Optional[int]
1227
+
1228
+ ground_truth : typing.Optional[bool]
1229
+
1230
+ data : typing.Optional[typing.Optional[typing.Any]]
1231
+
1232
+ meta : typing.Optional[typing.Optional[typing.Any]]
1233
+
1234
+ is_labeled : typing.Optional[bool]
1235
+ True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
1236
+
1237
+ overlap : typing.Optional[int]
1238
+ Number of distinct annotators that processed the current task
1239
+
1240
+ comment_count : typing.Optional[int]
1241
+ Number of comments in the task including all annotations
1242
+
1243
+ unresolved_comment_count : typing.Optional[int]
1244
+ Number of unresolved comments in the task including all annotations
1245
+
1246
+ last_comment_updated_at : typing.Optional[dt.datetime]
1247
+ When the last comment was updated
960
1248
 
961
1249
  project : typing.Optional[int]
962
- Project ID
1250
+ Project ID for this task
963
1251
 
964
1252
  request_options : typing.Optional[RequestOptions]
965
1253
  Request-specific configuration.
966
1254
 
967
1255
  Returns
968
1256
  -------
969
- BaseTask
970
- Updated task
1257
+ RoleBasedTask
1258
+
971
1259
 
972
1260
  Examples
973
1261
  --------
@@ -983,11 +1271,6 @@ class AsyncTasksClient:
983
1271
  async def main() -> None:
984
1272
  await client.tasks.update(
985
1273
  id="id",
986
- data={
987
- "image": "https://example.com/image.jpg",
988
- "text": "Hello, world!",
989
- },
990
- project=1,
991
1274
  )
992
1275
 
993
1276
 
@@ -997,7 +1280,25 @@ class AsyncTasksClient:
997
1280
  f"api/tasks/{jsonable_encoder(id)}/",
998
1281
  method="PATCH",
999
1282
  json={
1283
+ "inner_id": inner_id,
1284
+ "cancelled_annotations": cancelled_annotations,
1285
+ "total_annotations": total_annotations,
1286
+ "total_predictions": total_predictions,
1287
+ "completed_at": completed_at,
1288
+ "predictions_score": predictions_score,
1289
+ "avg_lead_time": avg_lead_time,
1290
+ "draft_exists": draft_exists,
1291
+ "reviewed": reviewed,
1292
+ "reviews_accepted": reviews_accepted,
1293
+ "reviews_rejected": reviews_rejected,
1294
+ "ground_truth": ground_truth,
1000
1295
  "data": data,
1296
+ "meta": meta,
1297
+ "is_labeled": is_labeled,
1298
+ "overlap": overlap,
1299
+ "comment_count": comment_count,
1300
+ "unresolved_comment_count": unresolved_comment_count,
1301
+ "last_comment_updated_at": last_comment_updated_at,
1001
1302
  "project": project,
1002
1303
  },
1003
1304
  headers={
@@ -1009,9 +1310,9 @@ class AsyncTasksClient:
1009
1310
  try:
1010
1311
  if 200 <= _response.status_code < 300:
1011
1312
  return typing.cast(
1012
- BaseTask,
1013
- parse_obj_as(
1014
- type_=BaseTask, # type: ignore
1313
+ RoleBasedTask,
1314
+ construct_type(
1315
+ type_=RoleBasedTask, # type: ignore
1015
1316
  object_=_response.json(),
1016
1317
  ),
1017
1318
  )