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.
- label_studio_sdk/__init__.py +325 -180
- label_studio_sdk/actions/__init__.py +4 -0
- label_studio_sdk/actions/client.py +46 -10
- label_studio_sdk/actions/types/__init__.py +4 -0
- label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
- label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
- label_studio_sdk/annotations/__init__.py +2 -2
- label_studio_sdk/annotations/client.py +379 -243
- label_studio_sdk/annotations/types/__init__.py +4 -2
- label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
- label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
- label_studio_sdk/base_client.py +28 -24
- label_studio_sdk/comments/client.py +378 -140
- label_studio_sdk/converter/README.md +207 -0
- label_studio_sdk/converter/imports/coco.py +132 -23
- label_studio_sdk/core/__init__.py +4 -0
- label_studio_sdk/core/unchecked_base_model.py +305 -0
- label_studio_sdk/environment.py +1 -1
- label_studio_sdk/errors/__init__.py +10 -1
- label_studio_sdk/errors/forbidden_error.py +9 -0
- label_studio_sdk/errors/method_not_allowed_error.py +9 -0
- label_studio_sdk/export_storage/__init__.py +1 -24
- label_studio_sdk/export_storage/azure/__init__.py +0 -3
- label_studio_sdk/export_storage/azure/client.py +231 -273
- label_studio_sdk/export_storage/client.py +5 -5
- label_studio_sdk/export_storage/gcs/__init__.py +0 -3
- label_studio_sdk/export_storage/gcs/client.py +231 -273
- label_studio_sdk/export_storage/local/__init__.py +0 -3
- label_studio_sdk/export_storage/local/client.py +211 -253
- label_studio_sdk/export_storage/redis/__init__.py +0 -3
- label_studio_sdk/export_storage/redis/client.py +239 -281
- label_studio_sdk/export_storage/s3/__init__.py +0 -3
- label_studio_sdk/export_storage/s3/client.py +254 -296
- label_studio_sdk/export_storage/s3s/client.py +694 -210
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
- label_studio_sdk/files/client.py +52 -71
- label_studio_sdk/import_storage/__init__.py +1 -24
- label_studio_sdk/import_storage/azure/__init__.py +0 -3
- label_studio_sdk/import_storage/azure/client.py +249 -299
- label_studio_sdk/import_storage/client.py +5 -5
- label_studio_sdk/import_storage/gcs/__init__.py +0 -3
- label_studio_sdk/import_storage/gcs/client.py +249 -299
- label_studio_sdk/import_storage/local/__init__.py +0 -3
- label_studio_sdk/import_storage/local/client.py +211 -257
- label_studio_sdk/import_storage/redis/__init__.py +0 -3
- label_studio_sdk/import_storage/redis/client.py +239 -285
- label_studio_sdk/import_storage/s3/__init__.py +0 -3
- label_studio_sdk/import_storage/s3/client.py +274 -324
- label_studio_sdk/import_storage/s3s/client.py +728 -434
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
- label_studio_sdk/jwt_settings/client.py +56 -58
- label_studio_sdk/label_interface/control_tags.py +48 -8
- label_studio_sdk/label_interface/interface.py +261 -56
- label_studio_sdk/ml/__init__.py +2 -16
- label_studio_sdk/ml/client.py +196 -179
- label_studio_sdk/ml/types/__init__.py +2 -12
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
- label_studio_sdk/model_providers/__init__.py +3 -0
- label_studio_sdk/model_providers/client.py +280 -228
- label_studio_sdk/model_providers/types/__init__.py +5 -0
- label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
- label_studio_sdk/organizations/__init__.py +5 -0
- label_studio_sdk/organizations/client.py +331 -0
- label_studio_sdk/organizations/members/__init__.py +2 -0
- label_studio_sdk/organizations/members/client.py +290 -0
- label_studio_sdk/predictions/client.py +29 -77
- label_studio_sdk/projects/__init__.py +18 -9
- label_studio_sdk/projects/client.py +905 -414
- label_studio_sdk/projects/exports/__init__.py +2 -2
- label_studio_sdk/projects/exports/client.py +336 -396
- label_studio_sdk/projects/exports/client_ext.py +30 -30
- label_studio_sdk/projects/exports/types/__init__.py +1 -2
- label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
- label_studio_sdk/projects/pauses/client.py +114 -105
- label_studio_sdk/projects/stats/__init__.py +5 -0
- label_studio_sdk/projects/stats/client.py +175 -0
- label_studio_sdk/projects/stats/types/__init__.py +8 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
- label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
- label_studio_sdk/projects/types/__init__.py +10 -6
- label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
- label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
- label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
- label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
- label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
- label_studio_sdk/prompts/__init__.py +4 -10
- label_studio_sdk/prompts/client.py +511 -442
- label_studio_sdk/prompts/indicators/__init__.py +3 -0
- label_studio_sdk/prompts/indicators/client.py +47 -49
- label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
- label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
- label_studio_sdk/prompts/runs/client.py +113 -135
- label_studio_sdk/prompts/types/__init__.py +2 -12
- label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
- label_studio_sdk/prompts/versions/client.py +372 -312
- label_studio_sdk/tasks/__init__.py +2 -2
- label_studio_sdk/tasks/client.py +514 -213
- label_studio_sdk/tasks/types/__init__.py +1 -2
- label_studio_sdk/tokens/client.py +160 -152
- label_studio_sdk/tokens/client_ext.py +3 -3
- label_studio_sdk/types/__init__.py +258 -142
- label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
- label_studio_sdk/types/all_roles_project_list.py +197 -0
- label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
- label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
- label_studio_sdk/types/annotated_enum.py +5 -0
- label_studio_sdk/types/annotation.py +24 -10
- label_studio_sdk/types/annotation_last_action.py +3 -15
- label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
- label_studio_sdk/types/annotation_request_last_action.py +7 -0
- label_studio_sdk/types/assignment_settings.py +31 -0
- label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/assignment_settings_request.py +32 -0
- label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
- label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → associated_project.py} +9 -6
- label_studio_sdk/types/auth_method_enum.py +5 -0
- label_studio_sdk/types/azure_blob_export_storage.py +8 -12
- label_studio_sdk/types/azure_blob_import_storage.py +8 -12
- label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
- label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
- label_studio_sdk/types/blank_enum.py +5 -0
- label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
- label_studio_sdk/types/budget_reset_period_enum.py +5 -0
- label_studio_sdk/types/child_filter.py +44 -0
- label_studio_sdk/types/comment.py +39 -14
- label_studio_sdk/types/comment_request.py +32 -0
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
- label_studio_sdk/types/converted_format.py +5 -5
- label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
- label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
- label_studio_sdk/types/default_role_enum.py +5 -0
- label_studio_sdk/types/edition_enum.py +5 -0
- label_studio_sdk/types/export.py +7 -7
- label_studio_sdk/types/file_upload.py +5 -5
- label_studio_sdk/types/filter.py +9 -6
- label_studio_sdk/types/filter_group.py +3 -3
- label_studio_sdk/types/finished_enum.py +5 -0
- label_studio_sdk/types/gcs_export_storage.py +8 -12
- label_studio_sdk/types/gcs_import_storage.py +8 -12
- label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
- label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
- label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
- label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
- label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
- label_studio_sdk/types/local_files_export_storage.py +8 -12
- label_studio_sdk/types/local_files_import_storage.py +8 -12
- label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
- label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
- label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
- label_studio_sdk/types/lse_fields.py +49 -0
- label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
- label_studio_sdk/types/lse_fields_trial_role.py +8 -0
- label_studio_sdk/types/lse_key_indicator_value.py +35 -0
- label_studio_sdk/types/lse_organization.py +57 -0
- label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
- label_studio_sdk/types/lse_project_create.py +196 -0
- label_studio_sdk/types/lse_project_create_sampling.py +7 -0
- label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
- label_studio_sdk/types/lse_project_update.py +215 -0
- label_studio_sdk/types/lse_project_update_sampling.py +7 -0
- label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
- label_studio_sdk/types/lse_s3export_storage.py +134 -0
- label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
- label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
- label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
- label_studio_sdk/types/lse_task.py +117 -0
- label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
- label_studio_sdk/types/lse_task_filter_options.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
- label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
- label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
- label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
- label_studio_sdk/types/lse_user.py +49 -0
- label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
- label_studio_sdk/types/lseapi_token_create.py +21 -0
- label_studio_sdk/types/lseapi_token_list.py +21 -0
- label_studio_sdk/types/lsejwt_settings.py +32 -0
- label_studio_sdk/types/maybe_expanded_comment.py +7 -0
- label_studio_sdk/types/ml_backend.py +16 -17
- label_studio_sdk/types/mode_enum.py +5 -0
- label_studio_sdk/types/model_interface.py +44 -0
- label_studio_sdk/types/model_interface_request.py +40 -0
- label_studio_sdk/types/model_interface_serializer_get.py +45 -0
- label_studio_sdk/types/model_provider_connection.py +48 -17
- label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
- label_studio_sdk/types/model_provider_connection_request.py +71 -0
- label_studio_sdk/types/model_run.py +40 -0
- label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
- label_studio_sdk/types/null_enum.py +3 -0
- label_studio_sdk/types/onboarding_state_enum.py +7 -0
- label_studio_sdk/types/organization_billing.py +20 -0
- label_studio_sdk/types/organization_id.py +28 -0
- label_studio_sdk/types/organization_invite.py +20 -0
- label_studio_sdk/types/organization_member.py +37 -0
- label_studio_sdk/types/organization_membership.py +24 -0
- label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
- label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
- label_studio_sdk/types/pause.py +55 -14
- label_studio_sdk/types/pause_request.py +41 -0
- label_studio_sdk/types/prediction.py +7 -11
- label_studio_sdk/types/prediction_request.py +56 -0
- label_studio_sdk/types/project.py +32 -39
- label_studio_sdk/types/project_import.py +12 -13
- label_studio_sdk/types/project_label_config.py +2 -2
- label_studio_sdk/types/project_label_config_request.py +22 -0
- label_studio_sdk/types/project_sampling.py +3 -3
- label_studio_sdk/types/project_skip_queue.py +3 -1
- label_studio_sdk/types/project_subset_enum.py +5 -0
- label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
- label_studio_sdk/types/reason_enum.py +7 -0
- label_studio_sdk/types/redis_export_storage.py +8 -12
- label_studio_sdk/types/redis_import_storage.py +8 -12
- label_studio_sdk/types/refined_prompt_response.py +5 -6
- label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
- label_studio_sdk/types/review_criteria_enum.py +5 -0
- label_studio_sdk/types/review_settings.py +80 -0
- label_studio_sdk/types/review_settings_request.py +80 -0
- label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
- label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
- label_studio_sdk/types/review_settings_review_criteria.py +7 -0
- label_studio_sdk/types/reviewed_enum.py +5 -0
- label_studio_sdk/types/role_based_task.py +8 -0
- label_studio_sdk/types/s3export_storage.py +8 -12
- label_studio_sdk/types/s3import_storage.py +8 -12
- label_studio_sdk/types/sampling_enum.py +7 -0
- label_studio_sdk/types/scope_enum.py +5 -0
- label_studio_sdk/types/selected_items_request.py +23 -0
- label_studio_sdk/types/serialization_option.py +2 -6
- label_studio_sdk/types/serialization_option_request.py +22 -0
- label_studio_sdk/types/serialization_options.py +17 -5
- label_studio_sdk/types/serialization_options_request.py +47 -0
- label_studio_sdk/types/skill_name_enum.py +5 -0
- label_studio_sdk/types/skip_queue_enum.py +5 -0
- label_studio_sdk/types/skipped_enum.py +5 -0
- label_studio_sdk/types/state_enum.py +5 -0
- label_studio_sdk/types/status7bf_enum.py +5 -0
- label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
- label_studio_sdk/types/third_party_model_version.py +65 -0
- label_studio_sdk/types/third_party_model_version_request.py +54 -0
- label_studio_sdk/types/token_refresh_response.py +19 -0
- label_studio_sdk/types/token_rotate_response.py +19 -0
- label_studio_sdk/types/trial_role_enum.py +16 -0
- label_studio_sdk/types/user_simple.py +8 -5
- label_studio_sdk/types/user_simple_request.py +28 -0
- label_studio_sdk/types/version_response.py +49 -0
- label_studio_sdk/types/view.py +8 -15
- label_studio_sdk/types/webhook.py +9 -13
- label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
- label_studio_sdk/types/workspace.py +14 -34
- label_studio_sdk/types/workspace_member_create.py +27 -0
- label_studio_sdk/types/workspace_member_list.py +24 -0
- label_studio_sdk/users/client.py +604 -87
- label_studio_sdk/users/types/users_get_token_response.py +4 -11
- label_studio_sdk/users/types/users_reset_token_response.py +4 -11
- label_studio_sdk/versions/__init__.py +0 -3
- label_studio_sdk/versions/client.py +14 -14
- label_studio_sdk/views/client.py +227 -141
- label_studio_sdk/views/types/views_create_request_data.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
- label_studio_sdk/views/types/views_update_request_data.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
- label_studio_sdk/webhooks/__init__.py +36 -2
- label_studio_sdk/webhooks/client.py +173 -367
- label_studio_sdk/webhooks/types/__init__.py +34 -2
- label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
- label_studio_sdk/workspaces/__init__.py +1 -2
- label_studio_sdk/workspaces/client.py +97 -117
- label_studio_sdk/workspaces/members/__init__.py +0 -3
- label_studio_sdk/workspaces/members/client.py +65 -81
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/METADATA +1 -1
- label_studio_sdk-2.0.0.dist-info/RECORD +424 -0
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/WHEEL +1 -1
- label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
- label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
- label_studio_sdk/export_storage/local/types/__init__.py +0 -6
- label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
- label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
- label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
- label_studio_sdk/import_storage/local/types/__init__.py +0 -6
- label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
- label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
- label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
- label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
- label_studio_sdk/ml/types/ml_create_response.py +0 -68
- label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
- label_studio_sdk/ml/types/ml_update_response.py +0 -68
- label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
- label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
- label_studio_sdk/projects/types/projects_create_response.py +0 -91
- label_studio_sdk/projects/types/projects_update_response.py +0 -96
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
- label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
- label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
- label_studio_sdk/types/annotation_completed_by.py +0 -6
- label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
- label_studio_sdk/types/base_task_updated_by.py +0 -7
- label_studio_sdk/types/comment_created_by.py +0 -5
- label_studio_sdk/types/converted_format_status.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer.py +0 -118
- label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
- label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
- label_studio_sdk/types/export_format.py +0 -25
- label_studio_sdk/types/export_snapshot_status.py +0 -5
- label_studio_sdk/types/export_status.py +0 -5
- label_studio_sdk/types/gcs_export_storage_status.py +0 -7
- label_studio_sdk/types/gcs_import_storage_status.py +0 -7
- label_studio_sdk/types/inference_run.py +0 -34
- label_studio_sdk/types/inference_run_created_by.py +0 -5
- label_studio_sdk/types/inference_run_organization.py +0 -5
- label_studio_sdk/types/inference_run_project_subset.py +0 -5
- label_studio_sdk/types/key_indicators.py +0 -6
- label_studio_sdk/types/key_indicators_item.py +0 -41
- label_studio_sdk/types/local_files_export_storage_status.py +0 -7
- label_studio_sdk/types/local_files_import_storage_status.py +0 -7
- label_studio_sdk/types/ml_backend_auth_method.py +0 -5
- label_studio_sdk/types/ml_backend_state.py +0 -5
- label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
- label_studio_sdk/types/model_provider_connection_organization.py +0 -5
- label_studio_sdk/types/model_provider_connection_provider.py +0 -7
- label_studio_sdk/types/model_provider_connection_scope.py +0 -5
- label_studio_sdk/types/pause_paused_by.py +0 -5
- label_studio_sdk/types/project_import_status.py +0 -5
- label_studio_sdk/types/prompt.py +0 -71
- label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
- label_studio_sdk/types/prompt_created_by.py +0 -5
- label_studio_sdk/types/prompt_organization.py +0 -5
- label_studio_sdk/types/prompt_version.py +0 -32
- label_studio_sdk/types/prompt_version_created_by.py +0 -5
- label_studio_sdk/types/prompt_version_organization.py +0 -5
- label_studio_sdk/types/redis_export_storage_status.py +0 -7
- label_studio_sdk/types/redis_import_storage_status.py +0 -7
- label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
- label_studio_sdk/types/s3export_storage_status.py +0 -7
- label_studio_sdk/types/s3import_storage_status.py +0 -7
- label_studio_sdk/types/s3s_export_storage.py +0 -73
- label_studio_sdk/types/s3s_import_storage_status.py +0 -7
- label_studio_sdk/types/task.py +0 -156
- label_studio_sdk/types/task_annotators_item.py +0 -5
- label_studio_sdk/types/task_comment_authors_item.py +0 -5
- label_studio_sdk/types/task_filter_options.py +0 -39
- label_studio_sdk/types/webhook_actions_item.py +0 -21
- label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
- label_studio_sdk/versions/types/__init__.py +0 -6
- label_studio_sdk/versions/types/versions_get_response.py +0 -73
- label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
- label_studio_sdk/workspaces/members/types/__init__.py +0 -6
- label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
- label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
- label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
- {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.0.dist-info}/LICENSE +0 -0
label_studio_sdk/ml/client.py
CHANGED
|
@@ -4,15 +4,14 @@ import typing
|
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
6
|
from ..types.ml_backend import MlBackend
|
|
7
|
-
from ..core.
|
|
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 .types.ml_create_request_auth_method import MlCreateRequestAuthMethod
|
|
11
|
-
from .types.ml_create_response import MlCreateResponse
|
|
12
11
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
12
|
from .types.ml_update_request_auth_method import MlUpdateRequestAuthMethod
|
|
14
|
-
from .types.ml_update_response import MlUpdateResponse
|
|
15
13
|
from ..errors.internal_server_error import InternalServerError
|
|
14
|
+
from .types.ml_list_model_versions_response import MlListModelVersionsResponse
|
|
16
15
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
17
16
|
|
|
18
17
|
# this is used as the default value for optional parameters
|
|
@@ -28,11 +27,12 @@ class MlClient:
|
|
|
28
27
|
) -> typing.List[MlBackend]:
|
|
29
28
|
"""
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
List all configured ML backends for a specific project by ID.
|
|
31
|
+
Use the following cURL command:
|
|
32
|
+
```bash
|
|
33
|
+
curl http://localhost:8000/api/ml?project={project_id} -H 'Authorization: Token abc123'
|
|
32
34
|
|
|
33
35
|
|
|
34
|
-
You will need to provide the project ID. This 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).
|
|
35
|
-
|
|
36
36
|
Parameters
|
|
37
37
|
----------
|
|
38
38
|
project : typing.Optional[int]
|
|
@@ -67,7 +67,7 @@ class MlClient:
|
|
|
67
67
|
if 200 <= _response.status_code < 300:
|
|
68
68
|
return typing.cast(
|
|
69
69
|
typing.List[MlBackend],
|
|
70
|
-
|
|
70
|
+
construct_type(
|
|
71
71
|
type_=typing.List[MlBackend], # type: ignore
|
|
72
72
|
object_=_response.json(),
|
|
73
73
|
),
|
|
@@ -91,59 +91,60 @@ class MlClient:
|
|
|
91
91
|
extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
92
92
|
timeout: typing.Optional[int] = OMIT,
|
|
93
93
|
request_options: typing.Optional[RequestOptions] = None,
|
|
94
|
-
) ->
|
|
94
|
+
) -> MlBackend:
|
|
95
95
|
"""
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
|
|
97
|
+
Add an ML backend to a project using the Label Studio UI or by sending a POST request using the following cURL
|
|
98
|
+
command:
|
|
99
|
+
```bash
|
|
100
|
+
curl -X POST -H 'Content-type: application/json' http://localhost:8000/api/ml -H 'Authorization: Token abc123'\
|
|
101
|
+
--data '{"url": "http://localhost:9090", "project": {project_id}}'
|
|
102
|
+
|
|
103
|
+
|
|
103
104
|
Parameters
|
|
104
105
|
----------
|
|
105
106
|
url : typing.Optional[str]
|
|
106
107
|
ML backend URL
|
|
107
|
-
|
|
108
|
+
|
|
108
109
|
project : typing.Optional[int]
|
|
109
110
|
Project ID
|
|
110
|
-
|
|
111
|
+
|
|
111
112
|
is_interactive : typing.Optional[bool]
|
|
112
113
|
Is interactive
|
|
113
|
-
|
|
114
|
+
|
|
114
115
|
title : typing.Optional[str]
|
|
115
116
|
Title
|
|
116
|
-
|
|
117
|
+
|
|
117
118
|
description : typing.Optional[str]
|
|
118
119
|
Description
|
|
119
|
-
|
|
120
|
+
|
|
120
121
|
auth_method : typing.Optional[MlCreateRequestAuthMethod]
|
|
121
122
|
Auth method
|
|
122
|
-
|
|
123
|
+
|
|
123
124
|
basic_auth_user : typing.Optional[str]
|
|
124
125
|
Basic auth user
|
|
125
|
-
|
|
126
|
+
|
|
126
127
|
basic_auth_pass : typing.Optional[str]
|
|
127
128
|
Basic auth password
|
|
128
|
-
|
|
129
|
+
|
|
129
130
|
extra_params : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
130
131
|
Extra parameters
|
|
131
|
-
|
|
132
|
+
|
|
132
133
|
timeout : typing.Optional[int]
|
|
133
134
|
Response model timeout
|
|
134
|
-
|
|
135
|
+
|
|
135
136
|
request_options : typing.Optional[RequestOptions]
|
|
136
137
|
Request-specific configuration.
|
|
137
|
-
|
|
138
|
+
|
|
138
139
|
Returns
|
|
139
140
|
-------
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
MlBackend
|
|
142
|
+
|
|
143
|
+
|
|
143
144
|
Examples
|
|
144
145
|
--------
|
|
145
146
|
from label_studio_sdk import LabelStudio
|
|
146
|
-
|
|
147
|
+
|
|
147
148
|
client = LabelStudio(
|
|
148
149
|
api_key="YOUR_API_KEY",
|
|
149
150
|
)
|
|
@@ -173,9 +174,9 @@ class MlClient:
|
|
|
173
174
|
try:
|
|
174
175
|
if 200 <= _response.status_code < 300:
|
|
175
176
|
return typing.cast(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
type_=
|
|
177
|
+
MlBackend,
|
|
178
|
+
construct_type(
|
|
179
|
+
type_=MlBackend, # type: ignore
|
|
179
180
|
object_=_response.json(),
|
|
180
181
|
),
|
|
181
182
|
)
|
|
@@ -187,14 +188,15 @@ class MlClient:
|
|
|
187
188
|
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MlBackend:
|
|
188
189
|
"""
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
Get details about a specific ML backend connection by ID. For example, make a GET request using the
|
|
192
|
+
following cURL command:
|
|
193
|
+
```bash
|
|
194
|
+
curl http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'
|
|
191
195
|
|
|
192
|
-
For more information, see [Machine learning integration](https://labelstud.io/guide/ml).
|
|
193
196
|
|
|
194
197
|
Parameters
|
|
195
198
|
----------
|
|
196
199
|
id : int
|
|
197
|
-
A unique integer value identifying this ml backend.
|
|
198
200
|
|
|
199
201
|
request_options : typing.Optional[RequestOptions]
|
|
200
202
|
Request-specific configuration.
|
|
@@ -224,7 +226,7 @@ class MlClient:
|
|
|
224
226
|
if 200 <= _response.status_code < 300:
|
|
225
227
|
return typing.cast(
|
|
226
228
|
MlBackend,
|
|
227
|
-
|
|
229
|
+
construct_type(
|
|
228
230
|
type_=MlBackend, # type: ignore
|
|
229
231
|
object_=_response.json(),
|
|
230
232
|
),
|
|
@@ -237,14 +239,15 @@ class MlClient:
|
|
|
237
239
|
def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
238
240
|
"""
|
|
239
241
|
|
|
240
|
-
|
|
242
|
+
Remove an existing ML backend connection by ID. For example, use the
|
|
243
|
+
following cURL command:
|
|
244
|
+
```bash
|
|
245
|
+
curl -X DELETE http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'
|
|
241
246
|
|
|
242
|
-
For more information, see [Machine learning integration](https://labelstud.io/guide/ml).
|
|
243
247
|
|
|
244
248
|
Parameters
|
|
245
249
|
----------
|
|
246
250
|
id : int
|
|
247
|
-
A unique integer value identifying this ml backend.
|
|
248
251
|
|
|
249
252
|
request_options : typing.Optional[RequestOptions]
|
|
250
253
|
Request-specific configuration.
|
|
@@ -292,60 +295,61 @@ class MlClient:
|
|
|
292
295
|
extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
293
296
|
timeout: typing.Optional[int] = OMIT,
|
|
294
297
|
request_options: typing.Optional[RequestOptions] = None,
|
|
295
|
-
) ->
|
|
298
|
+
) -> MlBackend:
|
|
296
299
|
"""
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
|
|
301
|
+
Update ML backend parameters using the Label Studio UI or by sending a PATCH request using the following cURL command:
|
|
302
|
+
```bash
|
|
303
|
+
curl -X PATCH -H 'Content-type: application/json' http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'\
|
|
304
|
+
--data '{"url": "http://localhost:9091"}'
|
|
305
|
+
|
|
306
|
+
|
|
302
307
|
Parameters
|
|
303
308
|
----------
|
|
304
309
|
id : int
|
|
305
|
-
|
|
306
|
-
|
|
310
|
+
|
|
307
311
|
url : typing.Optional[str]
|
|
308
312
|
ML backend URL
|
|
309
|
-
|
|
313
|
+
|
|
310
314
|
project : typing.Optional[int]
|
|
311
315
|
Project ID
|
|
312
|
-
|
|
316
|
+
|
|
313
317
|
is_interactive : typing.Optional[bool]
|
|
314
318
|
Is interactive
|
|
315
|
-
|
|
319
|
+
|
|
316
320
|
title : typing.Optional[str]
|
|
317
321
|
Title
|
|
318
|
-
|
|
322
|
+
|
|
319
323
|
description : typing.Optional[str]
|
|
320
324
|
Description
|
|
321
|
-
|
|
325
|
+
|
|
322
326
|
auth_method : typing.Optional[MlUpdateRequestAuthMethod]
|
|
323
327
|
Auth method
|
|
324
|
-
|
|
328
|
+
|
|
325
329
|
basic_auth_user : typing.Optional[str]
|
|
326
330
|
Basic auth user
|
|
327
|
-
|
|
331
|
+
|
|
328
332
|
basic_auth_pass : typing.Optional[str]
|
|
329
333
|
Basic auth password
|
|
330
|
-
|
|
334
|
+
|
|
331
335
|
extra_params : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
332
336
|
Extra parameters
|
|
333
|
-
|
|
337
|
+
|
|
334
338
|
timeout : typing.Optional[int]
|
|
335
339
|
Response model timeout
|
|
336
|
-
|
|
340
|
+
|
|
337
341
|
request_options : typing.Optional[RequestOptions]
|
|
338
342
|
Request-specific configuration.
|
|
339
|
-
|
|
343
|
+
|
|
340
344
|
Returns
|
|
341
345
|
-------
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
346
|
+
MlBackend
|
|
347
|
+
|
|
348
|
+
|
|
345
349
|
Examples
|
|
346
350
|
--------
|
|
347
351
|
from label_studio_sdk import LabelStudio
|
|
348
|
-
|
|
352
|
+
|
|
349
353
|
client = LabelStudio(
|
|
350
354
|
api_key="YOUR_API_KEY",
|
|
351
355
|
)
|
|
@@ -377,9 +381,9 @@ class MlClient:
|
|
|
377
381
|
try:
|
|
378
382
|
if 200 <= _response.status_code < 300:
|
|
379
383
|
return typing.cast(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
type_=
|
|
384
|
+
MlBackend,
|
|
385
|
+
construct_type(
|
|
386
|
+
type_=MlBackend, # type: ignore
|
|
383
387
|
object_=_response.json(),
|
|
384
388
|
),
|
|
385
389
|
)
|
|
@@ -393,18 +397,15 @@ class MlClient:
|
|
|
393
397
|
id: int,
|
|
394
398
|
*,
|
|
395
399
|
task: int,
|
|
396
|
-
context: typing.Optional[typing.
|
|
400
|
+
context: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
397
401
|
request_options: typing.Optional[RequestOptions] = None,
|
|
398
402
|
) -> None:
|
|
399
403
|
"""
|
|
400
404
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
Before you can use interactive annotations, it must be enabled for you ML backend connection (`"is_interactive": true`).
|
|
405
|
+
Send a request to the machine learning backend set up to be used for interactive preannotations to retrieve a
|
|
406
|
+
predicted region based on annotator input.
|
|
407
|
+
See [set up machine learning](https://labelstud.io/guide/ml.html#Get-interactive-preannotations) for more.
|
|
406
408
|
|
|
407
|
-
You will need the task ID and the ML backend connection ID. The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](../tasks/list). The ML backend connection ID is available via [List ML backends](list).
|
|
408
409
|
|
|
409
410
|
Parameters
|
|
410
411
|
----------
|
|
@@ -414,8 +415,7 @@ class MlClient:
|
|
|
414
415
|
task : int
|
|
415
416
|
ID of task to annotate
|
|
416
417
|
|
|
417
|
-
context : typing.Optional[typing.
|
|
418
|
-
Context for ML model
|
|
418
|
+
context : typing.Optional[typing.Optional[typing.Any]]
|
|
419
419
|
|
|
420
420
|
request_options : typing.Optional[RequestOptions]
|
|
421
421
|
Request-specific configuration.
|
|
@@ -466,11 +466,11 @@ class MlClient:
|
|
|
466
466
|
) -> None:
|
|
467
467
|
"""
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
After you add an ML backend, call this API with the ML backend ID to start training with
|
|
470
|
+
already-labeled tasks.
|
|
470
471
|
|
|
471
|
-
|
|
472
|
+
Get the ML backend ID by [listing the ML backends for a project](https://labelstud.io/api/#operation/api_ml_list).
|
|
472
473
|
|
|
473
|
-
You will need to specify an ID for the backend connection. You can find this using [List ML backends](list).
|
|
474
474
|
|
|
475
475
|
Parameters
|
|
476
476
|
----------
|
|
@@ -517,7 +517,7 @@ class MlClient:
|
|
|
517
517
|
raise InternalServerError(
|
|
518
518
|
typing.cast(
|
|
519
519
|
str,
|
|
520
|
-
|
|
520
|
+
construct_type(
|
|
521
521
|
type_=str, # type: ignore
|
|
522
522
|
object_=_response.json(),
|
|
523
523
|
),
|
|
@@ -528,21 +528,23 @@ class MlClient:
|
|
|
528
528
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
529
529
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
530
530
|
|
|
531
|
-
def list_model_versions(
|
|
531
|
+
def list_model_versions(
|
|
532
|
+
self, id: int, *, request_options: typing.Optional[RequestOptions] = None
|
|
533
|
+
) -> MlListModelVersionsResponse:
|
|
532
534
|
"""
|
|
533
|
-
|
|
534
|
-
Get available versions of the model. You will need to specify an ID for the backend connection. You can find this using [List ML backends](list).
|
|
535
|
+
Get available versions of the model.
|
|
535
536
|
|
|
536
537
|
Parameters
|
|
537
538
|
----------
|
|
538
|
-
id :
|
|
539
|
+
id : int
|
|
539
540
|
|
|
540
541
|
request_options : typing.Optional[RequestOptions]
|
|
541
542
|
Request-specific configuration.
|
|
542
543
|
|
|
543
544
|
Returns
|
|
544
545
|
-------
|
|
545
|
-
|
|
546
|
+
MlListModelVersionsResponse
|
|
547
|
+
List of available versions.
|
|
546
548
|
|
|
547
549
|
Examples
|
|
548
550
|
--------
|
|
@@ -552,7 +554,7 @@ class MlClient:
|
|
|
552
554
|
api_key="YOUR_API_KEY",
|
|
553
555
|
)
|
|
554
556
|
client.ml.list_model_versions(
|
|
555
|
-
id=
|
|
557
|
+
id=1,
|
|
556
558
|
)
|
|
557
559
|
"""
|
|
558
560
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -562,7 +564,13 @@ class MlClient:
|
|
|
562
564
|
)
|
|
563
565
|
try:
|
|
564
566
|
if 200 <= _response.status_code < 300:
|
|
565
|
-
return
|
|
567
|
+
return typing.cast(
|
|
568
|
+
MlListModelVersionsResponse,
|
|
569
|
+
construct_type(
|
|
570
|
+
type_=MlListModelVersionsResponse, # type: ignore
|
|
571
|
+
object_=_response.json(),
|
|
572
|
+
),
|
|
573
|
+
)
|
|
566
574
|
_response_json = _response.json()
|
|
567
575
|
except JSONDecodeError:
|
|
568
576
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -578,11 +586,12 @@ class AsyncMlClient:
|
|
|
578
586
|
) -> typing.List[MlBackend]:
|
|
579
587
|
"""
|
|
580
588
|
|
|
581
|
-
|
|
589
|
+
List all configured ML backends for a specific project by ID.
|
|
590
|
+
Use the following cURL command:
|
|
591
|
+
```bash
|
|
592
|
+
curl http://localhost:8000/api/ml?project={project_id} -H 'Authorization: Token abc123'
|
|
582
593
|
|
|
583
594
|
|
|
584
|
-
You will need to provide the project ID. This 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).
|
|
585
|
-
|
|
586
595
|
Parameters
|
|
587
596
|
----------
|
|
588
597
|
project : typing.Optional[int]
|
|
@@ -625,7 +634,7 @@ class AsyncMlClient:
|
|
|
625
634
|
if 200 <= _response.status_code < 300:
|
|
626
635
|
return typing.cast(
|
|
627
636
|
typing.List[MlBackend],
|
|
628
|
-
|
|
637
|
+
construct_type(
|
|
629
638
|
type_=typing.List[MlBackend], # type: ignore
|
|
630
639
|
object_=_response.json(),
|
|
631
640
|
),
|
|
@@ -649,70 +658,71 @@ class AsyncMlClient:
|
|
|
649
658
|
extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
650
659
|
timeout: typing.Optional[int] = OMIT,
|
|
651
660
|
request_options: typing.Optional[RequestOptions] = None,
|
|
652
|
-
) ->
|
|
661
|
+
) -> MlBackend:
|
|
653
662
|
"""
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
663
|
+
|
|
664
|
+
Add an ML backend to a project using the Label Studio UI or by sending a POST request using the following cURL
|
|
665
|
+
command:
|
|
666
|
+
```bash
|
|
667
|
+
curl -X POST -H 'Content-type: application/json' http://localhost:8000/api/ml -H 'Authorization: Token abc123'\
|
|
668
|
+
--data '{"url": "http://localhost:9090", "project": {project_id}}'
|
|
669
|
+
|
|
670
|
+
|
|
661
671
|
Parameters
|
|
662
672
|
----------
|
|
663
673
|
url : typing.Optional[str]
|
|
664
674
|
ML backend URL
|
|
665
|
-
|
|
675
|
+
|
|
666
676
|
project : typing.Optional[int]
|
|
667
677
|
Project ID
|
|
668
|
-
|
|
678
|
+
|
|
669
679
|
is_interactive : typing.Optional[bool]
|
|
670
680
|
Is interactive
|
|
671
|
-
|
|
681
|
+
|
|
672
682
|
title : typing.Optional[str]
|
|
673
683
|
Title
|
|
674
|
-
|
|
684
|
+
|
|
675
685
|
description : typing.Optional[str]
|
|
676
686
|
Description
|
|
677
|
-
|
|
687
|
+
|
|
678
688
|
auth_method : typing.Optional[MlCreateRequestAuthMethod]
|
|
679
689
|
Auth method
|
|
680
|
-
|
|
690
|
+
|
|
681
691
|
basic_auth_user : typing.Optional[str]
|
|
682
692
|
Basic auth user
|
|
683
|
-
|
|
693
|
+
|
|
684
694
|
basic_auth_pass : typing.Optional[str]
|
|
685
695
|
Basic auth password
|
|
686
|
-
|
|
696
|
+
|
|
687
697
|
extra_params : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
688
698
|
Extra parameters
|
|
689
|
-
|
|
699
|
+
|
|
690
700
|
timeout : typing.Optional[int]
|
|
691
701
|
Response model timeout
|
|
692
|
-
|
|
702
|
+
|
|
693
703
|
request_options : typing.Optional[RequestOptions]
|
|
694
704
|
Request-specific configuration.
|
|
695
|
-
|
|
705
|
+
|
|
696
706
|
Returns
|
|
697
707
|
-------
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
708
|
+
MlBackend
|
|
709
|
+
|
|
710
|
+
|
|
701
711
|
Examples
|
|
702
712
|
--------
|
|
703
713
|
import asyncio
|
|
704
|
-
|
|
714
|
+
|
|
705
715
|
from label_studio_sdk import AsyncLabelStudio
|
|
706
|
-
|
|
716
|
+
|
|
707
717
|
client = AsyncLabelStudio(
|
|
708
718
|
api_key="YOUR_API_KEY",
|
|
709
719
|
)
|
|
710
|
-
|
|
711
|
-
|
|
720
|
+
|
|
721
|
+
|
|
712
722
|
async def main() -> None:
|
|
713
723
|
await client.ml.create()
|
|
714
|
-
|
|
715
|
-
|
|
724
|
+
|
|
725
|
+
|
|
716
726
|
asyncio.run(main())
|
|
717
727
|
"""
|
|
718
728
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -739,9 +749,9 @@ class AsyncMlClient:
|
|
|
739
749
|
try:
|
|
740
750
|
if 200 <= _response.status_code < 300:
|
|
741
751
|
return typing.cast(
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
type_=
|
|
752
|
+
MlBackend,
|
|
753
|
+
construct_type(
|
|
754
|
+
type_=MlBackend, # type: ignore
|
|
745
755
|
object_=_response.json(),
|
|
746
756
|
),
|
|
747
757
|
)
|
|
@@ -753,14 +763,15 @@ class AsyncMlClient:
|
|
|
753
763
|
async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MlBackend:
|
|
754
764
|
"""
|
|
755
765
|
|
|
756
|
-
|
|
766
|
+
Get details about a specific ML backend connection by ID. For example, make a GET request using the
|
|
767
|
+
following cURL command:
|
|
768
|
+
```bash
|
|
769
|
+
curl http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'
|
|
757
770
|
|
|
758
|
-
For more information, see [Machine learning integration](https://labelstud.io/guide/ml).
|
|
759
771
|
|
|
760
772
|
Parameters
|
|
761
773
|
----------
|
|
762
774
|
id : int
|
|
763
|
-
A unique integer value identifying this ml backend.
|
|
764
775
|
|
|
765
776
|
request_options : typing.Optional[RequestOptions]
|
|
766
777
|
Request-specific configuration.
|
|
@@ -798,7 +809,7 @@ class AsyncMlClient:
|
|
|
798
809
|
if 200 <= _response.status_code < 300:
|
|
799
810
|
return typing.cast(
|
|
800
811
|
MlBackend,
|
|
801
|
-
|
|
812
|
+
construct_type(
|
|
802
813
|
type_=MlBackend, # type: ignore
|
|
803
814
|
object_=_response.json(),
|
|
804
815
|
),
|
|
@@ -811,14 +822,15 @@ class AsyncMlClient:
|
|
|
811
822
|
async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
812
823
|
"""
|
|
813
824
|
|
|
814
|
-
|
|
825
|
+
Remove an existing ML backend connection by ID. For example, use the
|
|
826
|
+
following cURL command:
|
|
827
|
+
```bash
|
|
828
|
+
curl -X DELETE http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'
|
|
815
829
|
|
|
816
|
-
For more information, see [Machine learning integration](https://labelstud.io/guide/ml).
|
|
817
830
|
|
|
818
831
|
Parameters
|
|
819
832
|
----------
|
|
820
833
|
id : int
|
|
821
|
-
A unique integer value identifying this ml backend.
|
|
822
834
|
|
|
823
835
|
request_options : typing.Optional[RequestOptions]
|
|
824
836
|
Request-specific configuration.
|
|
@@ -874,73 +886,74 @@ class AsyncMlClient:
|
|
|
874
886
|
extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
875
887
|
timeout: typing.Optional[int] = OMIT,
|
|
876
888
|
request_options: typing.Optional[RequestOptions] = None,
|
|
877
|
-
) ->
|
|
889
|
+
) -> MlBackend:
|
|
878
890
|
"""
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
891
|
+
|
|
892
|
+
Update ML backend parameters using the Label Studio UI or by sending a PATCH request using the following cURL command:
|
|
893
|
+
```bash
|
|
894
|
+
curl -X PATCH -H 'Content-type: application/json' http://localhost:8000/api/ml/{ml_backend_ID} -H 'Authorization: Token abc123'\
|
|
895
|
+
--data '{"url": "http://localhost:9091"}'
|
|
896
|
+
|
|
897
|
+
|
|
884
898
|
Parameters
|
|
885
899
|
----------
|
|
886
900
|
id : int
|
|
887
|
-
|
|
888
|
-
|
|
901
|
+
|
|
889
902
|
url : typing.Optional[str]
|
|
890
903
|
ML backend URL
|
|
891
|
-
|
|
904
|
+
|
|
892
905
|
project : typing.Optional[int]
|
|
893
906
|
Project ID
|
|
894
|
-
|
|
907
|
+
|
|
895
908
|
is_interactive : typing.Optional[bool]
|
|
896
909
|
Is interactive
|
|
897
|
-
|
|
910
|
+
|
|
898
911
|
title : typing.Optional[str]
|
|
899
912
|
Title
|
|
900
|
-
|
|
913
|
+
|
|
901
914
|
description : typing.Optional[str]
|
|
902
915
|
Description
|
|
903
|
-
|
|
916
|
+
|
|
904
917
|
auth_method : typing.Optional[MlUpdateRequestAuthMethod]
|
|
905
918
|
Auth method
|
|
906
|
-
|
|
919
|
+
|
|
907
920
|
basic_auth_user : typing.Optional[str]
|
|
908
921
|
Basic auth user
|
|
909
|
-
|
|
922
|
+
|
|
910
923
|
basic_auth_pass : typing.Optional[str]
|
|
911
924
|
Basic auth password
|
|
912
|
-
|
|
925
|
+
|
|
913
926
|
extra_params : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
914
927
|
Extra parameters
|
|
915
|
-
|
|
928
|
+
|
|
916
929
|
timeout : typing.Optional[int]
|
|
917
930
|
Response model timeout
|
|
918
|
-
|
|
931
|
+
|
|
919
932
|
request_options : typing.Optional[RequestOptions]
|
|
920
933
|
Request-specific configuration.
|
|
921
|
-
|
|
934
|
+
|
|
922
935
|
Returns
|
|
923
936
|
-------
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
937
|
+
MlBackend
|
|
938
|
+
|
|
939
|
+
|
|
927
940
|
Examples
|
|
928
941
|
--------
|
|
929
942
|
import asyncio
|
|
930
|
-
|
|
943
|
+
|
|
931
944
|
from label_studio_sdk import AsyncLabelStudio
|
|
932
|
-
|
|
945
|
+
|
|
933
946
|
client = AsyncLabelStudio(
|
|
934
947
|
api_key="YOUR_API_KEY",
|
|
935
948
|
)
|
|
936
|
-
|
|
937
|
-
|
|
949
|
+
|
|
950
|
+
|
|
938
951
|
async def main() -> None:
|
|
939
952
|
await client.ml.update(
|
|
940
953
|
id=1,
|
|
941
954
|
)
|
|
942
|
-
|
|
943
|
-
|
|
955
|
+
|
|
956
|
+
|
|
944
957
|
asyncio.run(main())
|
|
945
958
|
"""
|
|
946
959
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -967,9 +980,9 @@ class AsyncMlClient:
|
|
|
967
980
|
try:
|
|
968
981
|
if 200 <= _response.status_code < 300:
|
|
969
982
|
return typing.cast(
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
type_=
|
|
983
|
+
MlBackend,
|
|
984
|
+
construct_type(
|
|
985
|
+
type_=MlBackend, # type: ignore
|
|
973
986
|
object_=_response.json(),
|
|
974
987
|
),
|
|
975
988
|
)
|
|
@@ -983,18 +996,15 @@ class AsyncMlClient:
|
|
|
983
996
|
id: int,
|
|
984
997
|
*,
|
|
985
998
|
task: int,
|
|
986
|
-
context: typing.Optional[typing.
|
|
999
|
+
context: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
987
1000
|
request_options: typing.Optional[RequestOptions] = None,
|
|
988
1001
|
) -> None:
|
|
989
1002
|
"""
|
|
990
1003
|
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1004
|
+
Send a request to the machine learning backend set up to be used for interactive preannotations to retrieve a
|
|
1005
|
+
predicted region based on annotator input.
|
|
1006
|
+
See [set up machine learning](https://labelstud.io/guide/ml.html#Get-interactive-preannotations) for more.
|
|
994
1007
|
|
|
995
|
-
Before you can use interactive annotations, it must be enabled for you ML backend connection (`"is_interactive": true`).
|
|
996
|
-
|
|
997
|
-
You will need the task ID and the ML backend connection ID. The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with [Get task list](../tasks/list). The ML backend connection ID is available via [List ML backends](list).
|
|
998
1008
|
|
|
999
1009
|
Parameters
|
|
1000
1010
|
----------
|
|
@@ -1004,8 +1014,7 @@ class AsyncMlClient:
|
|
|
1004
1014
|
task : int
|
|
1005
1015
|
ID of task to annotate
|
|
1006
1016
|
|
|
1007
|
-
context : typing.Optional[typing.
|
|
1008
|
-
Context for ML model
|
|
1017
|
+
context : typing.Optional[typing.Optional[typing.Any]]
|
|
1009
1018
|
|
|
1010
1019
|
request_options : typing.Optional[RequestOptions]
|
|
1011
1020
|
Request-specific configuration.
|
|
@@ -1064,11 +1073,11 @@ class AsyncMlClient:
|
|
|
1064
1073
|
) -> None:
|
|
1065
1074
|
"""
|
|
1066
1075
|
|
|
1067
|
-
|
|
1076
|
+
After you add an ML backend, call this API with the ML backend ID to start training with
|
|
1077
|
+
already-labeled tasks.
|
|
1068
1078
|
|
|
1069
|
-
|
|
1079
|
+
Get the ML backend ID by [listing the ML backends for a project](https://labelstud.io/api/#operation/api_ml_list).
|
|
1070
1080
|
|
|
1071
|
-
You will need to specify an ID for the backend connection. You can find this using [List ML backends](list).
|
|
1072
1081
|
|
|
1073
1082
|
Parameters
|
|
1074
1083
|
----------
|
|
@@ -1123,7 +1132,7 @@ class AsyncMlClient:
|
|
|
1123
1132
|
raise InternalServerError(
|
|
1124
1133
|
typing.cast(
|
|
1125
1134
|
str,
|
|
1126
|
-
|
|
1135
|
+
construct_type(
|
|
1127
1136
|
type_=str, # type: ignore
|
|
1128
1137
|
object_=_response.json(),
|
|
1129
1138
|
),
|
|
@@ -1134,21 +1143,23 @@ class AsyncMlClient:
|
|
|
1134
1143
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1135
1144
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1136
1145
|
|
|
1137
|
-
async def list_model_versions(
|
|
1146
|
+
async def list_model_versions(
|
|
1147
|
+
self, id: int, *, request_options: typing.Optional[RequestOptions] = None
|
|
1148
|
+
) -> MlListModelVersionsResponse:
|
|
1138
1149
|
"""
|
|
1139
|
-
|
|
1140
|
-
Get available versions of the model. You will need to specify an ID for the backend connection. You can find this using [List ML backends](list).
|
|
1150
|
+
Get available versions of the model.
|
|
1141
1151
|
|
|
1142
1152
|
Parameters
|
|
1143
1153
|
----------
|
|
1144
|
-
id :
|
|
1154
|
+
id : int
|
|
1145
1155
|
|
|
1146
1156
|
request_options : typing.Optional[RequestOptions]
|
|
1147
1157
|
Request-specific configuration.
|
|
1148
1158
|
|
|
1149
1159
|
Returns
|
|
1150
1160
|
-------
|
|
1151
|
-
|
|
1161
|
+
MlListModelVersionsResponse
|
|
1162
|
+
List of available versions.
|
|
1152
1163
|
|
|
1153
1164
|
Examples
|
|
1154
1165
|
--------
|
|
@@ -1163,7 +1174,7 @@ class AsyncMlClient:
|
|
|
1163
1174
|
|
|
1164
1175
|
async def main() -> None:
|
|
1165
1176
|
await client.ml.list_model_versions(
|
|
1166
|
-
id=
|
|
1177
|
+
id=1,
|
|
1167
1178
|
)
|
|
1168
1179
|
|
|
1169
1180
|
|
|
@@ -1176,7 +1187,13 @@ class AsyncMlClient:
|
|
|
1176
1187
|
)
|
|
1177
1188
|
try:
|
|
1178
1189
|
if 200 <= _response.status_code < 300:
|
|
1179
|
-
return
|
|
1190
|
+
return typing.cast(
|
|
1191
|
+
MlListModelVersionsResponse,
|
|
1192
|
+
construct_type(
|
|
1193
|
+
type_=MlListModelVersionsResponse, # type: ignore
|
|
1194
|
+
object_=_response.json(),
|
|
1195
|
+
),
|
|
1196
|
+
)
|
|
1180
1197
|
_response_json = _response.json()
|
|
1181
1198
|
except JSONDecodeError:
|
|
1182
1199
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|