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
|
@@ -4,17 +4,13 @@ import typing
|
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
6
|
from ..types.model_provider_connection import ModelProviderConnection
|
|
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
|
-
from ..types.
|
|
11
|
-
from ..types.
|
|
12
|
-
from ..types.model_provider_connection_organization import ModelProviderConnectionOrganization
|
|
13
|
-
from ..types.model_provider_connection_created_by import ModelProviderConnectionCreatedBy
|
|
14
|
-
import datetime as dt
|
|
15
|
-
from ..types.model_provider_connection_budget_reset_period import ModelProviderConnectionBudgetResetPeriod
|
|
16
|
-
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
10
|
+
from ..types.provider_enum import ProviderEnum
|
|
11
|
+
from ..types.scope_enum import ScopeEnum
|
|
17
12
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
|
+
from .types.model_providers_list_model_provider_choices_response import ModelProvidersListModelProviderChoicesResponse
|
|
18
14
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
19
15
|
|
|
20
16
|
# this is used as the default value for optional parameters
|
|
@@ -25,12 +21,17 @@ class ModelProvidersClient:
|
|
|
25
21
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
26
22
|
self._client_wrapper = client_wrapper
|
|
27
23
|
|
|
28
|
-
def list(
|
|
24
|
+
def list(
|
|
25
|
+
self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
26
|
+
) -> typing.List[ModelProviderConnection]:
|
|
29
27
|
"""
|
|
30
|
-
|
|
28
|
+
List all model provider connections.
|
|
31
29
|
|
|
32
30
|
Parameters
|
|
33
31
|
----------
|
|
32
|
+
ordering : typing.Optional[str]
|
|
33
|
+
Which field to use when ordering the results.
|
|
34
|
+
|
|
34
35
|
request_options : typing.Optional[RequestOptions]
|
|
35
36
|
Request-specific configuration.
|
|
36
37
|
|
|
@@ -51,13 +52,16 @@ class ModelProvidersClient:
|
|
|
51
52
|
_response = self._client_wrapper.httpx_client.request(
|
|
52
53
|
"api/model-provider-connections/",
|
|
53
54
|
method="GET",
|
|
55
|
+
params={
|
|
56
|
+
"ordering": ordering,
|
|
57
|
+
},
|
|
54
58
|
request_options=request_options,
|
|
55
59
|
)
|
|
56
60
|
try:
|
|
57
61
|
if 200 <= _response.status_code < 300:
|
|
58
62
|
return typing.cast(
|
|
59
63
|
typing.List[ModelProviderConnection],
|
|
60
|
-
|
|
64
|
+
construct_type(
|
|
61
65
|
type_=typing.List[ModelProviderConnection], # type: ignore
|
|
62
66
|
object_=_response.json(),
|
|
63
67
|
),
|
|
@@ -70,20 +74,17 @@ class ModelProvidersClient:
|
|
|
70
74
|
def create(
|
|
71
75
|
self,
|
|
72
76
|
*,
|
|
73
|
-
provider:
|
|
77
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
74
78
|
api_key: typing.Optional[str] = OMIT,
|
|
79
|
+
auth_token: typing.Optional[str] = OMIT,
|
|
75
80
|
deployment_name: typing.Optional[str] = OMIT,
|
|
76
81
|
endpoint: typing.Optional[str] = OMIT,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
83
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
84
|
+
google_location: typing.Optional[str] = OMIT,
|
|
85
|
+
cached_available_models: typing.Optional[str] = OMIT,
|
|
86
|
+
scope: typing.Optional[ScopeEnum] = OMIT,
|
|
82
87
|
is_internal: typing.Optional[bool] = OMIT,
|
|
83
|
-
budget_limit: typing.Optional[float] = OMIT,
|
|
84
|
-
budget_last_reset_date: typing.Optional[dt.datetime] = OMIT,
|
|
85
|
-
budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = OMIT,
|
|
86
|
-
budget_total_spent: typing.Optional[float] = OMIT,
|
|
87
88
|
budget_alert_threshold: typing.Optional[float] = OMIT,
|
|
88
89
|
request_options: typing.Optional[RequestOptions] = None,
|
|
89
90
|
) -> ModelProviderConnection:
|
|
@@ -92,38 +93,36 @@ class ModelProvidersClient:
|
|
|
92
93
|
|
|
93
94
|
Parameters
|
|
94
95
|
----------
|
|
95
|
-
provider :
|
|
96
|
+
provider : typing.Optional[ProviderEnum]
|
|
96
97
|
|
|
97
98
|
api_key : typing.Optional[str]
|
|
99
|
+
Model provider API key
|
|
100
|
+
|
|
101
|
+
auth_token : typing.Optional[str]
|
|
102
|
+
Model provider Auth token
|
|
98
103
|
|
|
99
104
|
deployment_name : typing.Optional[str]
|
|
105
|
+
Azure OpenAI deployment name
|
|
100
106
|
|
|
101
107
|
endpoint : typing.Optional[str]
|
|
108
|
+
Azure OpenAI endpoint
|
|
102
109
|
|
|
103
|
-
|
|
110
|
+
google_application_credentials : typing.Optional[str]
|
|
111
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
google_project_id : typing.Optional[str]
|
|
114
|
+
Google project ID
|
|
106
115
|
|
|
107
|
-
|
|
116
|
+
google_location : typing.Optional[str]
|
|
117
|
+
Google project location
|
|
108
118
|
|
|
109
|
-
|
|
119
|
+
cached_available_models : typing.Optional[str]
|
|
120
|
+
List of available models from the provider
|
|
110
121
|
|
|
111
|
-
|
|
122
|
+
scope : typing.Optional[ScopeEnum]
|
|
112
123
|
|
|
113
124
|
is_internal : typing.Optional[bool]
|
|
114
|
-
Whether the model provider connection is internal, not visible to the user
|
|
115
|
-
|
|
116
|
-
budget_limit : typing.Optional[float]
|
|
117
|
-
Budget limit for the model provider connection (null if unlimited)
|
|
118
|
-
|
|
119
|
-
budget_last_reset_date : typing.Optional[dt.datetime]
|
|
120
|
-
Date and time the budget was last reset
|
|
121
|
-
|
|
122
|
-
budget_reset_period : typing.Optional[ModelProviderConnectionBudgetResetPeriod]
|
|
123
|
-
Budget reset period for the model provider connection (null if not reset)
|
|
124
|
-
|
|
125
|
-
budget_total_spent : typing.Optional[float]
|
|
126
|
-
Tracked total budget spent for the given provider connection within the current budget period
|
|
125
|
+
Whether the model provider connection is internal, not visible to the user
|
|
127
126
|
|
|
128
127
|
budget_alert_threshold : typing.Optional[float]
|
|
129
128
|
Budget alert threshold for the given provider connection
|
|
@@ -143,9 +142,7 @@ class ModelProvidersClient:
|
|
|
143
142
|
client = LabelStudio(
|
|
144
143
|
api_key="YOUR_API_KEY",
|
|
145
144
|
)
|
|
146
|
-
client.model_providers.create(
|
|
147
|
-
provider="OpenAI",
|
|
148
|
-
)
|
|
145
|
+
client.model_providers.create()
|
|
149
146
|
"""
|
|
150
147
|
_response = self._client_wrapper.httpx_client.request(
|
|
151
148
|
"api/model-provider-connections/",
|
|
@@ -153,22 +150,15 @@ class ModelProvidersClient:
|
|
|
153
150
|
json={
|
|
154
151
|
"provider": provider,
|
|
155
152
|
"api_key": api_key,
|
|
153
|
+
"auth_token": auth_token,
|
|
156
154
|
"deployment_name": deployment_name,
|
|
157
155
|
"endpoint": endpoint,
|
|
156
|
+
"google_application_credentials": google_application_credentials,
|
|
157
|
+
"google_project_id": google_project_id,
|
|
158
|
+
"google_location": google_location,
|
|
159
|
+
"cached_available_models": cached_available_models,
|
|
158
160
|
"scope": scope,
|
|
159
|
-
"organization": convert_and_respect_annotation_metadata(
|
|
160
|
-
object_=organization, annotation=ModelProviderConnectionOrganization, direction="write"
|
|
161
|
-
),
|
|
162
|
-
"created_by": convert_and_respect_annotation_metadata(
|
|
163
|
-
object_=created_by, annotation=ModelProviderConnectionCreatedBy, direction="write"
|
|
164
|
-
),
|
|
165
|
-
"created_at": created_at,
|
|
166
|
-
"updated_at": updated_at,
|
|
167
161
|
"is_internal": is_internal,
|
|
168
|
-
"budget_limit": budget_limit,
|
|
169
|
-
"budget_last_reset_date": budget_last_reset_date,
|
|
170
|
-
"budget_reset_period": budget_reset_period,
|
|
171
|
-
"budget_total_spent": budget_total_spent,
|
|
172
162
|
"budget_alert_threshold": budget_alert_threshold,
|
|
173
163
|
},
|
|
174
164
|
request_options=request_options,
|
|
@@ -178,7 +168,7 @@ class ModelProvidersClient:
|
|
|
178
168
|
if 200 <= _response.status_code < 300:
|
|
179
169
|
return typing.cast(
|
|
180
170
|
ModelProviderConnection,
|
|
181
|
-
|
|
171
|
+
construct_type(
|
|
182
172
|
type_=ModelProviderConnection, # type: ignore
|
|
183
173
|
object_=_response.json(),
|
|
184
174
|
),
|
|
@@ -188,14 +178,13 @@ class ModelProvidersClient:
|
|
|
188
178
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
189
179
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
190
180
|
|
|
191
|
-
def get(self,
|
|
181
|
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ModelProviderConnection:
|
|
192
182
|
"""
|
|
193
|
-
|
|
183
|
+
Retrieve a specific model provider connection.
|
|
194
184
|
|
|
195
185
|
Parameters
|
|
196
186
|
----------
|
|
197
|
-
|
|
198
|
-
Model Provider Connection ID
|
|
187
|
+
id : str
|
|
199
188
|
|
|
200
189
|
request_options : typing.Optional[RequestOptions]
|
|
201
190
|
Request-specific configuration.
|
|
@@ -213,11 +202,11 @@ class ModelProvidersClient:
|
|
|
213
202
|
api_key="YOUR_API_KEY",
|
|
214
203
|
)
|
|
215
204
|
client.model_providers.get(
|
|
216
|
-
|
|
205
|
+
id="id",
|
|
217
206
|
)
|
|
218
207
|
"""
|
|
219
208
|
_response = self._client_wrapper.httpx_client.request(
|
|
220
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
209
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
221
210
|
method="GET",
|
|
222
211
|
request_options=request_options,
|
|
223
212
|
)
|
|
@@ -225,7 +214,7 @@ class ModelProvidersClient:
|
|
|
225
214
|
if 200 <= _response.status_code < 300:
|
|
226
215
|
return typing.cast(
|
|
227
216
|
ModelProviderConnection,
|
|
228
|
-
|
|
217
|
+
construct_type(
|
|
229
218
|
type_=ModelProviderConnection, # type: ignore
|
|
230
219
|
object_=_response.json(),
|
|
231
220
|
),
|
|
@@ -235,14 +224,13 @@ class ModelProvidersClient:
|
|
|
235
224
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
236
225
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
237
226
|
|
|
238
|
-
def delete(self,
|
|
227
|
+
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
239
228
|
"""
|
|
240
|
-
Delete a model provider connection by ID
|
|
229
|
+
Delete a model provider connection by ID
|
|
241
230
|
|
|
242
231
|
Parameters
|
|
243
232
|
----------
|
|
244
|
-
|
|
245
|
-
Model Provider Connection ID
|
|
233
|
+
id : str
|
|
246
234
|
|
|
247
235
|
request_options : typing.Optional[RequestOptions]
|
|
248
236
|
Request-specific configuration.
|
|
@@ -259,11 +247,11 @@ class ModelProvidersClient:
|
|
|
259
247
|
api_key="YOUR_API_KEY",
|
|
260
248
|
)
|
|
261
249
|
client.model_providers.delete(
|
|
262
|
-
|
|
250
|
+
id="id",
|
|
263
251
|
)
|
|
264
252
|
"""
|
|
265
253
|
_response = self._client_wrapper.httpx_client.request(
|
|
266
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
254
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
267
255
|
method="DELETE",
|
|
268
256
|
request_options=request_options,
|
|
269
257
|
)
|
|
@@ -277,65 +265,59 @@ class ModelProvidersClient:
|
|
|
277
265
|
|
|
278
266
|
def update(
|
|
279
267
|
self,
|
|
280
|
-
|
|
268
|
+
id: str,
|
|
281
269
|
*,
|
|
282
|
-
provider:
|
|
270
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
283
271
|
api_key: typing.Optional[str] = OMIT,
|
|
272
|
+
auth_token: typing.Optional[str] = OMIT,
|
|
284
273
|
deployment_name: typing.Optional[str] = OMIT,
|
|
285
274
|
endpoint: typing.Optional[str] = OMIT,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
275
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
276
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
277
|
+
google_location: typing.Optional[str] = OMIT,
|
|
278
|
+
cached_available_models: typing.Optional[str] = OMIT,
|
|
279
|
+
scope: typing.Optional[ScopeEnum] = OMIT,
|
|
291
280
|
is_internal: typing.Optional[bool] = OMIT,
|
|
292
|
-
budget_limit: typing.Optional[float] = OMIT,
|
|
293
|
-
budget_last_reset_date: typing.Optional[dt.datetime] = OMIT,
|
|
294
|
-
budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = OMIT,
|
|
295
|
-
budget_total_spent: typing.Optional[float] = OMIT,
|
|
296
281
|
budget_alert_threshold: typing.Optional[float] = OMIT,
|
|
297
282
|
request_options: typing.Optional[RequestOptions] = None,
|
|
298
283
|
) -> ModelProviderConnection:
|
|
299
284
|
"""
|
|
300
|
-
Update a model provider connection by ID.
|
|
285
|
+
Update a specific model provider connection by ID.
|
|
301
286
|
|
|
302
287
|
Parameters
|
|
303
288
|
----------
|
|
304
|
-
|
|
305
|
-
Model Provider Connection ID
|
|
289
|
+
id : str
|
|
306
290
|
|
|
307
|
-
provider :
|
|
291
|
+
provider : typing.Optional[ProviderEnum]
|
|
308
292
|
|
|
309
293
|
api_key : typing.Optional[str]
|
|
294
|
+
Model provider API key
|
|
295
|
+
|
|
296
|
+
auth_token : typing.Optional[str]
|
|
297
|
+
Model provider Auth token
|
|
310
298
|
|
|
311
299
|
deployment_name : typing.Optional[str]
|
|
300
|
+
Azure OpenAI deployment name
|
|
312
301
|
|
|
313
302
|
endpoint : typing.Optional[str]
|
|
303
|
+
Azure OpenAI endpoint
|
|
314
304
|
|
|
315
|
-
|
|
305
|
+
google_application_credentials : typing.Optional[str]
|
|
306
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
316
307
|
|
|
317
|
-
|
|
308
|
+
google_project_id : typing.Optional[str]
|
|
309
|
+
Google project ID
|
|
318
310
|
|
|
319
|
-
|
|
311
|
+
google_location : typing.Optional[str]
|
|
312
|
+
Google project location
|
|
320
313
|
|
|
321
|
-
|
|
314
|
+
cached_available_models : typing.Optional[str]
|
|
315
|
+
List of available models from the provider
|
|
322
316
|
|
|
323
|
-
|
|
317
|
+
scope : typing.Optional[ScopeEnum]
|
|
324
318
|
|
|
325
319
|
is_internal : typing.Optional[bool]
|
|
326
|
-
Whether the model provider connection is internal, not visible to the user
|
|
327
|
-
|
|
328
|
-
budget_limit : typing.Optional[float]
|
|
329
|
-
Budget limit for the model provider connection (null if unlimited)
|
|
330
|
-
|
|
331
|
-
budget_last_reset_date : typing.Optional[dt.datetime]
|
|
332
|
-
Date and time the budget was last reset
|
|
333
|
-
|
|
334
|
-
budget_reset_period : typing.Optional[ModelProviderConnectionBudgetResetPeriod]
|
|
335
|
-
Budget reset period for the model provider connection (null if not reset)
|
|
336
|
-
|
|
337
|
-
budget_total_spent : typing.Optional[float]
|
|
338
|
-
Tracked total budget spent for the given provider connection within the current budget period
|
|
320
|
+
Whether the model provider connection is internal, not visible to the user
|
|
339
321
|
|
|
340
322
|
budget_alert_threshold : typing.Optional[float]
|
|
341
323
|
Budget alert threshold for the given provider connection
|
|
@@ -356,34 +338,29 @@ class ModelProvidersClient:
|
|
|
356
338
|
api_key="YOUR_API_KEY",
|
|
357
339
|
)
|
|
358
340
|
client.model_providers.update(
|
|
359
|
-
|
|
360
|
-
provider="OpenAI",
|
|
341
|
+
id="id",
|
|
361
342
|
)
|
|
362
343
|
"""
|
|
363
344
|
_response = self._client_wrapper.httpx_client.request(
|
|
364
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
345
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
365
346
|
method="PATCH",
|
|
366
347
|
json={
|
|
367
348
|
"provider": provider,
|
|
368
349
|
"api_key": api_key,
|
|
350
|
+
"auth_token": auth_token,
|
|
369
351
|
"deployment_name": deployment_name,
|
|
370
352
|
"endpoint": endpoint,
|
|
353
|
+
"google_application_credentials": google_application_credentials,
|
|
354
|
+
"google_project_id": google_project_id,
|
|
355
|
+
"google_location": google_location,
|
|
356
|
+
"cached_available_models": cached_available_models,
|
|
371
357
|
"scope": scope,
|
|
372
|
-
"organization": convert_and_respect_annotation_metadata(
|
|
373
|
-
object_=organization, annotation=ModelProviderConnectionOrganization, direction="write"
|
|
374
|
-
),
|
|
375
|
-
"created_by": convert_and_respect_annotation_metadata(
|
|
376
|
-
object_=created_by, annotation=ModelProviderConnectionCreatedBy, direction="write"
|
|
377
|
-
),
|
|
378
|
-
"created_at": created_at,
|
|
379
|
-
"updated_at": updated_at,
|
|
380
358
|
"is_internal": is_internal,
|
|
381
|
-
"budget_limit": budget_limit,
|
|
382
|
-
"budget_last_reset_date": budget_last_reset_date,
|
|
383
|
-
"budget_reset_period": budget_reset_period,
|
|
384
|
-
"budget_total_spent": budget_total_spent,
|
|
385
359
|
"budget_alert_threshold": budget_alert_threshold,
|
|
386
360
|
},
|
|
361
|
+
headers={
|
|
362
|
+
"content-type": "application/json",
|
|
363
|
+
},
|
|
387
364
|
request_options=request_options,
|
|
388
365
|
omit=OMIT,
|
|
389
366
|
)
|
|
@@ -391,7 +368,7 @@ class ModelProvidersClient:
|
|
|
391
368
|
if 200 <= _response.status_code < 300:
|
|
392
369
|
return typing.cast(
|
|
393
370
|
ModelProviderConnection,
|
|
394
|
-
|
|
371
|
+
construct_type(
|
|
395
372
|
type_=ModelProviderConnection, # type: ignore
|
|
396
373
|
object_=_response.json(),
|
|
397
374
|
),
|
|
@@ -401,19 +378,66 @@ class ModelProvidersClient:
|
|
|
401
378
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
402
379
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
403
380
|
|
|
381
|
+
def list_model_provider_choices(
|
|
382
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
383
|
+
) -> ModelProvidersListModelProviderChoicesResponse:
|
|
384
|
+
"""
|
|
385
|
+
List all possible model provider choices
|
|
386
|
+
|
|
387
|
+
Parameters
|
|
388
|
+
----------
|
|
389
|
+
request_options : typing.Optional[RequestOptions]
|
|
390
|
+
Request-specific configuration.
|
|
391
|
+
|
|
392
|
+
Returns
|
|
393
|
+
-------
|
|
394
|
+
ModelProvidersListModelProviderChoicesResponse
|
|
395
|
+
List of model provider choices
|
|
396
|
+
|
|
397
|
+
Examples
|
|
398
|
+
--------
|
|
399
|
+
from label_studio_sdk import LabelStudio
|
|
400
|
+
|
|
401
|
+
client = LabelStudio(
|
|
402
|
+
api_key="YOUR_API_KEY",
|
|
403
|
+
)
|
|
404
|
+
client.model_providers.list_model_provider_choices()
|
|
405
|
+
"""
|
|
406
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
407
|
+
"api/model-provider-connections/provider-choices",
|
|
408
|
+
method="GET",
|
|
409
|
+
request_options=request_options,
|
|
410
|
+
)
|
|
411
|
+
try:
|
|
412
|
+
if 200 <= _response.status_code < 300:
|
|
413
|
+
return typing.cast(
|
|
414
|
+
ModelProvidersListModelProviderChoicesResponse,
|
|
415
|
+
construct_type(
|
|
416
|
+
type_=ModelProvidersListModelProviderChoicesResponse, # type: ignore
|
|
417
|
+
object_=_response.json(),
|
|
418
|
+
),
|
|
419
|
+
)
|
|
420
|
+
_response_json = _response.json()
|
|
421
|
+
except JSONDecodeError:
|
|
422
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
423
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
424
|
+
|
|
404
425
|
|
|
405
426
|
class AsyncModelProvidersClient:
|
|
406
427
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
407
428
|
self._client_wrapper = client_wrapper
|
|
408
429
|
|
|
409
430
|
async def list(
|
|
410
|
-
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
431
|
+
self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
411
432
|
) -> typing.List[ModelProviderConnection]:
|
|
412
433
|
"""
|
|
413
|
-
|
|
434
|
+
List all model provider connections.
|
|
414
435
|
|
|
415
436
|
Parameters
|
|
416
437
|
----------
|
|
438
|
+
ordering : typing.Optional[str]
|
|
439
|
+
Which field to use when ordering the results.
|
|
440
|
+
|
|
417
441
|
request_options : typing.Optional[RequestOptions]
|
|
418
442
|
Request-specific configuration.
|
|
419
443
|
|
|
@@ -442,13 +466,16 @@ class AsyncModelProvidersClient:
|
|
|
442
466
|
_response = await self._client_wrapper.httpx_client.request(
|
|
443
467
|
"api/model-provider-connections/",
|
|
444
468
|
method="GET",
|
|
469
|
+
params={
|
|
470
|
+
"ordering": ordering,
|
|
471
|
+
},
|
|
445
472
|
request_options=request_options,
|
|
446
473
|
)
|
|
447
474
|
try:
|
|
448
475
|
if 200 <= _response.status_code < 300:
|
|
449
476
|
return typing.cast(
|
|
450
477
|
typing.List[ModelProviderConnection],
|
|
451
|
-
|
|
478
|
+
construct_type(
|
|
452
479
|
type_=typing.List[ModelProviderConnection], # type: ignore
|
|
453
480
|
object_=_response.json(),
|
|
454
481
|
),
|
|
@@ -461,20 +488,17 @@ class AsyncModelProvidersClient:
|
|
|
461
488
|
async def create(
|
|
462
489
|
self,
|
|
463
490
|
*,
|
|
464
|
-
provider:
|
|
491
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
465
492
|
api_key: typing.Optional[str] = OMIT,
|
|
493
|
+
auth_token: typing.Optional[str] = OMIT,
|
|
466
494
|
deployment_name: typing.Optional[str] = OMIT,
|
|
467
495
|
endpoint: typing.Optional[str] = OMIT,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
496
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
497
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
498
|
+
google_location: typing.Optional[str] = OMIT,
|
|
499
|
+
cached_available_models: typing.Optional[str] = OMIT,
|
|
500
|
+
scope: typing.Optional[ScopeEnum] = OMIT,
|
|
473
501
|
is_internal: typing.Optional[bool] = OMIT,
|
|
474
|
-
budget_limit: typing.Optional[float] = OMIT,
|
|
475
|
-
budget_last_reset_date: typing.Optional[dt.datetime] = OMIT,
|
|
476
|
-
budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = OMIT,
|
|
477
|
-
budget_total_spent: typing.Optional[float] = OMIT,
|
|
478
502
|
budget_alert_threshold: typing.Optional[float] = OMIT,
|
|
479
503
|
request_options: typing.Optional[RequestOptions] = None,
|
|
480
504
|
) -> ModelProviderConnection:
|
|
@@ -483,38 +507,36 @@ class AsyncModelProvidersClient:
|
|
|
483
507
|
|
|
484
508
|
Parameters
|
|
485
509
|
----------
|
|
486
|
-
provider :
|
|
510
|
+
provider : typing.Optional[ProviderEnum]
|
|
487
511
|
|
|
488
512
|
api_key : typing.Optional[str]
|
|
513
|
+
Model provider API key
|
|
514
|
+
|
|
515
|
+
auth_token : typing.Optional[str]
|
|
516
|
+
Model provider Auth token
|
|
489
517
|
|
|
490
518
|
deployment_name : typing.Optional[str]
|
|
519
|
+
Azure OpenAI deployment name
|
|
491
520
|
|
|
492
521
|
endpoint : typing.Optional[str]
|
|
522
|
+
Azure OpenAI endpoint
|
|
493
523
|
|
|
494
|
-
|
|
524
|
+
google_application_credentials : typing.Optional[str]
|
|
525
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
495
526
|
|
|
496
|
-
|
|
527
|
+
google_project_id : typing.Optional[str]
|
|
528
|
+
Google project ID
|
|
497
529
|
|
|
498
|
-
|
|
530
|
+
google_location : typing.Optional[str]
|
|
531
|
+
Google project location
|
|
499
532
|
|
|
500
|
-
|
|
533
|
+
cached_available_models : typing.Optional[str]
|
|
534
|
+
List of available models from the provider
|
|
501
535
|
|
|
502
|
-
|
|
536
|
+
scope : typing.Optional[ScopeEnum]
|
|
503
537
|
|
|
504
538
|
is_internal : typing.Optional[bool]
|
|
505
|
-
Whether the model provider connection is internal, not visible to the user
|
|
506
|
-
|
|
507
|
-
budget_limit : typing.Optional[float]
|
|
508
|
-
Budget limit for the model provider connection (null if unlimited)
|
|
509
|
-
|
|
510
|
-
budget_last_reset_date : typing.Optional[dt.datetime]
|
|
511
|
-
Date and time the budget was last reset
|
|
512
|
-
|
|
513
|
-
budget_reset_period : typing.Optional[ModelProviderConnectionBudgetResetPeriod]
|
|
514
|
-
Budget reset period for the model provider connection (null if not reset)
|
|
515
|
-
|
|
516
|
-
budget_total_spent : typing.Optional[float]
|
|
517
|
-
Tracked total budget spent for the given provider connection within the current budget period
|
|
539
|
+
Whether the model provider connection is internal, not visible to the user
|
|
518
540
|
|
|
519
541
|
budget_alert_threshold : typing.Optional[float]
|
|
520
542
|
Budget alert threshold for the given provider connection
|
|
@@ -539,9 +561,7 @@ class AsyncModelProvidersClient:
|
|
|
539
561
|
|
|
540
562
|
|
|
541
563
|
async def main() -> None:
|
|
542
|
-
await client.model_providers.create(
|
|
543
|
-
provider="OpenAI",
|
|
544
|
-
)
|
|
564
|
+
await client.model_providers.create()
|
|
545
565
|
|
|
546
566
|
|
|
547
567
|
asyncio.run(main())
|
|
@@ -552,22 +572,15 @@ class AsyncModelProvidersClient:
|
|
|
552
572
|
json={
|
|
553
573
|
"provider": provider,
|
|
554
574
|
"api_key": api_key,
|
|
575
|
+
"auth_token": auth_token,
|
|
555
576
|
"deployment_name": deployment_name,
|
|
556
577
|
"endpoint": endpoint,
|
|
578
|
+
"google_application_credentials": google_application_credentials,
|
|
579
|
+
"google_project_id": google_project_id,
|
|
580
|
+
"google_location": google_location,
|
|
581
|
+
"cached_available_models": cached_available_models,
|
|
557
582
|
"scope": scope,
|
|
558
|
-
"organization": convert_and_respect_annotation_metadata(
|
|
559
|
-
object_=organization, annotation=ModelProviderConnectionOrganization, direction="write"
|
|
560
|
-
),
|
|
561
|
-
"created_by": convert_and_respect_annotation_metadata(
|
|
562
|
-
object_=created_by, annotation=ModelProviderConnectionCreatedBy, direction="write"
|
|
563
|
-
),
|
|
564
|
-
"created_at": created_at,
|
|
565
|
-
"updated_at": updated_at,
|
|
566
583
|
"is_internal": is_internal,
|
|
567
|
-
"budget_limit": budget_limit,
|
|
568
|
-
"budget_last_reset_date": budget_last_reset_date,
|
|
569
|
-
"budget_reset_period": budget_reset_period,
|
|
570
|
-
"budget_total_spent": budget_total_spent,
|
|
571
584
|
"budget_alert_threshold": budget_alert_threshold,
|
|
572
585
|
},
|
|
573
586
|
request_options=request_options,
|
|
@@ -577,7 +590,7 @@ class AsyncModelProvidersClient:
|
|
|
577
590
|
if 200 <= _response.status_code < 300:
|
|
578
591
|
return typing.cast(
|
|
579
592
|
ModelProviderConnection,
|
|
580
|
-
|
|
593
|
+
construct_type(
|
|
581
594
|
type_=ModelProviderConnection, # type: ignore
|
|
582
595
|
object_=_response.json(),
|
|
583
596
|
),
|
|
@@ -587,14 +600,13 @@ class AsyncModelProvidersClient:
|
|
|
587
600
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
588
601
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
589
602
|
|
|
590
|
-
async def get(self,
|
|
603
|
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ModelProviderConnection:
|
|
591
604
|
"""
|
|
592
|
-
|
|
605
|
+
Retrieve a specific model provider connection.
|
|
593
606
|
|
|
594
607
|
Parameters
|
|
595
608
|
----------
|
|
596
|
-
|
|
597
|
-
Model Provider Connection ID
|
|
609
|
+
id : str
|
|
598
610
|
|
|
599
611
|
request_options : typing.Optional[RequestOptions]
|
|
600
612
|
Request-specific configuration.
|
|
@@ -617,14 +629,14 @@ class AsyncModelProvidersClient:
|
|
|
617
629
|
|
|
618
630
|
async def main() -> None:
|
|
619
631
|
await client.model_providers.get(
|
|
620
|
-
|
|
632
|
+
id="id",
|
|
621
633
|
)
|
|
622
634
|
|
|
623
635
|
|
|
624
636
|
asyncio.run(main())
|
|
625
637
|
"""
|
|
626
638
|
_response = await self._client_wrapper.httpx_client.request(
|
|
627
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
639
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
628
640
|
method="GET",
|
|
629
641
|
request_options=request_options,
|
|
630
642
|
)
|
|
@@ -632,7 +644,7 @@ class AsyncModelProvidersClient:
|
|
|
632
644
|
if 200 <= _response.status_code < 300:
|
|
633
645
|
return typing.cast(
|
|
634
646
|
ModelProviderConnection,
|
|
635
|
-
|
|
647
|
+
construct_type(
|
|
636
648
|
type_=ModelProviderConnection, # type: ignore
|
|
637
649
|
object_=_response.json(),
|
|
638
650
|
),
|
|
@@ -642,14 +654,13 @@ class AsyncModelProvidersClient:
|
|
|
642
654
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
643
655
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
644
656
|
|
|
645
|
-
async def delete(self,
|
|
657
|
+
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
646
658
|
"""
|
|
647
|
-
Delete a model provider connection by ID
|
|
659
|
+
Delete a model provider connection by ID
|
|
648
660
|
|
|
649
661
|
Parameters
|
|
650
662
|
----------
|
|
651
|
-
|
|
652
|
-
Model Provider Connection ID
|
|
663
|
+
id : str
|
|
653
664
|
|
|
654
665
|
request_options : typing.Optional[RequestOptions]
|
|
655
666
|
Request-specific configuration.
|
|
@@ -671,14 +682,14 @@ class AsyncModelProvidersClient:
|
|
|
671
682
|
|
|
672
683
|
async def main() -> None:
|
|
673
684
|
await client.model_providers.delete(
|
|
674
|
-
|
|
685
|
+
id="id",
|
|
675
686
|
)
|
|
676
687
|
|
|
677
688
|
|
|
678
689
|
asyncio.run(main())
|
|
679
690
|
"""
|
|
680
691
|
_response = await self._client_wrapper.httpx_client.request(
|
|
681
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
692
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
682
693
|
method="DELETE",
|
|
683
694
|
request_options=request_options,
|
|
684
695
|
)
|
|
@@ -692,65 +703,59 @@ class AsyncModelProvidersClient:
|
|
|
692
703
|
|
|
693
704
|
async def update(
|
|
694
705
|
self,
|
|
695
|
-
|
|
706
|
+
id: str,
|
|
696
707
|
*,
|
|
697
|
-
provider:
|
|
708
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
698
709
|
api_key: typing.Optional[str] = OMIT,
|
|
710
|
+
auth_token: typing.Optional[str] = OMIT,
|
|
699
711
|
deployment_name: typing.Optional[str] = OMIT,
|
|
700
712
|
endpoint: typing.Optional[str] = OMIT,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
713
|
+
google_application_credentials: typing.Optional[str] = OMIT,
|
|
714
|
+
google_project_id: typing.Optional[str] = OMIT,
|
|
715
|
+
google_location: typing.Optional[str] = OMIT,
|
|
716
|
+
cached_available_models: typing.Optional[str] = OMIT,
|
|
717
|
+
scope: typing.Optional[ScopeEnum] = OMIT,
|
|
706
718
|
is_internal: typing.Optional[bool] = OMIT,
|
|
707
|
-
budget_limit: typing.Optional[float] = OMIT,
|
|
708
|
-
budget_last_reset_date: typing.Optional[dt.datetime] = OMIT,
|
|
709
|
-
budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = OMIT,
|
|
710
|
-
budget_total_spent: typing.Optional[float] = OMIT,
|
|
711
719
|
budget_alert_threshold: typing.Optional[float] = OMIT,
|
|
712
720
|
request_options: typing.Optional[RequestOptions] = None,
|
|
713
721
|
) -> ModelProviderConnection:
|
|
714
722
|
"""
|
|
715
|
-
Update a model provider connection by ID.
|
|
723
|
+
Update a specific model provider connection by ID.
|
|
716
724
|
|
|
717
725
|
Parameters
|
|
718
726
|
----------
|
|
719
|
-
|
|
720
|
-
Model Provider Connection ID
|
|
727
|
+
id : str
|
|
721
728
|
|
|
722
|
-
provider :
|
|
729
|
+
provider : typing.Optional[ProviderEnum]
|
|
723
730
|
|
|
724
731
|
api_key : typing.Optional[str]
|
|
732
|
+
Model provider API key
|
|
733
|
+
|
|
734
|
+
auth_token : typing.Optional[str]
|
|
735
|
+
Model provider Auth token
|
|
725
736
|
|
|
726
737
|
deployment_name : typing.Optional[str]
|
|
738
|
+
Azure OpenAI deployment name
|
|
727
739
|
|
|
728
740
|
endpoint : typing.Optional[str]
|
|
741
|
+
Azure OpenAI endpoint
|
|
729
742
|
|
|
730
|
-
|
|
743
|
+
google_application_credentials : typing.Optional[str]
|
|
744
|
+
The content of GOOGLE_APPLICATION_CREDENTIALS json file
|
|
731
745
|
|
|
732
|
-
|
|
746
|
+
google_project_id : typing.Optional[str]
|
|
747
|
+
Google project ID
|
|
733
748
|
|
|
734
|
-
|
|
749
|
+
google_location : typing.Optional[str]
|
|
750
|
+
Google project location
|
|
735
751
|
|
|
736
|
-
|
|
752
|
+
cached_available_models : typing.Optional[str]
|
|
753
|
+
List of available models from the provider
|
|
737
754
|
|
|
738
|
-
|
|
755
|
+
scope : typing.Optional[ScopeEnum]
|
|
739
756
|
|
|
740
757
|
is_internal : typing.Optional[bool]
|
|
741
|
-
Whether the model provider connection is internal, not visible to the user
|
|
742
|
-
|
|
743
|
-
budget_limit : typing.Optional[float]
|
|
744
|
-
Budget limit for the model provider connection (null if unlimited)
|
|
745
|
-
|
|
746
|
-
budget_last_reset_date : typing.Optional[dt.datetime]
|
|
747
|
-
Date and time the budget was last reset
|
|
748
|
-
|
|
749
|
-
budget_reset_period : typing.Optional[ModelProviderConnectionBudgetResetPeriod]
|
|
750
|
-
Budget reset period for the model provider connection (null if not reset)
|
|
751
|
-
|
|
752
|
-
budget_total_spent : typing.Optional[float]
|
|
753
|
-
Tracked total budget spent for the given provider connection within the current budget period
|
|
758
|
+
Whether the model provider connection is internal, not visible to the user
|
|
754
759
|
|
|
755
760
|
budget_alert_threshold : typing.Optional[float]
|
|
756
761
|
Budget alert threshold for the given provider connection
|
|
@@ -776,37 +781,32 @@ class AsyncModelProvidersClient:
|
|
|
776
781
|
|
|
777
782
|
async def main() -> None:
|
|
778
783
|
await client.model_providers.update(
|
|
779
|
-
|
|
780
|
-
provider="OpenAI",
|
|
784
|
+
id="id",
|
|
781
785
|
)
|
|
782
786
|
|
|
783
787
|
|
|
784
788
|
asyncio.run(main())
|
|
785
789
|
"""
|
|
786
790
|
_response = await self._client_wrapper.httpx_client.request(
|
|
787
|
-
f"api/model-provider-connections/{jsonable_encoder(
|
|
791
|
+
f"api/model-provider-connections/{jsonable_encoder(id)}/",
|
|
788
792
|
method="PATCH",
|
|
789
793
|
json={
|
|
790
794
|
"provider": provider,
|
|
791
795
|
"api_key": api_key,
|
|
796
|
+
"auth_token": auth_token,
|
|
792
797
|
"deployment_name": deployment_name,
|
|
793
798
|
"endpoint": endpoint,
|
|
799
|
+
"google_application_credentials": google_application_credentials,
|
|
800
|
+
"google_project_id": google_project_id,
|
|
801
|
+
"google_location": google_location,
|
|
802
|
+
"cached_available_models": cached_available_models,
|
|
794
803
|
"scope": scope,
|
|
795
|
-
"organization": convert_and_respect_annotation_metadata(
|
|
796
|
-
object_=organization, annotation=ModelProviderConnectionOrganization, direction="write"
|
|
797
|
-
),
|
|
798
|
-
"created_by": convert_and_respect_annotation_metadata(
|
|
799
|
-
object_=created_by, annotation=ModelProviderConnectionCreatedBy, direction="write"
|
|
800
|
-
),
|
|
801
|
-
"created_at": created_at,
|
|
802
|
-
"updated_at": updated_at,
|
|
803
804
|
"is_internal": is_internal,
|
|
804
|
-
"budget_limit": budget_limit,
|
|
805
|
-
"budget_last_reset_date": budget_last_reset_date,
|
|
806
|
-
"budget_reset_period": budget_reset_period,
|
|
807
|
-
"budget_total_spent": budget_total_spent,
|
|
808
805
|
"budget_alert_threshold": budget_alert_threshold,
|
|
809
806
|
},
|
|
807
|
+
headers={
|
|
808
|
+
"content-type": "application/json",
|
|
809
|
+
},
|
|
810
810
|
request_options=request_options,
|
|
811
811
|
omit=OMIT,
|
|
812
812
|
)
|
|
@@ -814,7 +814,7 @@ class AsyncModelProvidersClient:
|
|
|
814
814
|
if 200 <= _response.status_code < 300:
|
|
815
815
|
return typing.cast(
|
|
816
816
|
ModelProviderConnection,
|
|
817
|
-
|
|
817
|
+
construct_type(
|
|
818
818
|
type_=ModelProviderConnection, # type: ignore
|
|
819
819
|
object_=_response.json(),
|
|
820
820
|
),
|
|
@@ -823,3 +823,55 @@ class AsyncModelProvidersClient:
|
|
|
823
823
|
except JSONDecodeError:
|
|
824
824
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
825
825
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
826
|
+
|
|
827
|
+
async def list_model_provider_choices(
|
|
828
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
829
|
+
) -> ModelProvidersListModelProviderChoicesResponse:
|
|
830
|
+
"""
|
|
831
|
+
List all possible model provider choices
|
|
832
|
+
|
|
833
|
+
Parameters
|
|
834
|
+
----------
|
|
835
|
+
request_options : typing.Optional[RequestOptions]
|
|
836
|
+
Request-specific configuration.
|
|
837
|
+
|
|
838
|
+
Returns
|
|
839
|
+
-------
|
|
840
|
+
ModelProvidersListModelProviderChoicesResponse
|
|
841
|
+
List of model provider choices
|
|
842
|
+
|
|
843
|
+
Examples
|
|
844
|
+
--------
|
|
845
|
+
import asyncio
|
|
846
|
+
|
|
847
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
848
|
+
|
|
849
|
+
client = AsyncLabelStudio(
|
|
850
|
+
api_key="YOUR_API_KEY",
|
|
851
|
+
)
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
async def main() -> None:
|
|
855
|
+
await client.model_providers.list_model_provider_choices()
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
asyncio.run(main())
|
|
859
|
+
"""
|
|
860
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
861
|
+
"api/model-provider-connections/provider-choices",
|
|
862
|
+
method="GET",
|
|
863
|
+
request_options=request_options,
|
|
864
|
+
)
|
|
865
|
+
try:
|
|
866
|
+
if 200 <= _response.status_code < 300:
|
|
867
|
+
return typing.cast(
|
|
868
|
+
ModelProvidersListModelProviderChoicesResponse,
|
|
869
|
+
construct_type(
|
|
870
|
+
type_=ModelProvidersListModelProviderChoicesResponse, # type: ignore
|
|
871
|
+
object_=_response.json(),
|
|
872
|
+
),
|
|
873
|
+
)
|
|
874
|
+
_response_json = _response.json()
|
|
875
|
+
except JSONDecodeError:
|
|
876
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
877
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|