label-studio-sdk 1.0.19__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.19.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.19.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.19.dist-info/RECORD +0 -374
  410. {label_studio_sdk-1.0.19.dist-info → label_studio_sdk-2.0.0.dist-info}/LICENSE +0 -0
@@ -4,12 +4,10 @@ import typing
4
4
  from ...core.client_wrapper import SyncClientWrapper
5
5
  from ...core.request_options import RequestOptions
6
6
  from ...types.redis_import_storage import RedisImportStorage
7
- from ...core.pydantic_utilities import parse_obj_as
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
- from .types.redis_create_response import RedisCreateResponse
11
10
  from ...core.jsonable_encoder import jsonable_encoder
12
- from .types.redis_update_response import RedisUpdateResponse
13
11
  from ...core.client_wrapper import AsyncClientWrapper
14
12
 
15
13
  # this is used as the default value for optional parameters
@@ -21,18 +19,20 @@ class RedisClient:
21
19
  self._client_wrapper = client_wrapper
22
20
 
23
21
  def list(
24
- self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
22
+ self,
23
+ *,
24
+ ordering: typing.Optional[str] = None,
25
+ project: typing.Optional[int] = None,
26
+ request_options: typing.Optional[RequestOptions] = None,
25
27
  ) -> typing.List[RedisImportStorage]:
26
28
  """
27
-
28
- You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis import (source) storage connections for a specific project.
29
-
30
- 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).
31
-
32
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
29
+ Get a list of all Redis import storage connections.
33
30
 
34
31
  Parameters
35
32
  ----------
33
+ ordering : typing.Optional[str]
34
+ Which field to use when ordering the results.
35
+
36
36
  project : typing.Optional[int]
37
37
  Project ID
38
38
 
@@ -57,6 +57,7 @@ class RedisClient:
57
57
  "api/storages/redis/",
58
58
  method="GET",
59
59
  params={
60
+ "ordering": ordering,
60
61
  "project": project,
61
62
  },
62
63
  request_options=request_options,
@@ -65,7 +66,7 @@ class RedisClient:
65
66
  if 200 <= _response.status_code < 300:
66
67
  return typing.cast(
67
68
  typing.List[RedisImportStorage],
68
- parse_obj_as(
69
+ construct_type(
69
70
  type_=typing.List[RedisImportStorage], # type: ignore
70
71
  object_=_response.json(),
71
72
  ),
@@ -88,14 +89,9 @@ class RedisClient:
88
89
  port: typing.Optional[str] = OMIT,
89
90
  password: typing.Optional[str] = OMIT,
90
91
  request_options: typing.Optional[RequestOptions] = None,
91
- ) -> RedisCreateResponse:
92
+ ) -> RedisImportStorage:
92
93
  """
93
-
94
- Create a new source storage connection to a Redis database.
95
-
96
- For information about the required fields and prerequisites, see [Redis database](https://labelstud.io/guide/storage#Redis-database) in the Label Studio documentation.
97
-
98
- <Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you [sync your connection](sync).</Tip>
94
+ Create a new Redis import storage connection.
99
95
 
100
96
  Parameters
101
97
  ----------
@@ -131,7 +127,7 @@ class RedisClient:
131
127
 
132
128
  Returns
133
129
  -------
134
- RedisCreateResponse
130
+ RedisImportStorage
135
131
 
136
132
 
137
133
  Examples
@@ -166,9 +162,9 @@ class RedisClient:
166
162
  try:
167
163
  if 200 <= _response.status_code < 300:
168
164
  return typing.cast(
169
- RedisCreateResponse,
170
- parse_obj_as(
171
- type_=RedisCreateResponse, # type: ignore
165
+ RedisImportStorage,
166
+ construct_type(
167
+ type_=RedisImportStorage, # type: ignore
172
168
  object_=_response.json(),
173
169
  ),
174
170
  )
@@ -177,113 +173,13 @@ class RedisClient:
177
173
  raise ApiError(status_code=_response.status_code, body=_response.text)
178
174
  raise ApiError(status_code=_response.status_code, body=_response_json)
179
175
 
180
- def validate(
181
- self,
182
- *,
183
- id: typing.Optional[int] = OMIT,
184
- regex_filter: typing.Optional[str] = OMIT,
185
- use_blob_urls: typing.Optional[bool] = OMIT,
186
- title: typing.Optional[str] = OMIT,
187
- description: typing.Optional[str] = OMIT,
188
- project: typing.Optional[int] = OMIT,
189
- path: typing.Optional[str] = OMIT,
190
- host: typing.Optional[str] = OMIT,
191
- port: typing.Optional[str] = OMIT,
192
- password: typing.Optional[str] = OMIT,
193
- request_options: typing.Optional[RequestOptions] = None,
194
- ) -> None:
195
- """
196
-
197
- Validate a specific Redis import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
198
-
199
- Parameters
200
- ----------
201
- id : typing.Optional[int]
202
- Storage ID. If set, storage with specified ID will be updated
203
-
204
- regex_filter : typing.Optional[str]
205
- Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
206
-
207
- use_blob_urls : typing.Optional[bool]
208
- Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
209
-
210
- title : typing.Optional[str]
211
- Storage title
212
-
213
- description : typing.Optional[str]
214
- Storage description
215
-
216
- project : typing.Optional[int]
217
- Project ID
218
-
219
- path : typing.Optional[str]
220
- Storage prefix (optional)
221
-
222
- host : typing.Optional[str]
223
- Server Host IP (optional)
224
-
225
- port : typing.Optional[str]
226
- Server Port (optional)
227
-
228
- password : typing.Optional[str]
229
- Server Password (optional)
230
-
231
- request_options : typing.Optional[RequestOptions]
232
- Request-specific configuration.
233
-
234
- Returns
235
- -------
236
- None
237
-
238
- Examples
239
- --------
240
- from label_studio_sdk import LabelStudio
241
-
242
- client = LabelStudio(
243
- api_key="YOUR_API_KEY",
244
- )
245
- client.import_storage.redis.validate()
246
- """
247
- _response = self._client_wrapper.httpx_client.request(
248
- "api/storages/redis/validate",
249
- method="POST",
250
- json={
251
- "id": id,
252
- "regex_filter": regex_filter,
253
- "use_blob_urls": use_blob_urls,
254
- "title": title,
255
- "description": description,
256
- "project": project,
257
- "path": path,
258
- "host": host,
259
- "port": port,
260
- "password": password,
261
- },
262
- headers={
263
- "content-type": "application/json",
264
- },
265
- request_options=request_options,
266
- omit=OMIT,
267
- )
268
- try:
269
- if 200 <= _response.status_code < 300:
270
- return
271
- _response_json = _response.json()
272
- except JSONDecodeError:
273
- raise ApiError(status_code=_response.status_code, body=_response.text)
274
- raise ApiError(status_code=_response.status_code, body=_response_json)
275
-
276
176
  def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisImportStorage:
277
177
  """
278
-
279
- Get a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
280
-
281
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
178
+ Get a specific Redis import storage connection.
282
179
 
283
180
  Parameters
284
181
  ----------
285
182
  id : int
286
- A unique integer value identifying this redis import storage.
287
183
 
288
184
  request_options : typing.Optional[RequestOptions]
289
185
  Request-specific configuration.
@@ -313,7 +209,7 @@ class RedisClient:
313
209
  if 200 <= _response.status_code < 300:
314
210
  return typing.cast(
315
211
  RedisImportStorage,
316
- parse_obj_as(
212
+ construct_type(
317
213
  type_=RedisImportStorage, # type: ignore
318
214
  object_=_response.json(),
319
215
  ),
@@ -325,17 +221,11 @@ class RedisClient:
325
221
 
326
222
  def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
327
223
  """
328
-
329
- Delete a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
330
-
331
- Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.
332
-
333
- If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
224
+ Delete a specific Redis import storage connection.
334
225
 
335
226
  Parameters
336
227
  ----------
337
228
  id : int
338
- A unique integer value identifying this redis import storage.
339
229
 
340
230
  request_options : typing.Optional[RequestOptions]
341
231
  Request-specific configuration.
@@ -382,17 +272,13 @@ class RedisClient:
382
272
  port: typing.Optional[str] = OMIT,
383
273
  password: typing.Optional[str] = OMIT,
384
274
  request_options: typing.Optional[RequestOptions] = None,
385
- ) -> RedisUpdateResponse:
275
+ ) -> RedisImportStorage:
386
276
  """
387
-
388
- Update a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
389
-
390
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
277
+ Update a specific Redis import storage connection.
391
278
 
392
279
  Parameters
393
280
  ----------
394
281
  id : int
395
- A unique integer value identifying this redis import storage.
396
282
 
397
283
  regex_filter : typing.Optional[str]
398
284
  Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
@@ -426,7 +312,7 @@ class RedisClient:
426
312
 
427
313
  Returns
428
314
  -------
429
- RedisUpdateResponse
315
+ RedisImportStorage
430
316
 
431
317
 
432
318
  Examples
@@ -463,9 +349,9 @@ class RedisClient:
463
349
  try:
464
350
  if 200 <= _response.status_code < 300:
465
351
  return typing.cast(
466
- RedisUpdateResponse,
467
- parse_obj_as(
468
- type_=RedisUpdateResponse, # type: ignore
352
+ RedisImportStorage,
353
+ construct_type(
354
+ type_=RedisImportStorage, # type: ignore
469
355
  object_=_response.json(),
470
356
  ),
471
357
  )
@@ -476,12 +362,7 @@ class RedisClient:
476
362
 
477
363
  def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisImportStorage:
478
364
  """
479
-
480
- Sync tasks from a Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
481
-
482
- Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.
483
-
484
- <Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
365
+ Sync tasks from a Redis import storage connection.
485
366
 
486
367
  Parameters
487
368
  ----------
@@ -516,7 +397,7 @@ class RedisClient:
516
397
  if 200 <= _response.status_code < 300:
517
398
  return typing.cast(
518
399
  RedisImportStorage,
519
- parse_obj_as(
400
+ construct_type(
520
401
  type_=RedisImportStorage, # type: ignore
521
402
  object_=_response.json(),
522
403
  ),
@@ -526,77 +407,10 @@ class RedisClient:
526
407
  raise ApiError(status_code=_response.status_code, body=_response.text)
527
408
  raise ApiError(status_code=_response.status_code, body=_response_json)
528
409
 
529
-
530
- class AsyncRedisClient:
531
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
532
- self._client_wrapper = client_wrapper
533
-
534
- async def list(
535
- self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
536
- ) -> typing.List[RedisImportStorage]:
537
- """
538
-
539
- You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis import (source) storage connections for a specific project.
540
-
541
- 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).
542
-
543
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
544
-
545
- Parameters
546
- ----------
547
- project : typing.Optional[int]
548
- Project ID
549
-
550
- request_options : typing.Optional[RequestOptions]
551
- Request-specific configuration.
552
-
553
- Returns
554
- -------
555
- typing.List[RedisImportStorage]
556
-
557
-
558
- Examples
559
- --------
560
- import asyncio
561
-
562
- from label_studio_sdk import AsyncLabelStudio
563
-
564
- client = AsyncLabelStudio(
565
- api_key="YOUR_API_KEY",
566
- )
567
-
568
-
569
- async def main() -> None:
570
- await client.import_storage.redis.list()
571
-
572
-
573
- asyncio.run(main())
574
- """
575
- _response = await self._client_wrapper.httpx_client.request(
576
- "api/storages/redis/",
577
- method="GET",
578
- params={
579
- "project": project,
580
- },
581
- request_options=request_options,
582
- )
583
- try:
584
- if 200 <= _response.status_code < 300:
585
- return typing.cast(
586
- typing.List[RedisImportStorage],
587
- parse_obj_as(
588
- type_=typing.List[RedisImportStorage], # type: ignore
589
- object_=_response.json(),
590
- ),
591
- )
592
- _response_json = _response.json()
593
- except JSONDecodeError:
594
- raise ApiError(status_code=_response.status_code, body=_response.text)
595
- raise ApiError(status_code=_response.status_code, body=_response_json)
596
-
597
- async def create(
410
+ def validate(
598
411
  self,
599
412
  *,
413
+ id: typing.Optional[int] = OMIT,
600
414
  regex_filter: typing.Optional[str] = OMIT,
601
415
  use_blob_urls: typing.Optional[bool] = OMIT,
602
416
  title: typing.Optional[str] = OMIT,
@@ -607,17 +421,15 @@ class AsyncRedisClient:
607
421
  port: typing.Optional[str] = OMIT,
608
422
  password: typing.Optional[str] = OMIT,
609
423
  request_options: typing.Optional[RequestOptions] = None,
610
- ) -> RedisCreateResponse:
424
+ ) -> None:
611
425
  """
612
-
613
- Create a new source storage connection to a Redis database.
614
-
615
- For information about the required fields and prerequisites, see [Redis database](https://labelstud.io/guide/storage#Redis-database) in the Label Studio documentation.
616
-
617
- <Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you [sync your connection](sync).</Tip>
426
+ Validate a specific Redis import storage connection.
618
427
 
619
428
  Parameters
620
429
  ----------
430
+ id : typing.Optional[int]
431
+ Storage ID. If set, storage with specified ID will be updated
432
+
621
433
  regex_filter : typing.Optional[str]
622
434
  Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
623
435
 
@@ -650,30 +462,22 @@ class AsyncRedisClient:
650
462
 
651
463
  Returns
652
464
  -------
653
- RedisCreateResponse
654
-
465
+ None
655
466
 
656
467
  Examples
657
468
  --------
658
- import asyncio
659
-
660
- from label_studio_sdk import AsyncLabelStudio
469
+ from label_studio_sdk import LabelStudio
661
470
 
662
- client = AsyncLabelStudio(
471
+ client = LabelStudio(
663
472
  api_key="YOUR_API_KEY",
664
473
  )
665
-
666
-
667
- async def main() -> None:
668
- await client.import_storage.redis.create()
669
-
670
-
671
- asyncio.run(main())
474
+ client.import_storage.redis.validate()
672
475
  """
673
- _response = await self._client_wrapper.httpx_client.request(
674
- "api/storages/redis/",
476
+ _response = self._client_wrapper.httpx_client.request(
477
+ "api/storages/redis/validate",
675
478
  method="POST",
676
479
  json={
480
+ "id": id,
677
481
  "regex_filter": regex_filter,
678
482
  "use_blob_urls": use_blob_urls,
679
483
  "title": title,
@@ -690,12 +494,77 @@ class AsyncRedisClient:
690
494
  request_options=request_options,
691
495
  omit=OMIT,
692
496
  )
497
+ try:
498
+ if 200 <= _response.status_code < 300:
499
+ return
500
+ _response_json = _response.json()
501
+ except JSONDecodeError:
502
+ raise ApiError(status_code=_response.status_code, body=_response.text)
503
+ raise ApiError(status_code=_response.status_code, body=_response_json)
504
+
505
+
506
+ class AsyncRedisClient:
507
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
508
+ self._client_wrapper = client_wrapper
509
+
510
+ async def list(
511
+ self,
512
+ *,
513
+ ordering: typing.Optional[str] = None,
514
+ project: typing.Optional[int] = None,
515
+ request_options: typing.Optional[RequestOptions] = None,
516
+ ) -> typing.List[RedisImportStorage]:
517
+ """
518
+ Get a list of all Redis import storage connections.
519
+
520
+ Parameters
521
+ ----------
522
+ ordering : typing.Optional[str]
523
+ Which field to use when ordering the results.
524
+
525
+ project : typing.Optional[int]
526
+ Project ID
527
+
528
+ request_options : typing.Optional[RequestOptions]
529
+ Request-specific configuration.
530
+
531
+ Returns
532
+ -------
533
+ typing.List[RedisImportStorage]
534
+
535
+
536
+ Examples
537
+ --------
538
+ import asyncio
539
+
540
+ from label_studio_sdk import AsyncLabelStudio
541
+
542
+ client = AsyncLabelStudio(
543
+ api_key="YOUR_API_KEY",
544
+ )
545
+
546
+
547
+ async def main() -> None:
548
+ await client.import_storage.redis.list()
549
+
550
+
551
+ asyncio.run(main())
552
+ """
553
+ _response = await self._client_wrapper.httpx_client.request(
554
+ "api/storages/redis/",
555
+ method="GET",
556
+ params={
557
+ "ordering": ordering,
558
+ "project": project,
559
+ },
560
+ request_options=request_options,
561
+ )
693
562
  try:
694
563
  if 200 <= _response.status_code < 300:
695
564
  return typing.cast(
696
- RedisCreateResponse,
697
- parse_obj_as(
698
- type_=RedisCreateResponse, # type: ignore
565
+ typing.List[RedisImportStorage],
566
+ construct_type(
567
+ type_=typing.List[RedisImportStorage], # type: ignore
699
568
  object_=_response.json(),
700
569
  ),
701
570
  )
@@ -704,10 +573,9 @@ class AsyncRedisClient:
704
573
  raise ApiError(status_code=_response.status_code, body=_response.text)
705
574
  raise ApiError(status_code=_response.status_code, body=_response_json)
706
575
 
707
- async def validate(
576
+ async def create(
708
577
  self,
709
578
  *,
710
- id: typing.Optional[int] = OMIT,
711
579
  regex_filter: typing.Optional[str] = OMIT,
712
580
  use_blob_urls: typing.Optional[bool] = OMIT,
713
581
  title: typing.Optional[str] = OMIT,
@@ -718,16 +586,12 @@ class AsyncRedisClient:
718
586
  port: typing.Optional[str] = OMIT,
719
587
  password: typing.Optional[str] = OMIT,
720
588
  request_options: typing.Optional[RequestOptions] = None,
721
- ) -> None:
589
+ ) -> RedisImportStorage:
722
590
  """
723
-
724
- Validate a specific Redis import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
591
+ Create a new Redis import storage connection.
725
592
 
726
593
  Parameters
727
594
  ----------
728
- id : typing.Optional[int]
729
- Storage ID. If set, storage with specified ID will be updated
730
-
731
595
  regex_filter : typing.Optional[str]
732
596
  Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
733
597
 
@@ -760,7 +624,8 @@ class AsyncRedisClient:
760
624
 
761
625
  Returns
762
626
  -------
763
- None
627
+ RedisImportStorage
628
+
764
629
 
765
630
  Examples
766
631
  --------
@@ -774,16 +639,15 @@ class AsyncRedisClient:
774
639
 
775
640
 
776
641
  async def main() -> None:
777
- await client.import_storage.redis.validate()
642
+ await client.import_storage.redis.create()
778
643
 
779
644
 
780
645
  asyncio.run(main())
781
646
  """
782
647
  _response = await self._client_wrapper.httpx_client.request(
783
- "api/storages/redis/validate",
648
+ "api/storages/redis/",
784
649
  method="POST",
785
650
  json={
786
- "id": id,
787
651
  "regex_filter": regex_filter,
788
652
  "use_blob_urls": use_blob_urls,
789
653
  "title": title,
@@ -802,7 +666,13 @@ class AsyncRedisClient:
802
666
  )
803
667
  try:
804
668
  if 200 <= _response.status_code < 300:
805
- return
669
+ return typing.cast(
670
+ RedisImportStorage,
671
+ construct_type(
672
+ type_=RedisImportStorage, # type: ignore
673
+ object_=_response.json(),
674
+ ),
675
+ )
806
676
  _response_json = _response.json()
807
677
  except JSONDecodeError:
808
678
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -810,15 +680,11 @@ class AsyncRedisClient:
810
680
 
811
681
  async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisImportStorage:
812
682
  """
813
-
814
- Get a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
815
-
816
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
683
+ Get a specific Redis import storage connection.
817
684
 
818
685
  Parameters
819
686
  ----------
820
687
  id : int
821
- A unique integer value identifying this redis import storage.
822
688
 
823
689
  request_options : typing.Optional[RequestOptions]
824
690
  Request-specific configuration.
@@ -856,7 +722,7 @@ class AsyncRedisClient:
856
722
  if 200 <= _response.status_code < 300:
857
723
  return typing.cast(
858
724
  RedisImportStorage,
859
- parse_obj_as(
725
+ construct_type(
860
726
  type_=RedisImportStorage, # type: ignore
861
727
  object_=_response.json(),
862
728
  ),
@@ -868,17 +734,11 @@ class AsyncRedisClient:
868
734
 
869
735
  async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
870
736
  """
871
-
872
- Delete a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
873
-
874
- Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.
875
-
876
- If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
737
+ Delete a specific Redis import storage connection.
877
738
 
878
739
  Parameters
879
740
  ----------
880
741
  id : int
881
- A unique integer value identifying this redis import storage.
882
742
 
883
743
  request_options : typing.Optional[RequestOptions]
884
744
  Request-specific configuration.
@@ -933,17 +793,13 @@ class AsyncRedisClient:
933
793
  port: typing.Optional[str] = OMIT,
934
794
  password: typing.Optional[str] = OMIT,
935
795
  request_options: typing.Optional[RequestOptions] = None,
936
- ) -> RedisUpdateResponse:
796
+ ) -> RedisImportStorage:
937
797
  """
938
-
939
- Update a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
940
-
941
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
798
+ Update a specific Redis import storage connection.
942
799
 
943
800
  Parameters
944
801
  ----------
945
802
  id : int
946
- A unique integer value identifying this redis import storage.
947
803
 
948
804
  regex_filter : typing.Optional[str]
949
805
  Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
@@ -977,7 +833,7 @@ class AsyncRedisClient:
977
833
 
978
834
  Returns
979
835
  -------
980
- RedisUpdateResponse
836
+ RedisImportStorage
981
837
 
982
838
 
983
839
  Examples
@@ -1022,9 +878,9 @@ class AsyncRedisClient:
1022
878
  try:
1023
879
  if 200 <= _response.status_code < 300:
1024
880
  return typing.cast(
1025
- RedisUpdateResponse,
1026
- parse_obj_as(
1027
- type_=RedisUpdateResponse, # type: ignore
881
+ RedisImportStorage,
882
+ construct_type(
883
+ type_=RedisImportStorage, # type: ignore
1028
884
  object_=_response.json(),
1029
885
  ),
1030
886
  )
@@ -1035,12 +891,7 @@ class AsyncRedisClient:
1035
891
 
1036
892
  async def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisImportStorage:
1037
893
  """
1038
-
1039
- Sync tasks from a Redis import storage connection. You will need to provide the import storage ID. You can find this using [List import storages](list).
1040
-
1041
- Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.
1042
-
1043
- <Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
894
+ Sync tasks from a Redis import storage connection.
1044
895
 
1045
896
  Parameters
1046
897
  ----------
@@ -1083,7 +934,7 @@ class AsyncRedisClient:
1083
934
  if 200 <= _response.status_code < 300:
1084
935
  return typing.cast(
1085
936
  RedisImportStorage,
1086
- parse_obj_as(
937
+ construct_type(
1087
938
  type_=RedisImportStorage, # type: ignore
1088
939
  object_=_response.json(),
1089
940
  ),
@@ -1092,3 +943,106 @@ class AsyncRedisClient:
1092
943
  except JSONDecodeError:
1093
944
  raise ApiError(status_code=_response.status_code, body=_response.text)
1094
945
  raise ApiError(status_code=_response.status_code, body=_response_json)
946
+
947
+ async def validate(
948
+ self,
949
+ *,
950
+ id: typing.Optional[int] = OMIT,
951
+ regex_filter: typing.Optional[str] = OMIT,
952
+ use_blob_urls: typing.Optional[bool] = OMIT,
953
+ title: typing.Optional[str] = OMIT,
954
+ description: typing.Optional[str] = OMIT,
955
+ project: typing.Optional[int] = OMIT,
956
+ path: typing.Optional[str] = OMIT,
957
+ host: typing.Optional[str] = OMIT,
958
+ port: typing.Optional[str] = OMIT,
959
+ password: typing.Optional[str] = OMIT,
960
+ request_options: typing.Optional[RequestOptions] = None,
961
+ ) -> None:
962
+ """
963
+ Validate a specific Redis import storage connection.
964
+
965
+ Parameters
966
+ ----------
967
+ id : typing.Optional[int]
968
+ Storage ID. If set, storage with specified ID will be updated
969
+
970
+ regex_filter : typing.Optional[str]
971
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
972
+
973
+ use_blob_urls : typing.Optional[bool]
974
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
975
+
976
+ title : typing.Optional[str]
977
+ Storage title
978
+
979
+ description : typing.Optional[str]
980
+ Storage description
981
+
982
+ project : typing.Optional[int]
983
+ Project ID
984
+
985
+ path : typing.Optional[str]
986
+ Storage prefix (optional)
987
+
988
+ host : typing.Optional[str]
989
+ Server Host IP (optional)
990
+
991
+ port : typing.Optional[str]
992
+ Server Port (optional)
993
+
994
+ password : typing.Optional[str]
995
+ Server Password (optional)
996
+
997
+ request_options : typing.Optional[RequestOptions]
998
+ Request-specific configuration.
999
+
1000
+ Returns
1001
+ -------
1002
+ None
1003
+
1004
+ Examples
1005
+ --------
1006
+ import asyncio
1007
+
1008
+ from label_studio_sdk import AsyncLabelStudio
1009
+
1010
+ client = AsyncLabelStudio(
1011
+ api_key="YOUR_API_KEY",
1012
+ )
1013
+
1014
+
1015
+ async def main() -> None:
1016
+ await client.import_storage.redis.validate()
1017
+
1018
+
1019
+ asyncio.run(main())
1020
+ """
1021
+ _response = await self._client_wrapper.httpx_client.request(
1022
+ "api/storages/redis/validate",
1023
+ method="POST",
1024
+ json={
1025
+ "id": id,
1026
+ "regex_filter": regex_filter,
1027
+ "use_blob_urls": use_blob_urls,
1028
+ "title": title,
1029
+ "description": description,
1030
+ "project": project,
1031
+ "path": path,
1032
+ "host": host,
1033
+ "port": port,
1034
+ "password": password,
1035
+ },
1036
+ headers={
1037
+ "content-type": "application/json",
1038
+ },
1039
+ request_options=request_options,
1040
+ omit=OMIT,
1041
+ )
1042
+ try:
1043
+ if 200 <= _response.status_code < 300:
1044
+ return
1045
+ _response_json = _response.json()
1046
+ except JSONDecodeError:
1047
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1048
+ raise ApiError(status_code=_response.status_code, body=_response_json)