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
@@ -3,8 +3,8 @@
3
3
  import typing
4
4
  from ..core.client_wrapper import SyncClientWrapper
5
5
  from ..core.request_options import RequestOptions
6
- from ..types.comment import Comment
7
- from ..core.pydantic_utilities import parse_obj_as
6
+ from ..types.maybe_expanded_comment import MaybeExpandedComment
7
+ from ..core.unchecked_base_model import construct_type
8
8
  from json.decoder import JSONDecodeError
9
9
  from ..core.api_error import ApiError
10
10
  from ..core.jsonable_encoder import jsonable_encoder
@@ -21,33 +21,39 @@ class CommentsClient:
21
21
  def list(
22
22
  self,
23
23
  *,
24
- project: typing.Optional[int] = None,
25
- expand_created_by: typing.Optional[bool] = None,
26
24
  annotation: typing.Optional[int] = None,
25
+ annotators: typing.Optional[str] = None,
26
+ draft: typing.Optional[int] = None,
27
+ expand_created_by: typing.Optional[bool] = None,
28
+ ordering: typing.Optional[str] = None,
29
+ projects: typing.Optional[str] = None,
27
30
  request_options: typing.Optional[RequestOptions] = None,
28
- ) -> typing.List[Comment]:
31
+ ) -> typing.List[MaybeExpandedComment]:
29
32
  """
30
-
31
- Get a list of comments for a specific project.
33
+ List all comments for a specific annotation ID.
32
34
 
33
35
  Parameters
34
36
  ----------
35
- project : typing.Optional[int]
36
- Project ID
37
+ annotation : typing.Optional[int]
38
+
39
+ annotators : typing.Optional[str]
40
+
41
+ draft : typing.Optional[int]
37
42
 
38
43
  expand_created_by : typing.Optional[bool]
39
- Expand the created_by field with object instead of ID
40
44
 
41
- annotation : typing.Optional[int]
42
- Annotation ID
45
+ ordering : typing.Optional[str]
46
+ Which field to use when ordering the results.
47
+
48
+ projects : typing.Optional[str]
43
49
 
44
50
  request_options : typing.Optional[RequestOptions]
45
51
  Request-specific configuration.
46
52
 
47
53
  Returns
48
54
  -------
49
- typing.List[Comment]
50
-
55
+ typing.List[MaybeExpandedComment]
56
+ List of comments
51
57
 
52
58
  Examples
53
59
  --------
@@ -62,18 +68,21 @@ class CommentsClient:
62
68
  "api/comments/",
63
69
  method="GET",
64
70
  params={
65
- "project": project,
66
- "expand_created_by": expand_created_by,
67
71
  "annotation": annotation,
72
+ "annotators": annotators,
73
+ "draft": draft,
74
+ "expand_created_by": expand_created_by,
75
+ "ordering": ordering,
76
+ "projects": projects,
68
77
  },
69
78
  request_options=request_options,
70
79
  )
71
80
  try:
72
81
  if 200 <= _response.status_code < 300:
73
82
  return typing.cast(
74
- typing.List[Comment],
75
- parse_obj_as(
76
- type_=typing.List[Comment], # type: ignore
83
+ typing.List[MaybeExpandedComment],
84
+ construct_type(
85
+ type_=typing.List[MaybeExpandedComment], # type: ignore
77
86
  object_=_response.json(),
78
87
  ),
79
88
  )
@@ -85,32 +94,43 @@ class CommentsClient:
85
94
  def create(
86
95
  self,
87
96
  *,
88
- annotation: typing.Optional[int] = OMIT,
89
- project: typing.Optional[int] = OMIT,
97
+ expand_created_by: typing.Optional[bool] = None,
98
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
99
+ classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
90
100
  text: typing.Optional[str] = OMIT,
91
101
  is_resolved: typing.Optional[bool] = OMIT,
102
+ draft: typing.Optional[int] = OMIT,
103
+ annotation: typing.Optional[int] = OMIT,
92
104
  request_options: typing.Optional[RequestOptions] = None,
93
- ) -> Comment:
105
+ ) -> MaybeExpandedComment:
94
106
  """
95
-
96
- Create a new comment.
107
+ Create a comment for a specific annotation ID.
97
108
 
98
109
  Parameters
99
110
  ----------
100
- annotation : typing.Optional[int]
111
+ expand_created_by : typing.Optional[bool]
112
+ Expand the created_by field
113
+
114
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
101
115
 
102
- project : typing.Optional[int]
116
+ classifications : typing.Optional[typing.Optional[typing.Any]]
103
117
 
104
118
  text : typing.Optional[str]
119
+ Reviewer or annotator comment
105
120
 
106
121
  is_resolved : typing.Optional[bool]
122
+ True if the comment is resolved
123
+
124
+ draft : typing.Optional[int]
125
+
126
+ annotation : typing.Optional[int]
107
127
 
108
128
  request_options : typing.Optional[RequestOptions]
109
129
  Request-specific configuration.
110
130
 
111
131
  Returns
112
132
  -------
113
- Comment
133
+ MaybeExpandedComment
114
134
 
115
135
 
116
136
  Examples
@@ -125,14 +145,16 @@ class CommentsClient:
125
145
  _response = self._client_wrapper.httpx_client.request(
126
146
  "api/comments/",
127
147
  method="POST",
148
+ params={
149
+ "expand_created_by": expand_created_by,
150
+ },
128
151
  json={
129
- "annotation": annotation,
130
- "project": project,
152
+ "region_ref": region_ref,
153
+ "classifications": classifications,
131
154
  "text": text,
132
155
  "is_resolved": is_resolved,
133
- },
134
- headers={
135
- "content-type": "application/json",
156
+ "draft": draft,
157
+ "annotation": annotation,
136
158
  },
137
159
  request_options=request_options,
138
160
  omit=OMIT,
@@ -140,9 +162,9 @@ class CommentsClient:
140
162
  try:
141
163
  if 200 <= _response.status_code < 300:
142
164
  return typing.cast(
143
- Comment,
144
- parse_obj_as(
145
- type_=Comment, # type: ignore
165
+ MaybeExpandedComment,
166
+ construct_type(
167
+ type_=MaybeExpandedComment, # type: ignore
146
168
  object_=_response.json(),
147
169
  ),
148
170
  )
@@ -151,22 +173,29 @@ class CommentsClient:
151
173
  raise ApiError(status_code=_response.status_code, body=_response.text)
152
174
  raise ApiError(status_code=_response.status_code, body=_response_json)
153
175
 
154
- def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> Comment:
176
+ def get(
177
+ self,
178
+ id: str,
179
+ *,
180
+ expand_created_by: typing.Optional[bool] = None,
181
+ request_options: typing.Optional[RequestOptions] = None,
182
+ ) -> MaybeExpandedComment:
155
183
  """
156
-
157
- Get a specific comment.
184
+ Retrieve a specific comment by ID for an annotation.
158
185
 
159
186
  Parameters
160
187
  ----------
161
- id : int
162
- Comment ID
188
+ id : str
189
+
190
+ expand_created_by : typing.Optional[bool]
191
+ Expand the created_by field
163
192
 
164
193
  request_options : typing.Optional[RequestOptions]
165
194
  Request-specific configuration.
166
195
 
167
196
  Returns
168
197
  -------
169
- Comment
198
+ MaybeExpandedComment
170
199
 
171
200
 
172
201
  Examples
@@ -177,20 +206,23 @@ class CommentsClient:
177
206
  api_key="YOUR_API_KEY",
178
207
  )
179
208
  client.comments.get(
180
- id=1,
209
+ id="id",
181
210
  )
182
211
  """
183
212
  _response = self._client_wrapper.httpx_client.request(
184
- f"api/comments/{jsonable_encoder(id)}",
213
+ f"api/comments/{jsonable_encoder(id)}/",
185
214
  method="GET",
215
+ params={
216
+ "expand_created_by": expand_created_by,
217
+ },
186
218
  request_options=request_options,
187
219
  )
188
220
  try:
189
221
  if 200 <= _response.status_code < 300:
190
222
  return typing.cast(
191
- Comment,
192
- parse_obj_as(
193
- type_=Comment, # type: ignore
223
+ MaybeExpandedComment,
224
+ construct_type(
225
+ type_=MaybeExpandedComment, # type: ignore
194
226
  object_=_response.json(),
195
227
  ),
196
228
  )
@@ -199,15 +231,22 @@ class CommentsClient:
199
231
  raise ApiError(status_code=_response.status_code, body=_response.text)
200
232
  raise ApiError(status_code=_response.status_code, body=_response_json)
201
233
 
202
- def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
234
+ def delete(
235
+ self,
236
+ id: str,
237
+ *,
238
+ expand_created_by: typing.Optional[bool] = None,
239
+ request_options: typing.Optional[RequestOptions] = None,
240
+ ) -> None:
203
241
  """
204
-
205
- Delete a specific comment.
242
+ Delete a comment by ID
206
243
 
207
244
  Parameters
208
245
  ----------
209
- id : int
210
- Comment ID
246
+ id : str
247
+
248
+ expand_created_by : typing.Optional[bool]
249
+ Expand the created_by field
211
250
 
212
251
  request_options : typing.Optional[RequestOptions]
213
252
  Request-specific configuration.
@@ -224,12 +263,15 @@ class CommentsClient:
224
263
  api_key="YOUR_API_KEY",
225
264
  )
226
265
  client.comments.delete(
227
- id=1,
266
+ id="id",
228
267
  )
229
268
  """
230
269
  _response = self._client_wrapper.httpx_client.request(
231
- f"api/comments/{jsonable_encoder(id)}",
270
+ f"api/comments/{jsonable_encoder(id)}/",
232
271
  method="DELETE",
272
+ params={
273
+ "expand_created_by": expand_created_by,
274
+ },
233
275
  request_options=request_options,
234
276
  )
235
277
  try:
@@ -242,37 +284,47 @@ class CommentsClient:
242
284
 
243
285
  def update(
244
286
  self,
245
- id: int,
287
+ id: str,
246
288
  *,
247
- annotation: typing.Optional[int] = OMIT,
248
- project: typing.Optional[int] = OMIT,
289
+ expand_created_by: typing.Optional[bool] = None,
290
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
291
+ classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
249
292
  text: typing.Optional[str] = OMIT,
250
293
  is_resolved: typing.Optional[bool] = OMIT,
294
+ draft: typing.Optional[int] = OMIT,
295
+ annotation: typing.Optional[int] = OMIT,
251
296
  request_options: typing.Optional[RequestOptions] = None,
252
- ) -> Comment:
297
+ ) -> MaybeExpandedComment:
253
298
  """
254
-
255
- Update a specific comment.
299
+ Update a specific comment by ID.
256
300
 
257
301
  Parameters
258
302
  ----------
259
- id : int
260
- Comment ID
303
+ id : str
261
304
 
262
- annotation : typing.Optional[int]
305
+ expand_created_by : typing.Optional[bool]
306
+ Expand the created_by field
263
307
 
264
- project : typing.Optional[int]
308
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
309
+
310
+ classifications : typing.Optional[typing.Optional[typing.Any]]
265
311
 
266
312
  text : typing.Optional[str]
313
+ Reviewer or annotator comment
267
314
 
268
315
  is_resolved : typing.Optional[bool]
316
+ True if the comment is resolved
317
+
318
+ draft : typing.Optional[int]
319
+
320
+ annotation : typing.Optional[int]
269
321
 
270
322
  request_options : typing.Optional[RequestOptions]
271
323
  Request-specific configuration.
272
324
 
273
325
  Returns
274
326
  -------
275
- Comment
327
+ MaybeExpandedComment
276
328
 
277
329
 
278
330
  Examples
@@ -283,17 +335,22 @@ class CommentsClient:
283
335
  api_key="YOUR_API_KEY",
284
336
  )
285
337
  client.comments.update(
286
- id=1,
338
+ id="id",
287
339
  )
288
340
  """
289
341
  _response = self._client_wrapper.httpx_client.request(
290
- f"api/comments/{jsonable_encoder(id)}",
342
+ f"api/comments/{jsonable_encoder(id)}/",
291
343
  method="PATCH",
344
+ params={
345
+ "expand_created_by": expand_created_by,
346
+ },
292
347
  json={
293
- "annotation": annotation,
294
- "project": project,
348
+ "region_ref": region_ref,
349
+ "classifications": classifications,
295
350
  "text": text,
296
351
  "is_resolved": is_resolved,
352
+ "draft": draft,
353
+ "annotation": annotation,
297
354
  },
298
355
  headers={
299
356
  "content-type": "application/json",
@@ -304,9 +361,9 @@ class CommentsClient:
304
361
  try:
305
362
  if 200 <= _response.status_code < 300:
306
363
  return typing.cast(
307
- Comment,
308
- parse_obj_as(
309
- type_=Comment, # type: ignore
364
+ MaybeExpandedComment,
365
+ construct_type(
366
+ type_=MaybeExpandedComment, # type: ignore
310
367
  object_=_response.json(),
311
368
  ),
312
369
  )
@@ -315,6 +372,68 @@ class CommentsClient:
315
372
  raise ApiError(status_code=_response.status_code, body=_response.text)
316
373
  raise ApiError(status_code=_response.status_code, body=_response_json)
317
374
 
375
+ def export(
376
+ self,
377
+ *,
378
+ annotation: typing.Optional[int] = None,
379
+ annotators: typing.Optional[str] = None,
380
+ draft: typing.Optional[int] = None,
381
+ expand_created_by: typing.Optional[bool] = None,
382
+ projects: typing.Optional[str] = None,
383
+ tz: typing.Optional[str] = None,
384
+ request_options: typing.Optional[RequestOptions] = None,
385
+ ) -> typing.Iterator[bytes]:
386
+ """
387
+ Export comments to CSV file
388
+
389
+ Parameters
390
+ ----------
391
+ annotation : typing.Optional[int]
392
+
393
+ annotators : typing.Optional[str]
394
+
395
+ draft : typing.Optional[int]
396
+
397
+ expand_created_by : typing.Optional[bool]
398
+
399
+ projects : typing.Optional[str]
400
+
401
+ tz : typing.Optional[str]
402
+ Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
403
+
404
+ request_options : typing.Optional[RequestOptions]
405
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
406
+
407
+ Yields
408
+ ------
409
+ typing.Iterator[bytes]
410
+ CSV file with comments
411
+ """
412
+ with self._client_wrapper.httpx_client.stream(
413
+ "api/comments/export/",
414
+ method="GET",
415
+ params={
416
+ "annotation": annotation,
417
+ "annotators": annotators,
418
+ "draft": draft,
419
+ "expand_created_by": expand_created_by,
420
+ "projects": projects,
421
+ "tz": tz,
422
+ },
423
+ request_options=request_options,
424
+ ) as _response:
425
+ try:
426
+ if 200 <= _response.status_code < 300:
427
+ _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
428
+ for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
429
+ yield _chunk
430
+ return
431
+ _response.read()
432
+ _response_json = _response.json()
433
+ except JSONDecodeError:
434
+ raise ApiError(status_code=_response.status_code, body=_response.text)
435
+ raise ApiError(status_code=_response.status_code, body=_response_json)
436
+
318
437
 
319
438
  class AsyncCommentsClient:
320
439
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -323,33 +442,39 @@ class AsyncCommentsClient:
323
442
  async def list(
324
443
  self,
325
444
  *,
326
- project: typing.Optional[int] = None,
327
- expand_created_by: typing.Optional[bool] = None,
328
445
  annotation: typing.Optional[int] = None,
446
+ annotators: typing.Optional[str] = None,
447
+ draft: typing.Optional[int] = None,
448
+ expand_created_by: typing.Optional[bool] = None,
449
+ ordering: typing.Optional[str] = None,
450
+ projects: typing.Optional[str] = None,
329
451
  request_options: typing.Optional[RequestOptions] = None,
330
- ) -> typing.List[Comment]:
452
+ ) -> typing.List[MaybeExpandedComment]:
331
453
  """
332
-
333
- Get a list of comments for a specific project.
454
+ List all comments for a specific annotation ID.
334
455
 
335
456
  Parameters
336
457
  ----------
337
- project : typing.Optional[int]
338
- Project ID
458
+ annotation : typing.Optional[int]
459
+
460
+ annotators : typing.Optional[str]
461
+
462
+ draft : typing.Optional[int]
339
463
 
340
464
  expand_created_by : typing.Optional[bool]
341
- Expand the created_by field with object instead of ID
342
465
 
343
- annotation : typing.Optional[int]
344
- Annotation ID
466
+ ordering : typing.Optional[str]
467
+ Which field to use when ordering the results.
468
+
469
+ projects : typing.Optional[str]
345
470
 
346
471
  request_options : typing.Optional[RequestOptions]
347
472
  Request-specific configuration.
348
473
 
349
474
  Returns
350
475
  -------
351
- typing.List[Comment]
352
-
476
+ typing.List[MaybeExpandedComment]
477
+ List of comments
353
478
 
354
479
  Examples
355
480
  --------
@@ -372,18 +497,21 @@ class AsyncCommentsClient:
372
497
  "api/comments/",
373
498
  method="GET",
374
499
  params={
375
- "project": project,
376
- "expand_created_by": expand_created_by,
377
500
  "annotation": annotation,
501
+ "annotators": annotators,
502
+ "draft": draft,
503
+ "expand_created_by": expand_created_by,
504
+ "ordering": ordering,
505
+ "projects": projects,
378
506
  },
379
507
  request_options=request_options,
380
508
  )
381
509
  try:
382
510
  if 200 <= _response.status_code < 300:
383
511
  return typing.cast(
384
- typing.List[Comment],
385
- parse_obj_as(
386
- type_=typing.List[Comment], # type: ignore
512
+ typing.List[MaybeExpandedComment],
513
+ construct_type(
514
+ type_=typing.List[MaybeExpandedComment], # type: ignore
387
515
  object_=_response.json(),
388
516
  ),
389
517
  )
@@ -395,32 +523,43 @@ class AsyncCommentsClient:
395
523
  async def create(
396
524
  self,
397
525
  *,
398
- annotation: typing.Optional[int] = OMIT,
399
- project: typing.Optional[int] = OMIT,
526
+ expand_created_by: typing.Optional[bool] = None,
527
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
528
+ classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
400
529
  text: typing.Optional[str] = OMIT,
401
530
  is_resolved: typing.Optional[bool] = OMIT,
531
+ draft: typing.Optional[int] = OMIT,
532
+ annotation: typing.Optional[int] = OMIT,
402
533
  request_options: typing.Optional[RequestOptions] = None,
403
- ) -> Comment:
534
+ ) -> MaybeExpandedComment:
404
535
  """
405
-
406
- Create a new comment.
536
+ Create a comment for a specific annotation ID.
407
537
 
408
538
  Parameters
409
539
  ----------
410
- annotation : typing.Optional[int]
540
+ expand_created_by : typing.Optional[bool]
541
+ Expand the created_by field
542
+
543
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
411
544
 
412
- project : typing.Optional[int]
545
+ classifications : typing.Optional[typing.Optional[typing.Any]]
413
546
 
414
547
  text : typing.Optional[str]
548
+ Reviewer or annotator comment
415
549
 
416
550
  is_resolved : typing.Optional[bool]
551
+ True if the comment is resolved
552
+
553
+ draft : typing.Optional[int]
554
+
555
+ annotation : typing.Optional[int]
417
556
 
418
557
  request_options : typing.Optional[RequestOptions]
419
558
  Request-specific configuration.
420
559
 
421
560
  Returns
422
561
  -------
423
- Comment
562
+ MaybeExpandedComment
424
563
 
425
564
 
426
565
  Examples
@@ -443,14 +582,16 @@ class AsyncCommentsClient:
443
582
  _response = await self._client_wrapper.httpx_client.request(
444
583
  "api/comments/",
445
584
  method="POST",
585
+ params={
586
+ "expand_created_by": expand_created_by,
587
+ },
446
588
  json={
447
- "annotation": annotation,
448
- "project": project,
589
+ "region_ref": region_ref,
590
+ "classifications": classifications,
449
591
  "text": text,
450
592
  "is_resolved": is_resolved,
451
- },
452
- headers={
453
- "content-type": "application/json",
593
+ "draft": draft,
594
+ "annotation": annotation,
454
595
  },
455
596
  request_options=request_options,
456
597
  omit=OMIT,
@@ -458,9 +599,9 @@ class AsyncCommentsClient:
458
599
  try:
459
600
  if 200 <= _response.status_code < 300:
460
601
  return typing.cast(
461
- Comment,
462
- parse_obj_as(
463
- type_=Comment, # type: ignore
602
+ MaybeExpandedComment,
603
+ construct_type(
604
+ type_=MaybeExpandedComment, # type: ignore
464
605
  object_=_response.json(),
465
606
  ),
466
607
  )
@@ -469,22 +610,29 @@ class AsyncCommentsClient:
469
610
  raise ApiError(status_code=_response.status_code, body=_response.text)
470
611
  raise ApiError(status_code=_response.status_code, body=_response_json)
471
612
 
472
- async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> Comment:
613
+ async def get(
614
+ self,
615
+ id: str,
616
+ *,
617
+ expand_created_by: typing.Optional[bool] = None,
618
+ request_options: typing.Optional[RequestOptions] = None,
619
+ ) -> MaybeExpandedComment:
473
620
  """
474
-
475
- Get a specific comment.
621
+ Retrieve a specific comment by ID for an annotation.
476
622
 
477
623
  Parameters
478
624
  ----------
479
- id : int
480
- Comment ID
625
+ id : str
626
+
627
+ expand_created_by : typing.Optional[bool]
628
+ Expand the created_by field
481
629
 
482
630
  request_options : typing.Optional[RequestOptions]
483
631
  Request-specific configuration.
484
632
 
485
633
  Returns
486
634
  -------
487
- Comment
635
+ MaybeExpandedComment
488
636
 
489
637
 
490
638
  Examples
@@ -500,23 +648,26 @@ class AsyncCommentsClient:
500
648
 
501
649
  async def main() -> None:
502
650
  await client.comments.get(
503
- id=1,
651
+ id="id",
504
652
  )
505
653
 
506
654
 
507
655
  asyncio.run(main())
508
656
  """
509
657
  _response = await self._client_wrapper.httpx_client.request(
510
- f"api/comments/{jsonable_encoder(id)}",
658
+ f"api/comments/{jsonable_encoder(id)}/",
511
659
  method="GET",
660
+ params={
661
+ "expand_created_by": expand_created_by,
662
+ },
512
663
  request_options=request_options,
513
664
  )
514
665
  try:
515
666
  if 200 <= _response.status_code < 300:
516
667
  return typing.cast(
517
- Comment,
518
- parse_obj_as(
519
- type_=Comment, # type: ignore
668
+ MaybeExpandedComment,
669
+ construct_type(
670
+ type_=MaybeExpandedComment, # type: ignore
520
671
  object_=_response.json(),
521
672
  ),
522
673
  )
@@ -525,15 +676,22 @@ class AsyncCommentsClient:
525
676
  raise ApiError(status_code=_response.status_code, body=_response.text)
526
677
  raise ApiError(status_code=_response.status_code, body=_response_json)
527
678
 
528
- async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
679
+ async def delete(
680
+ self,
681
+ id: str,
682
+ *,
683
+ expand_created_by: typing.Optional[bool] = None,
684
+ request_options: typing.Optional[RequestOptions] = None,
685
+ ) -> None:
529
686
  """
530
-
531
- Delete a specific comment.
687
+ Delete a comment by ID
532
688
 
533
689
  Parameters
534
690
  ----------
535
- id : int
536
- Comment ID
691
+ id : str
692
+
693
+ expand_created_by : typing.Optional[bool]
694
+ Expand the created_by field
537
695
 
538
696
  request_options : typing.Optional[RequestOptions]
539
697
  Request-specific configuration.
@@ -555,15 +713,18 @@ class AsyncCommentsClient:
555
713
 
556
714
  async def main() -> None:
557
715
  await client.comments.delete(
558
- id=1,
716
+ id="id",
559
717
  )
560
718
 
561
719
 
562
720
  asyncio.run(main())
563
721
  """
564
722
  _response = await self._client_wrapper.httpx_client.request(
565
- f"api/comments/{jsonable_encoder(id)}",
723
+ f"api/comments/{jsonable_encoder(id)}/",
566
724
  method="DELETE",
725
+ params={
726
+ "expand_created_by": expand_created_by,
727
+ },
567
728
  request_options=request_options,
568
729
  )
569
730
  try:
@@ -576,37 +737,47 @@ class AsyncCommentsClient:
576
737
 
577
738
  async def update(
578
739
  self,
579
- id: int,
740
+ id: str,
580
741
  *,
581
- annotation: typing.Optional[int] = OMIT,
582
- project: typing.Optional[int] = OMIT,
742
+ expand_created_by: typing.Optional[bool] = None,
743
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
744
+ classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
583
745
  text: typing.Optional[str] = OMIT,
584
746
  is_resolved: typing.Optional[bool] = OMIT,
747
+ draft: typing.Optional[int] = OMIT,
748
+ annotation: typing.Optional[int] = OMIT,
585
749
  request_options: typing.Optional[RequestOptions] = None,
586
- ) -> Comment:
750
+ ) -> MaybeExpandedComment:
587
751
  """
588
-
589
- Update a specific comment.
752
+ Update a specific comment by ID.
590
753
 
591
754
  Parameters
592
755
  ----------
593
- id : int
594
- Comment ID
756
+ id : str
595
757
 
596
- annotation : typing.Optional[int]
758
+ expand_created_by : typing.Optional[bool]
759
+ Expand the created_by field
597
760
 
598
- project : typing.Optional[int]
761
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
762
+
763
+ classifications : typing.Optional[typing.Optional[typing.Any]]
599
764
 
600
765
  text : typing.Optional[str]
766
+ Reviewer or annotator comment
601
767
 
602
768
  is_resolved : typing.Optional[bool]
769
+ True if the comment is resolved
770
+
771
+ draft : typing.Optional[int]
772
+
773
+ annotation : typing.Optional[int]
603
774
 
604
775
  request_options : typing.Optional[RequestOptions]
605
776
  Request-specific configuration.
606
777
 
607
778
  Returns
608
779
  -------
609
- Comment
780
+ MaybeExpandedComment
610
781
 
611
782
 
612
783
  Examples
@@ -622,20 +793,25 @@ class AsyncCommentsClient:
622
793
 
623
794
  async def main() -> None:
624
795
  await client.comments.update(
625
- id=1,
796
+ id="id",
626
797
  )
627
798
 
628
799
 
629
800
  asyncio.run(main())
630
801
  """
631
802
  _response = await self._client_wrapper.httpx_client.request(
632
- f"api/comments/{jsonable_encoder(id)}",
803
+ f"api/comments/{jsonable_encoder(id)}/",
633
804
  method="PATCH",
805
+ params={
806
+ "expand_created_by": expand_created_by,
807
+ },
634
808
  json={
635
- "annotation": annotation,
636
- "project": project,
809
+ "region_ref": region_ref,
810
+ "classifications": classifications,
637
811
  "text": text,
638
812
  "is_resolved": is_resolved,
813
+ "draft": draft,
814
+ "annotation": annotation,
639
815
  },
640
816
  headers={
641
817
  "content-type": "application/json",
@@ -646,9 +822,9 @@ class AsyncCommentsClient:
646
822
  try:
647
823
  if 200 <= _response.status_code < 300:
648
824
  return typing.cast(
649
- Comment,
650
- parse_obj_as(
651
- type_=Comment, # type: ignore
825
+ MaybeExpandedComment,
826
+ construct_type(
827
+ type_=MaybeExpandedComment, # type: ignore
652
828
  object_=_response.json(),
653
829
  ),
654
830
  )
@@ -656,3 +832,65 @@ class AsyncCommentsClient:
656
832
  except JSONDecodeError:
657
833
  raise ApiError(status_code=_response.status_code, body=_response.text)
658
834
  raise ApiError(status_code=_response.status_code, body=_response_json)
835
+
836
+ async def export(
837
+ self,
838
+ *,
839
+ annotation: typing.Optional[int] = None,
840
+ annotators: typing.Optional[str] = None,
841
+ draft: typing.Optional[int] = None,
842
+ expand_created_by: typing.Optional[bool] = None,
843
+ projects: typing.Optional[str] = None,
844
+ tz: typing.Optional[str] = None,
845
+ request_options: typing.Optional[RequestOptions] = None,
846
+ ) -> typing.AsyncIterator[bytes]:
847
+ """
848
+ Export comments to CSV file
849
+
850
+ Parameters
851
+ ----------
852
+ annotation : typing.Optional[int]
853
+
854
+ annotators : typing.Optional[str]
855
+
856
+ draft : typing.Optional[int]
857
+
858
+ expand_created_by : typing.Optional[bool]
859
+
860
+ projects : typing.Optional[str]
861
+
862
+ tz : typing.Optional[str]
863
+ Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
864
+
865
+ request_options : typing.Optional[RequestOptions]
866
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
867
+
868
+ Yields
869
+ ------
870
+ typing.AsyncIterator[bytes]
871
+ CSV file with comments
872
+ """
873
+ async with self._client_wrapper.httpx_client.stream(
874
+ "api/comments/export/",
875
+ method="GET",
876
+ params={
877
+ "annotation": annotation,
878
+ "annotators": annotators,
879
+ "draft": draft,
880
+ "expand_created_by": expand_created_by,
881
+ "projects": projects,
882
+ "tz": tz,
883
+ },
884
+ request_options=request_options,
885
+ ) as _response:
886
+ try:
887
+ if 200 <= _response.status_code < 300:
888
+ _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
889
+ async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
890
+ yield _chunk
891
+ return
892
+ await _response.aread()
893
+ _response_json = _response.json()
894
+ except JSONDecodeError:
895
+ raise ApiError(status_code=_response.status_code, body=_response.text)
896
+ raise ApiError(status_code=_response.status_code, body=_response_json)