label-studio-sdk 1.0.7__py3-none-any.whl → 1.0.10__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 +26 -7
- label_studio_sdk/_extensions/label_studio_tools/core/label_config.py +13 -4
- label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +16 -4
- label_studio_sdk/_extensions/label_studio_tools/core/utils/json_schema.py +86 -0
- label_studio_sdk/_extensions/pager_ext.py +8 -0
- label_studio_sdk/_legacy/schema/label_config_schema.json +42 -11
- label_studio_sdk/actions/client.py +91 -40
- label_studio_sdk/actions/types/actions_create_request_filters.py +14 -24
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +16 -26
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +3 -1
- label_studio_sdk/actions/types/actions_create_request_selected_items.py +1 -2
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +15 -25
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +15 -25
- label_studio_sdk/annotations/__init__.py +2 -2
- label_studio_sdk/annotations/client.py +278 -104
- label_studio_sdk/annotations/types/__init__.py +2 -1
- label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +34 -0
- label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +11 -21
- label_studio_sdk/base_client.py +46 -27
- label_studio_sdk/client.py +1 -0
- label_studio_sdk/comments/client.py +190 -44
- label_studio_sdk/converter/converter.py +66 -18
- label_studio_sdk/converter/imports/yolo.py +1 -1
- label_studio_sdk/converter/utils.py +3 -2
- label_studio_sdk/core/__init__.py +21 -4
- label_studio_sdk/core/client_wrapper.py +9 -10
- label_studio_sdk/core/file.py +37 -8
- label_studio_sdk/core/http_client.py +52 -28
- label_studio_sdk/core/jsonable_encoder.py +33 -31
- label_studio_sdk/core/pagination.py +5 -4
- label_studio_sdk/core/pydantic_utilities.py +272 -4
- label_studio_sdk/core/query_encoder.py +38 -13
- label_studio_sdk/core/request_options.py +3 -0
- label_studio_sdk/core/serialization.py +272 -0
- label_studio_sdk/errors/bad_request_error.py +2 -3
- label_studio_sdk/export_storage/azure/client.py +228 -58
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +19 -29
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +19 -29
- label_studio_sdk/export_storage/client.py +48 -18
- label_studio_sdk/export_storage/gcs/client.py +228 -58
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +19 -29
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +19 -29
- label_studio_sdk/export_storage/local/client.py +222 -56
- label_studio_sdk/export_storage/local/types/local_create_response.py +17 -27
- label_studio_sdk/export_storage/local/types/local_update_response.py +17 -27
- label_studio_sdk/export_storage/redis/client.py +228 -58
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +20 -30
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +20 -30
- label_studio_sdk/export_storage/s3/client.py +228 -58
- label_studio_sdk/export_storage/s3/types/s3create_response.py +27 -35
- label_studio_sdk/export_storage/s3/types/s3update_response.py +27 -35
- label_studio_sdk/export_storage/s3s/client.py +187 -43
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +11 -21
- label_studio_sdk/files/client.py +172 -56
- label_studio_sdk/import_storage/azure/client.py +223 -53
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +22 -32
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +22 -32
- label_studio_sdk/import_storage/client.py +48 -18
- label_studio_sdk/import_storage/gcs/client.py +223 -53
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +22 -32
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +22 -32
- label_studio_sdk/import_storage/local/client.py +223 -53
- label_studio_sdk/import_storage/local/types/local_create_response.py +17 -27
- label_studio_sdk/import_storage/local/types/local_update_response.py +17 -27
- label_studio_sdk/import_storage/redis/client.py +223 -53
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +20 -30
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +20 -30
- label_studio_sdk/import_storage/s3/client.py +223 -53
- label_studio_sdk/import_storage/s3/types/s3create_response.py +31 -39
- label_studio_sdk/import_storage/s3/types/s3update_response.py +31 -39
- label_studio_sdk/import_storage/s3s/client.py +222 -52
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +11 -21
- label_studio_sdk/label_interface/control_tags.py +205 -10
- label_studio_sdk/label_interface/interface.py +80 -6
- label_studio_sdk/label_interface/region.py +1 -10
- label_studio_sdk/ml/client.py +280 -78
- label_studio_sdk/ml/types/ml_create_response.py +21 -31
- label_studio_sdk/ml/types/ml_update_response.py +21 -31
- label_studio_sdk/model_providers/client.py +656 -21
- label_studio_sdk/predictions/client.py +247 -101
- label_studio_sdk/projects/__init__.py +3 -0
- label_studio_sdk/projects/client.py +309 -115
- label_studio_sdk/projects/client_ext.py +16 -0
- label_studio_sdk/projects/exports/__init__.py +3 -0
- label_studio_sdk/projects/exports/client.py +447 -296
- label_studio_sdk/projects/exports/client_ext.py +134 -0
- label_studio_sdk/projects/exports/types/__init__.py +6 -0
- label_studio_sdk/projects/exports/types/exports_convert_response.py +24 -0
- label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +44 -0
- label_studio_sdk/projects/types/projects_create_response.py +29 -34
- label_studio_sdk/projects/types/projects_import_tasks_response.py +19 -29
- label_studio_sdk/projects/types/projects_list_response.py +11 -21
- label_studio_sdk/projects/types/projects_update_response.py +24 -34
- label_studio_sdk/prompts/client.py +309 -92
- label_studio_sdk/prompts/indicators/client.py +67 -23
- label_studio_sdk/prompts/runs/client.py +95 -40
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +14 -24
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_response.py +11 -21
- label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +26 -29
- label_studio_sdk/prompts/types/prompts_batch_predictions_response.py +11 -21
- label_studio_sdk/prompts/versions/client.py +389 -75
- label_studio_sdk/tasks/client.py +263 -90
- label_studio_sdk/tasks/types/tasks_list_response.py +15 -25
- label_studio_sdk/types/__init__.py +16 -6
- label_studio_sdk/types/annotation.py +29 -38
- label_studio_sdk/types/annotation_filter_options.py +14 -24
- label_studio_sdk/types/annotations_dm_field.py +30 -39
- label_studio_sdk/types/azure_blob_export_storage.py +28 -37
- label_studio_sdk/types/azure_blob_import_storage.py +28 -37
- label_studio_sdk/types/base_task.py +30 -39
- label_studio_sdk/types/base_task_updated_by.py +3 -1
- label_studio_sdk/types/base_user.py +14 -21
- label_studio_sdk/types/comment.py +12 -21
- label_studio_sdk/types/comment_created_by.py +1 -1
- label_studio_sdk/types/converted_format.py +12 -22
- label_studio_sdk/types/data_manager_task_serializer.py +31 -40
- label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +1 -1
- label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +13 -22
- label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +15 -24
- label_studio_sdk/types/export.py +17 -26
- label_studio_sdk/types/export_format.py +25 -0
- label_studio_sdk/types/export_snapshot.py +45 -0
- label_studio_sdk/types/export_snapshot_status.py +5 -0
- label_studio_sdk/types/file_upload.py +11 -21
- label_studio_sdk/types/filter.py +16 -26
- label_studio_sdk/types/filter_group.py +12 -22
- label_studio_sdk/types/gcs_export_storage.py +28 -37
- label_studio_sdk/types/gcs_import_storage.py +28 -37
- label_studio_sdk/types/inference_run.py +14 -23
- label_studio_sdk/types/inference_run_cost_estimate.py +47 -0
- label_studio_sdk/types/inference_run_created_by.py +1 -1
- label_studio_sdk/types/inference_run_organization.py +1 -1
- label_studio_sdk/types/key_indicator_value.py +12 -22
- label_studio_sdk/types/key_indicators.py +0 -1
- label_studio_sdk/types/key_indicators_item.py +15 -25
- label_studio_sdk/types/key_indicators_item_additional_kpis_item.py +13 -23
- label_studio_sdk/types/key_indicators_item_extra_kpis_item.py +13 -23
- label_studio_sdk/types/local_files_export_storage.py +25 -34
- label_studio_sdk/types/local_files_import_storage.py +24 -33
- label_studio_sdk/types/ml_backend.py +23 -32
- label_studio_sdk/types/model_provider_connection.py +47 -26
- label_studio_sdk/types/model_provider_connection_budget_reset_period.py +5 -0
- label_studio_sdk/types/model_provider_connection_created_by.py +1 -1
- label_studio_sdk/types/model_provider_connection_organization.py +1 -1
- label_studio_sdk/types/model_provider_connection_provider.py +3 -1
- label_studio_sdk/types/prediction.py +21 -30
- label_studio_sdk/types/project.py +48 -55
- label_studio_sdk/types/project_import.py +21 -30
- label_studio_sdk/types/project_label_config.py +12 -22
- label_studio_sdk/types/prompt.py +24 -32
- label_studio_sdk/types/prompt_associated_projects_item.py +6 -0
- label_studio_sdk/types/prompt_associated_projects_item_id.py +20 -0
- label_studio_sdk/types/prompt_created_by.py +1 -1
- label_studio_sdk/types/prompt_organization.py +1 -1
- label_studio_sdk/types/prompt_version.py +13 -22
- label_studio_sdk/types/prompt_version_created_by.py +1 -1
- label_studio_sdk/types/prompt_version_organization.py +1 -1
- label_studio_sdk/types/prompt_version_provider.py +3 -1
- label_studio_sdk/types/redis_export_storage.py +29 -38
- label_studio_sdk/types/redis_import_storage.py +28 -37
- label_studio_sdk/types/refined_prompt_response.py +19 -29
- label_studio_sdk/types/s3export_storage.py +36 -43
- label_studio_sdk/types/s3import_storage.py +37 -44
- label_studio_sdk/types/s3s_export_storage.py +26 -33
- label_studio_sdk/types/s3s_import_storage.py +35 -42
- label_studio_sdk/types/serialization_option.py +12 -22
- label_studio_sdk/types/serialization_options.py +18 -28
- label_studio_sdk/types/task.py +46 -48
- label_studio_sdk/types/task_annotators_item.py +1 -1
- label_studio_sdk/types/task_comment_authors_item.py +5 -0
- label_studio_sdk/types/task_filter_options.py +15 -25
- label_studio_sdk/types/user_simple.py +11 -21
- label_studio_sdk/types/view.py +16 -26
- label_studio_sdk/types/webhook.py +19 -28
- label_studio_sdk/types/webhook_serializer_for_update.py +19 -28
- label_studio_sdk/types/workspace.py +22 -31
- label_studio_sdk/users/client.py +257 -63
- label_studio_sdk/users/types/users_get_token_response.py +12 -22
- label_studio_sdk/users/types/users_reset_token_response.py +12 -22
- label_studio_sdk/version.py +0 -1
- label_studio_sdk/versions/__init__.py +5 -0
- label_studio_sdk/versions/client.py +112 -0
- label_studio_sdk/versions/types/__init__.py +6 -0
- label_studio_sdk/versions/types/versions_get_response.py +73 -0
- label_studio_sdk/versions/types/versions_get_response_edition.py +5 -0
- label_studio_sdk/views/client.py +219 -52
- label_studio_sdk/views/types/views_create_request_data.py +13 -23
- label_studio_sdk/views/types/views_create_request_data_filters.py +14 -24
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +16 -26
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +3 -1
- label_studio_sdk/views/types/views_update_request_data.py +13 -23
- label_studio_sdk/views/types/views_update_request_data_filters.py +14 -24
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +16 -26
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +3 -1
- label_studio_sdk/webhooks/client.py +191 -61
- label_studio_sdk/workspaces/client.py +164 -41
- label_studio_sdk/workspaces/members/client.py +109 -31
- label_studio_sdk/workspaces/members/types/members_create_response.py +12 -22
- label_studio_sdk/workspaces/members/types/members_list_response_item.py +12 -22
- {label_studio_sdk-1.0.7.dist-info → label_studio_sdk-1.0.10.dist-info}/METADATA +9 -5
- {label_studio_sdk-1.0.7.dist-info → label_studio_sdk-1.0.10.dist-info}/RECORD +203 -186
- {label_studio_sdk-1.0.7.dist-info → label_studio_sdk-1.0.10.dist-info}/WHEEL +1 -1
- label_studio_sdk/types/export_convert.py +0 -32
- label_studio_sdk/types/export_create.py +0 -54
- label_studio_sdk/types/export_create_status.py +0 -5
- {label_studio_sdk-1.0.7.dist-info → label_studio_sdk-1.0.10.dist-info}/LICENSE +0 -0
|
@@ -1,89 +1,80 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
-
from .ml_backend_auth_method import MlBackendAuthMethod
|
|
9
5
|
from .ml_backend_state import MlBackendState
|
|
6
|
+
import pydantic
|
|
7
|
+
from .ml_backend_auth_method import MlBackendAuthMethod
|
|
8
|
+
import datetime as dt
|
|
9
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class MlBackend(
|
|
12
|
+
class MlBackend(UniversalBaseModel):
|
|
13
13
|
id: typing.Optional[int] = None
|
|
14
14
|
state: typing.Optional[MlBackendState] = None
|
|
15
15
|
readable_state: typing.Optional[str] = None
|
|
16
|
-
is_interactive: typing.Optional[bool] =
|
|
16
|
+
is_interactive: typing.Optional[bool] = pydantic.Field(default=None)
|
|
17
17
|
"""
|
|
18
18
|
Used to interactively annotate tasks. If true, model returns one list with results
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
url: str =
|
|
21
|
+
url: str = pydantic.Field()
|
|
22
22
|
"""
|
|
23
23
|
URL for the machine learning model server
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
error_message: typing.Optional[str] =
|
|
26
|
+
error_message: typing.Optional[str] = pydantic.Field(default=None)
|
|
27
27
|
"""
|
|
28
28
|
Error message in error state
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
title: typing.Optional[str] =
|
|
31
|
+
title: typing.Optional[str] = pydantic.Field(default=None)
|
|
32
32
|
"""
|
|
33
33
|
Name of the machine learning backend
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
36
|
auth_method: typing.Optional[MlBackendAuthMethod] = None
|
|
37
|
-
basic_auth_user: typing.Optional[str] =
|
|
37
|
+
basic_auth_user: typing.Optional[str] = pydantic.Field(default=None)
|
|
38
38
|
"""
|
|
39
39
|
HTTP Basic Auth user
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
42
|
basic_auth_pass: typing.Optional[str] = None
|
|
43
43
|
basic_auth_pass_is_set: typing.Optional[str] = None
|
|
44
|
-
description: typing.Optional[str] =
|
|
44
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
45
45
|
"""
|
|
46
46
|
Description for the machine learning backend
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
|
-
extra_params: typing.Optional[typing.Dict[str, typing.Any]] =
|
|
49
|
+
extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
50
50
|
"""
|
|
51
51
|
Any extra parameters passed to the ML Backend during the setup
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
model_version: typing.Optional[str] =
|
|
54
|
+
model_version: typing.Optional[str] = pydantic.Field(default=None)
|
|
55
55
|
"""
|
|
56
56
|
Current model version associated with this machine learning backend
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
|
-
timeout: typing.Optional[float] =
|
|
59
|
+
timeout: typing.Optional[float] = pydantic.Field(default=None)
|
|
60
60
|
"""
|
|
61
61
|
Response model timeout
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
64
|
created_at: typing.Optional[dt.datetime] = None
|
|
65
65
|
updated_at: typing.Optional[dt.datetime] = None
|
|
66
|
-
auto_update: typing.Optional[bool] =
|
|
66
|
+
auto_update: typing.Optional[bool] = pydantic.Field(default=None)
|
|
67
67
|
"""
|
|
68
68
|
If false, model version is set by the user, if true - getting latest version from backend.
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
71
|
project: int
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
78
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
79
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
80
|
-
|
|
81
|
-
return deep_union_pydantic_dicts(
|
|
82
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
83
|
-
)
|
|
73
|
+
if IS_PYDANTIC_V2:
|
|
74
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
75
|
+
else:
|
|
84
76
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
77
|
+
class Config:
|
|
78
|
+
frozen = True
|
|
79
|
+
smart_union = True
|
|
80
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
-
from .model_provider_connection_created_by import ModelProviderConnectionCreatedBy
|
|
9
|
-
from .model_provider_connection_organization import ModelProviderConnectionOrganization
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
10
4
|
from .model_provider_connection_provider import ModelProviderConnectionProvider
|
|
5
|
+
import typing
|
|
11
6
|
from .model_provider_connection_scope import ModelProviderConnectionScope
|
|
7
|
+
from .model_provider_connection_organization import ModelProviderConnectionOrganization
|
|
8
|
+
from .model_provider_connection_created_by import ModelProviderConnectionCreatedBy
|
|
9
|
+
import datetime as dt
|
|
10
|
+
import pydantic
|
|
11
|
+
from .model_provider_connection_budget_reset_period import ModelProviderConnectionBudgetResetPeriod
|
|
12
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
class ModelProviderConnection(
|
|
15
|
+
class ModelProviderConnection(UniversalBaseModel):
|
|
15
16
|
provider: ModelProviderConnectionProvider
|
|
16
17
|
api_key: typing.Optional[str] = None
|
|
17
18
|
deployment_name: typing.Optional[str] = None
|
|
@@ -21,21 +22,41 @@ class ModelProviderConnection(pydantic_v1.BaseModel):
|
|
|
21
22
|
created_by: typing.Optional[ModelProviderConnectionCreatedBy] = None
|
|
22
23
|
created_at: typing.Optional[dt.datetime] = None
|
|
23
24
|
updated_at: typing.Optional[dt.datetime] = None
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
is_internal: typing.Optional[bool] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Whether the model provider connection is internal, not visible to the user.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
budget_limit: typing.Optional[float] = pydantic.Field(default=None)
|
|
31
|
+
"""
|
|
32
|
+
Budget limit for the model provider connection (null if unlimited)
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
budget_last_reset_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
36
|
+
"""
|
|
37
|
+
Date and time the budget was last reset
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = pydantic.Field(default=None)
|
|
41
|
+
"""
|
|
42
|
+
Budget reset period for the model provider connection (null if not reset)
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
budget_total_spent: typing.Optional[float] = pydantic.Field(default=None)
|
|
46
|
+
"""
|
|
47
|
+
Tracked total budget spent for the given provider connection within the current budget period
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
budget_alert_threshold: typing.Optional[float] = pydantic.Field(default=None)
|
|
51
|
+
"""
|
|
52
|
+
Budget alert threshold for the given provider connection
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
if IS_PYDANTIC_V2:
|
|
56
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
57
|
+
else:
|
|
58
|
+
|
|
59
|
+
class Config:
|
|
60
|
+
frozen = True
|
|
61
|
+
smart_union = True
|
|
62
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
from ..core.pydantic_utilities import
|
|
5
|
+
import pydantic
|
|
6
|
+
import datetime as dt
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class Prediction(
|
|
10
|
+
class Prediction(UniversalBaseModel):
|
|
11
11
|
id: typing.Optional[int] = None
|
|
12
|
-
result: typing.List[typing.Dict[str, typing.Any]] =
|
|
12
|
+
result: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
|
|
13
13
|
"""
|
|
14
14
|
List of prediction results for the task
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
-
model_version: typing.Optional[str] =
|
|
17
|
+
model_version: typing.Optional[str] = pydantic.Field(default=None)
|
|
18
18
|
"""
|
|
19
19
|
Model version - tag for predictions that can be used to filter tasks in Data Manager, as well as select specific model version for showing preannotations in the labeling interface
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
created_ago: typing.Optional[str] =
|
|
22
|
+
created_ago: typing.Optional[str] = pydantic.Field(default=None)
|
|
23
23
|
"""
|
|
24
24
|
Delta time from creation time
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
|
-
score: typing.Optional[float] =
|
|
27
|
+
score: typing.Optional[float] = pydantic.Field(default=None)
|
|
28
28
|
"""
|
|
29
29
|
Prediction score
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
|
-
cluster: typing.Optional[int] =
|
|
32
|
+
cluster: typing.Optional[int] = pydantic.Field(default=None)
|
|
33
33
|
"""
|
|
34
34
|
Cluster for the current prediction
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
neighbors: typing.Optional[typing.Dict[str, typing.Any]] =
|
|
37
|
+
neighbors: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
38
38
|
"""
|
|
39
39
|
Array of task IDs of the closest neighbors
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
|
-
mislabeling: typing.Optional[float] =
|
|
42
|
+
mislabeling: typing.Optional[float] = pydantic.Field(default=None)
|
|
43
43
|
"""
|
|
44
44
|
Related task mislabeling score
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
47
|
created_at: typing.Optional[dt.datetime] = None
|
|
48
48
|
updated_at: typing.Optional[dt.datetime] = None
|
|
49
|
-
model: typing.Optional[int] =
|
|
49
|
+
model: typing.Optional[int] = pydantic.Field(default=None)
|
|
50
50
|
"""
|
|
51
51
|
An ML Backend instance that created the prediction.
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
model_run: typing.Optional[int] =
|
|
54
|
+
model_run: typing.Optional[int] = pydantic.Field(default=None)
|
|
55
55
|
"""
|
|
56
56
|
A run of a ModelVersion that created the prediction.
|
|
57
57
|
"""
|
|
@@ -59,20 +59,11 @@ class Prediction(pydantic_v1.BaseModel):
|
|
|
59
59
|
task: int
|
|
60
60
|
project: typing.Optional[int] = None
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
67
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
68
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
69
|
-
|
|
70
|
-
return deep_union_pydantic_dicts(
|
|
71
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
72
|
-
)
|
|
62
|
+
if IS_PYDANTIC_V2:
|
|
63
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
64
|
+
else:
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
66
|
+
class Config:
|
|
67
|
+
frozen = True
|
|
68
|
+
smart_union = True
|
|
69
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,127 +1,129 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
from
|
|
7
|
-
from
|
|
5
|
+
import pydantic
|
|
6
|
+
from .prompt import Prompt
|
|
7
|
+
from .user_simple import UserSimple
|
|
8
|
+
import datetime as dt
|
|
8
9
|
from .project_sampling import ProjectSampling
|
|
9
10
|
from .project_skip_queue import ProjectSkipQueue
|
|
10
|
-
from .
|
|
11
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class Project(
|
|
14
|
+
class Project(UniversalBaseModel):
|
|
14
15
|
id: typing.Optional[int] = None
|
|
15
|
-
title: typing.Optional[str] =
|
|
16
|
+
title: typing.Optional[str] = pydantic.Field(default=None)
|
|
16
17
|
"""
|
|
17
18
|
Project name. Must be between 3 and 50 characters long.
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
|
-
description: typing.Optional[str] =
|
|
21
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
22
|
"""
|
|
22
23
|
Project description
|
|
23
24
|
"""
|
|
24
25
|
|
|
25
|
-
label_config: typing.Optional[str] =
|
|
26
|
+
label_config: typing.Optional[str] = pydantic.Field(default=None)
|
|
26
27
|
"""
|
|
27
28
|
Label config in XML format. See more about it in documentation
|
|
28
29
|
"""
|
|
29
30
|
|
|
30
|
-
expert_instruction: typing.Optional[str] =
|
|
31
|
+
expert_instruction: typing.Optional[str] = pydantic.Field(default=None)
|
|
31
32
|
"""
|
|
32
33
|
Labeling instructions in HTML format
|
|
33
34
|
"""
|
|
34
35
|
|
|
35
|
-
show_instruction: typing.Optional[bool] =
|
|
36
|
+
show_instruction: typing.Optional[bool] = pydantic.Field(default=None)
|
|
36
37
|
"""
|
|
37
38
|
Show instructions to the annotator before they start
|
|
38
39
|
"""
|
|
39
40
|
|
|
40
|
-
show_skip_button: typing.Optional[bool] =
|
|
41
|
+
show_skip_button: typing.Optional[bool] = pydantic.Field(default=None)
|
|
41
42
|
"""
|
|
42
43
|
Show a skip button in interface and allow annotators to skip the task
|
|
43
44
|
"""
|
|
44
45
|
|
|
45
|
-
enable_empty_annotation: typing.Optional[bool] =
|
|
46
|
+
enable_empty_annotation: typing.Optional[bool] = pydantic.Field(default=None)
|
|
46
47
|
"""
|
|
47
48
|
Allow annotators to submit empty annotations
|
|
48
49
|
"""
|
|
49
50
|
|
|
50
|
-
show_annotation_history: typing.Optional[bool] =
|
|
51
|
+
show_annotation_history: typing.Optional[bool] = pydantic.Field(default=None)
|
|
51
52
|
"""
|
|
52
53
|
Show annotation history to annotator
|
|
53
54
|
"""
|
|
54
55
|
|
|
55
56
|
organization: typing.Optional[int] = None
|
|
57
|
+
prompts: typing.Optional[typing.List[Prompt]] = None
|
|
56
58
|
color: typing.Optional[str] = None
|
|
57
|
-
maximum_annotations: typing.Optional[int] =
|
|
59
|
+
maximum_annotations: typing.Optional[int] = pydantic.Field(default=None)
|
|
58
60
|
"""
|
|
59
61
|
Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True)
|
|
60
62
|
"""
|
|
61
63
|
|
|
62
|
-
is_published: typing.Optional[bool] =
|
|
64
|
+
is_published: typing.Optional[bool] = pydantic.Field(default=None)
|
|
63
65
|
"""
|
|
64
66
|
Whether or not the project is published to annotators
|
|
65
67
|
"""
|
|
66
68
|
|
|
67
|
-
model_version: typing.Optional[str] =
|
|
69
|
+
model_version: typing.Optional[str] = pydantic.Field(default=None)
|
|
68
70
|
"""
|
|
69
71
|
Machine learning model version
|
|
70
72
|
"""
|
|
71
73
|
|
|
72
|
-
is_draft: typing.Optional[bool] =
|
|
74
|
+
is_draft: typing.Optional[bool] = pydantic.Field(default=None)
|
|
73
75
|
"""
|
|
74
76
|
Whether or not the project is in the middle of being created
|
|
75
77
|
"""
|
|
76
78
|
|
|
77
79
|
created_by: typing.Optional[UserSimple] = None
|
|
78
80
|
created_at: typing.Optional[dt.datetime] = None
|
|
79
|
-
min_annotations_to_start_training: typing.Optional[int] =
|
|
81
|
+
min_annotations_to_start_training: typing.Optional[int] = pydantic.Field(default=None)
|
|
80
82
|
"""
|
|
81
83
|
Minimum number of completed tasks after which model training is started
|
|
82
84
|
"""
|
|
83
85
|
|
|
84
|
-
start_training_on_annotation_update: typing.Optional[
|
|
86
|
+
start_training_on_annotation_update: typing.Optional[bool] = pydantic.Field(default=None)
|
|
85
87
|
"""
|
|
86
88
|
Start model training after any annotations are submitted or updated
|
|
87
89
|
"""
|
|
88
90
|
|
|
89
|
-
show_collab_predictions: typing.Optional[bool] =
|
|
91
|
+
show_collab_predictions: typing.Optional[bool] = pydantic.Field(default=None)
|
|
90
92
|
"""
|
|
91
93
|
If set, the annotator can view model predictions
|
|
92
94
|
"""
|
|
93
95
|
|
|
94
|
-
num_tasks_with_annotations: typing.Optional[int] =
|
|
96
|
+
num_tasks_with_annotations: typing.Optional[int] = pydantic.Field(default=None)
|
|
95
97
|
"""
|
|
96
98
|
Tasks with annotations count
|
|
97
99
|
"""
|
|
98
100
|
|
|
99
|
-
task_number: typing.Optional[int] =
|
|
101
|
+
task_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
100
102
|
"""
|
|
101
103
|
Total task number in project
|
|
102
104
|
"""
|
|
103
105
|
|
|
104
|
-
useful_annotation_number: typing.Optional[int] =
|
|
106
|
+
useful_annotation_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
105
107
|
"""
|
|
106
108
|
Useful annotation number in project not including skipped_annotations_number and ground_truth_number. Total annotations = annotation_number + skipped_annotations_number + ground_truth_number
|
|
107
109
|
"""
|
|
108
110
|
|
|
109
|
-
ground_truth_number: typing.Optional[int] =
|
|
111
|
+
ground_truth_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
110
112
|
"""
|
|
111
113
|
Honeypot annotation number in project
|
|
112
114
|
"""
|
|
113
115
|
|
|
114
|
-
skipped_annotations_number: typing.Optional[int] =
|
|
116
|
+
skipped_annotations_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
115
117
|
"""
|
|
116
118
|
Skipped by collaborators annotation number in project
|
|
117
119
|
"""
|
|
118
120
|
|
|
119
|
-
total_annotations_number: typing.Optional[int] =
|
|
121
|
+
total_annotations_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
120
122
|
"""
|
|
121
123
|
Total annotations number in project including skipped_annotations_number and ground_truth_number.
|
|
122
124
|
"""
|
|
123
125
|
|
|
124
|
-
total_predictions_number: typing.Optional[int] =
|
|
126
|
+
total_predictions_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
125
127
|
"""
|
|
126
128
|
Total predictions number in project including skipped_annotations_number, ground_truth_number, and useful_annotation_number.
|
|
127
129
|
"""
|
|
@@ -130,69 +132,60 @@ class Project(pydantic_v1.BaseModel):
|
|
|
130
132
|
show_ground_truth_first: typing.Optional[bool] = None
|
|
131
133
|
show_overlap_first: typing.Optional[bool] = None
|
|
132
134
|
overlap_cohort_percentage: typing.Optional[int] = None
|
|
133
|
-
task_data_login: typing.Optional[str] =
|
|
135
|
+
task_data_login: typing.Optional[str] = pydantic.Field(default=None)
|
|
134
136
|
"""
|
|
135
137
|
Task data credentials: login
|
|
136
138
|
"""
|
|
137
139
|
|
|
138
|
-
task_data_password: typing.Optional[str] =
|
|
140
|
+
task_data_password: typing.Optional[str] = pydantic.Field(default=None)
|
|
139
141
|
"""
|
|
140
142
|
Task data credentials: password
|
|
141
143
|
"""
|
|
142
144
|
|
|
143
|
-
control_weights: typing.Optional[typing.Dict[str, typing.Any]] =
|
|
145
|
+
control_weights: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
144
146
|
"""
|
|
145
147
|
Dict of weights for each control tag in metric calculation. Each control tag (e.g. label or choice) will have it's own key in control weight dict with weight for each label and overall weight.For example, if bounding box annotation with control tag named my_bbox should be included with 0.33 weight in agreement calculation, and the first label Car should be twice more important than Airplaine, then you have to need the specify: {'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0, 'Airplaine': 0.5}, 'overall': 0.33}
|
|
146
148
|
"""
|
|
147
149
|
|
|
148
|
-
parsed_label_config: typing.Optional[typing.Dict[str, typing.Any]] =
|
|
150
|
+
parsed_label_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
149
151
|
"""
|
|
150
152
|
JSON-formatted labeling configuration
|
|
151
153
|
"""
|
|
152
154
|
|
|
153
|
-
evaluate_predictions_automatically: typing.Optional[bool] =
|
|
155
|
+
evaluate_predictions_automatically: typing.Optional[bool] = pydantic.Field(default=None)
|
|
154
156
|
"""
|
|
155
157
|
Retrieve and display predictions when loading a task
|
|
156
158
|
"""
|
|
157
159
|
|
|
158
|
-
config_has_control_tags: typing.Optional[
|
|
160
|
+
config_has_control_tags: typing.Optional[bool] = pydantic.Field(default=None)
|
|
159
161
|
"""
|
|
160
162
|
Flag to detect is project ready for labeling
|
|
161
163
|
"""
|
|
162
164
|
|
|
163
165
|
skip_queue: typing.Optional[ProjectSkipQueue] = None
|
|
164
|
-
reveal_preannotations_interactively: typing.Optional[bool] =
|
|
166
|
+
reveal_preannotations_interactively: typing.Optional[bool] = pydantic.Field(default=None)
|
|
165
167
|
"""
|
|
166
168
|
Reveal pre-annotations interactively
|
|
167
169
|
"""
|
|
168
170
|
|
|
169
|
-
pinned_at: typing.Optional[dt.datetime] =
|
|
171
|
+
pinned_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
170
172
|
"""
|
|
171
173
|
Pinned date and time
|
|
172
174
|
"""
|
|
173
175
|
|
|
174
|
-
finished_task_number: typing.Optional[int] =
|
|
176
|
+
finished_task_number: typing.Optional[int] = pydantic.Field(default=None)
|
|
175
177
|
"""
|
|
176
178
|
Finished tasks
|
|
177
179
|
"""
|
|
178
180
|
|
|
179
|
-
queue_total: typing.Optional[
|
|
180
|
-
queue_done: typing.Optional[
|
|
181
|
-
|
|
182
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
183
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
184
|
-
return super().json(**kwargs_with_defaults)
|
|
185
|
-
|
|
186
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
187
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
188
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
181
|
+
queue_total: typing.Optional[int] = None
|
|
182
|
+
queue_done: typing.Optional[int] = None
|
|
189
183
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
184
|
+
if IS_PYDANTIC_V2:
|
|
185
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
186
|
+
else:
|
|
193
187
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
188
|
+
class Config:
|
|
189
|
+
frozen = True
|
|
190
|
+
smart_union = True
|
|
191
|
+
extra = pydantic.Extra.allow
|