label-studio-sdk 1.0.8__py3-none-any.whl → 1.0.11__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 +37 -8
- 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 +5 -0
- label_studio_sdk/_extensions/pager_ext.py +8 -0
- 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 +54 -27
- label_studio_sdk/client.py +1 -0
- label_studio_sdk/comments/client.py +190 -44
- label_studio_sdk/converter/converter.py +56 -13
- 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 +37 -19
- 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/__init__.py +3 -1
- label_studio_sdk/errors/bad_request_error.py +2 -3
- label_studio_sdk/errors/not_found_error.py +9 -0
- label_studio_sdk/errors/unauthorized_error.py +9 -0
- 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/jwt_settings/__init__.py +2 -0
- label_studio_sdk/jwt_settings/client.py +259 -0
- label_studio_sdk/label_interface/control_tags.py +16 -3
- label_studio_sdk/label_interface/interface.py +80 -1
- label_studio_sdk/label_interface/object_tags.py +2 -2
- 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 +173 -56
- label_studio_sdk/predictions/client.py +247 -101
- label_studio_sdk/projects/__init__.py +5 -1
- label_studio_sdk/projects/client.py +313 -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 +200 -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/pauses/__init__.py +2 -0
- label_studio_sdk/projects/pauses/client.py +704 -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 +34 -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 +277 -88
- label_studio_sdk/tasks/client.py +263 -90
- label_studio_sdk/tasks/types/tasks_list_response.py +15 -25
- label_studio_sdk/tokens/__init__.py +2 -0
- label_studio_sdk/tokens/client.py +470 -0
- label_studio_sdk/tokens/client_ext.py +94 -0
- label_studio_sdk/types/__init__.py +20 -6
- label_studio_sdk/types/access_token_response.py +22 -0
- 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/api_token_response.py +32 -0
- 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 +17 -27
- 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/jwt_settings_response.py +32 -0
- 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 +22 -31
- 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/pause.py +34 -0
- label_studio_sdk/types/pause_paused_by.py +5 -0
- label_studio_sdk/types/prediction.py +21 -30
- label_studio_sdk/types/project.py +58 -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 +44 -47
- label_studio_sdk/types/task_annotators_item.py +1 -1
- label_studio_sdk/types/task_comment_authors_item.py +1 -1
- 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.8.dist-info → label_studio_sdk-1.0.11.dist-info}/METADATA +8 -5
- {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.dist-info}/RECORD +215 -188
- {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.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.8.dist-info → label_studio_sdk-1.0.11.dist-info}/LICENSE +0 -0
label_studio_sdk/__init__.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from .types import (
|
|
4
|
+
AccessTokenResponse,
|
|
4
5
|
Annotation,
|
|
5
6
|
AnnotationFilterOptions,
|
|
6
7
|
AnnotationLastAction,
|
|
7
8
|
AnnotationsDmField,
|
|
8
9
|
AnnotationsDmFieldLastAction,
|
|
10
|
+
ApiTokenResponse,
|
|
9
11
|
AzureBlobExportStorage,
|
|
10
12
|
AzureBlobExportStorageStatus,
|
|
11
13
|
AzureBlobImportStorage,
|
|
@@ -23,9 +25,9 @@ from .types import (
|
|
|
23
25
|
DataManagerTaskSerializerDraftsItem,
|
|
24
26
|
DataManagerTaskSerializerPredictionsItem,
|
|
25
27
|
Export,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
ExportFormat,
|
|
29
|
+
ExportSnapshot,
|
|
30
|
+
ExportSnapshotStatus,
|
|
29
31
|
ExportStatus,
|
|
30
32
|
FileUpload,
|
|
31
33
|
Filter,
|
|
@@ -40,6 +42,7 @@ from .types import (
|
|
|
40
42
|
InferenceRunOrganization,
|
|
41
43
|
InferenceRunProjectSubset,
|
|
42
44
|
InferenceRunStatus,
|
|
45
|
+
JwtSettingsResponse,
|
|
43
46
|
KeyIndicatorValue,
|
|
44
47
|
KeyIndicators,
|
|
45
48
|
KeyIndicatorsItem,
|
|
@@ -58,6 +61,8 @@ from .types import (
|
|
|
58
61
|
ModelProviderConnectionOrganization,
|
|
59
62
|
ModelProviderConnectionProvider,
|
|
60
63
|
ModelProviderConnectionScope,
|
|
64
|
+
Pause,
|
|
65
|
+
PausePausedBy,
|
|
61
66
|
Prediction,
|
|
62
67
|
Project,
|
|
63
68
|
ProjectImport,
|
|
@@ -66,6 +71,8 @@ from .types import (
|
|
|
66
71
|
ProjectSampling,
|
|
67
72
|
ProjectSkipQueue,
|
|
68
73
|
Prompt,
|
|
74
|
+
PromptAssociatedProjectsItem,
|
|
75
|
+
PromptAssociatedProjectsItemId,
|
|
69
76
|
PromptCreatedBy,
|
|
70
77
|
PromptOrganization,
|
|
71
78
|
PromptVersion,
|
|
@@ -99,7 +106,7 @@ from .types import (
|
|
|
99
106
|
WebhookSerializerForUpdateActionsItem,
|
|
100
107
|
Workspace,
|
|
101
108
|
)
|
|
102
|
-
from .errors import BadRequestError, InternalServerError
|
|
109
|
+
from .errors import BadRequestError, InternalServerError, NotFoundError, UnauthorizedError
|
|
103
110
|
from . import (
|
|
104
111
|
actions,
|
|
105
112
|
annotations,
|
|
@@ -107,13 +114,16 @@ from . import (
|
|
|
107
114
|
export_storage,
|
|
108
115
|
files,
|
|
109
116
|
import_storage,
|
|
117
|
+
jwt_settings,
|
|
110
118
|
ml,
|
|
111
119
|
model_providers,
|
|
112
120
|
predictions,
|
|
113
121
|
projects,
|
|
114
122
|
prompts,
|
|
115
123
|
tasks,
|
|
124
|
+
tokens,
|
|
116
125
|
users,
|
|
126
|
+
versions,
|
|
117
127
|
views,
|
|
118
128
|
webhooks,
|
|
119
129
|
workspaces,
|
|
@@ -132,7 +142,8 @@ from .actions import (
|
|
|
132
142
|
ActionsCreateRequestSelectedItemsExcluded,
|
|
133
143
|
ActionsCreateRequestSelectedItemsIncluded,
|
|
134
144
|
)
|
|
135
|
-
from .annotations import AnnotationsCreateBulkResponseItem
|
|
145
|
+
from .annotations import AnnotationsCreateBulkRequestSelectedItems, AnnotationsCreateBulkResponseItem
|
|
146
|
+
from .client import AsyncLabelStudio, LabelStudio
|
|
136
147
|
from .environment import LabelStudioEnvironment
|
|
137
148
|
from .export_storage import ExportStorageListTypesResponseItem
|
|
138
149
|
from .import_storage import ImportStorageListTypesResponseItem
|
|
@@ -154,6 +165,7 @@ from .prompts import (
|
|
|
154
165
|
from .tasks import TasksListRequestFields, TasksListResponse
|
|
155
166
|
from .users import UsersGetTokenResponse, UsersResetTokenResponse
|
|
156
167
|
from .version import __version__
|
|
168
|
+
from .versions import VersionsGetResponse, VersionsGetResponseEdition
|
|
157
169
|
from .views import (
|
|
158
170
|
ViewsCreateRequestData,
|
|
159
171
|
ViewsCreateRequestDataFilters,
|
|
@@ -175,6 +187,7 @@ from .views import (
|
|
|
175
187
|
from .webhooks import WebhooksUpdateRequestActionsItem
|
|
176
188
|
|
|
177
189
|
__all__ = [
|
|
190
|
+
"AccessTokenResponse",
|
|
178
191
|
"ActionsCreateRequestFilters",
|
|
179
192
|
"ActionsCreateRequestFiltersConjunction",
|
|
180
193
|
"ActionsCreateRequestFiltersItemsItem",
|
|
@@ -189,9 +202,12 @@ __all__ = [
|
|
|
189
202
|
"Annotation",
|
|
190
203
|
"AnnotationFilterOptions",
|
|
191
204
|
"AnnotationLastAction",
|
|
205
|
+
"AnnotationsCreateBulkRequestSelectedItems",
|
|
192
206
|
"AnnotationsCreateBulkResponseItem",
|
|
193
207
|
"AnnotationsDmField",
|
|
194
208
|
"AnnotationsDmFieldLastAction",
|
|
209
|
+
"ApiTokenResponse",
|
|
210
|
+
"AsyncLabelStudio",
|
|
195
211
|
"AzureBlobExportStorage",
|
|
196
212
|
"AzureBlobExportStorageStatus",
|
|
197
213
|
"AzureBlobImportStorage",
|
|
@@ -211,9 +227,9 @@ __all__ = [
|
|
|
211
227
|
"DataManagerTaskSerializerDraftsItem",
|
|
212
228
|
"DataManagerTaskSerializerPredictionsItem",
|
|
213
229
|
"Export",
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"
|
|
230
|
+
"ExportFormat",
|
|
231
|
+
"ExportSnapshot",
|
|
232
|
+
"ExportSnapshotStatus",
|
|
217
233
|
"ExportStatus",
|
|
218
234
|
"ExportStorageListTypesResponseItem",
|
|
219
235
|
"FileUpload",
|
|
@@ -231,11 +247,13 @@ __all__ = [
|
|
|
231
247
|
"InferenceRunProjectSubset",
|
|
232
248
|
"InferenceRunStatus",
|
|
233
249
|
"InternalServerError",
|
|
250
|
+
"JwtSettingsResponse",
|
|
234
251
|
"KeyIndicatorValue",
|
|
235
252
|
"KeyIndicators",
|
|
236
253
|
"KeyIndicatorsItem",
|
|
237
254
|
"KeyIndicatorsItemAdditionalKpisItem",
|
|
238
255
|
"KeyIndicatorsItemExtraKpisItem",
|
|
256
|
+
"LabelStudio",
|
|
239
257
|
"LabelStudioEnvironment",
|
|
240
258
|
"LocalFilesExportStorage",
|
|
241
259
|
"LocalFilesExportStorageStatus",
|
|
@@ -256,6 +274,9 @@ __all__ = [
|
|
|
256
274
|
"ModelProviderConnectionOrganization",
|
|
257
275
|
"ModelProviderConnectionProvider",
|
|
258
276
|
"ModelProviderConnectionScope",
|
|
277
|
+
"NotFoundError",
|
|
278
|
+
"Pause",
|
|
279
|
+
"PausePausedBy",
|
|
259
280
|
"Prediction",
|
|
260
281
|
"Project",
|
|
261
282
|
"ProjectImport",
|
|
@@ -268,6 +289,8 @@ __all__ = [
|
|
|
268
289
|
"ProjectsListResponse",
|
|
269
290
|
"ProjectsUpdateResponse",
|
|
270
291
|
"Prompt",
|
|
292
|
+
"PromptAssociatedProjectsItem",
|
|
293
|
+
"PromptAssociatedProjectsItemId",
|
|
271
294
|
"PromptCreatedBy",
|
|
272
295
|
"PromptOrganization",
|
|
273
296
|
"PromptVersion",
|
|
@@ -299,9 +322,12 @@ __all__ = [
|
|
|
299
322
|
"TaskFilterOptions",
|
|
300
323
|
"TasksListRequestFields",
|
|
301
324
|
"TasksListResponse",
|
|
325
|
+
"UnauthorizedError",
|
|
302
326
|
"UserSimple",
|
|
303
327
|
"UsersGetTokenResponse",
|
|
304
328
|
"UsersResetTokenResponse",
|
|
329
|
+
"VersionsGetResponse",
|
|
330
|
+
"VersionsGetResponseEdition",
|
|
305
331
|
"View",
|
|
306
332
|
"ViewsCreateRequestData",
|
|
307
333
|
"ViewsCreateRequestDataFilters",
|
|
@@ -332,13 +358,16 @@ __all__ = [
|
|
|
332
358
|
"export_storage",
|
|
333
359
|
"files",
|
|
334
360
|
"import_storage",
|
|
361
|
+
"jwt_settings",
|
|
335
362
|
"ml",
|
|
336
363
|
"model_providers",
|
|
337
364
|
"predictions",
|
|
338
365
|
"projects",
|
|
339
366
|
"prompts",
|
|
340
367
|
"tasks",
|
|
368
|
+
"tokens",
|
|
341
369
|
"users",
|
|
370
|
+
"versions",
|
|
342
371
|
"views",
|
|
343
372
|
"webhooks",
|
|
344
373
|
"workspaces",
|
|
@@ -37,6 +37,17 @@ def get_cache_dir():
|
|
|
37
37
|
return cache_dir
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
def safe_build_path(base_dir: str, user_path: str) -> str:
|
|
41
|
+
combined_path = os.path.join(base_dir, user_path)
|
|
42
|
+
absolute_path = os.path.abspath(combined_path)
|
|
43
|
+
base_dir_abs = os.path.abspath(base_dir)
|
|
44
|
+
|
|
45
|
+
if os.path.commonpath([absolute_path, base_dir_abs]) != base_dir_abs:
|
|
46
|
+
raise ValueError(f"Invalid path: {user_path}")
|
|
47
|
+
|
|
48
|
+
return absolute_path
|
|
49
|
+
|
|
50
|
+
|
|
40
51
|
def get_local_path(
|
|
41
52
|
url,
|
|
42
53
|
cache_dir=None,
|
|
@@ -103,7 +114,7 @@ def get_local_path(
|
|
|
103
114
|
# instead of downloading them from LS instance
|
|
104
115
|
if is_local_storage_file:
|
|
105
116
|
filepath = url.split("?d=")[1]
|
|
106
|
-
filepath =
|
|
117
|
+
filepath = safe_build_path(LOCAL_FILES_DOCUMENT_ROOT, filepath)
|
|
107
118
|
if os.path.exists(filepath):
|
|
108
119
|
logger.debug(
|
|
109
120
|
f"Local Storage file path exists locally, use it as a local file: {filepath}"
|
|
@@ -124,9 +135,9 @@ def get_local_path(
|
|
|
124
135
|
if is_uploaded_file and os.path.exists(image_dir):
|
|
125
136
|
project_id = url.split("/")[-2] # To retrieve project_id
|
|
126
137
|
filepath = os.path.join(image_dir, project_id, os.path.basename(url))
|
|
127
|
-
if cache_dir and download_resources:
|
|
128
|
-
shutil.copy(filepath, cache_dir)
|
|
129
138
|
if os.path.exists(filepath):
|
|
139
|
+
if cache_dir and download_resources:
|
|
140
|
+
shutil.copy(filepath, cache_dir)
|
|
130
141
|
logger.debug(f"Uploaded file: Path exists in image_dir: {filepath}")
|
|
131
142
|
return filepath
|
|
132
143
|
|
|
@@ -202,7 +213,7 @@ def download_and_cache(
|
|
|
202
213
|
filepath = os.path.join(cache_dir, url_hash + "__" + url_filename)
|
|
203
214
|
|
|
204
215
|
if not os.path.exists(filepath):
|
|
205
|
-
logger.info("Download {url} to {filepath}".format(url=url, filepath=filepath))
|
|
216
|
+
logger.info("Download {url} to {filepath}. download_resources: {download_resources}".format(url=url, filepath=filepath, download_resources=download_resources))
|
|
206
217
|
if download_resources:
|
|
207
218
|
headers = {
|
|
208
219
|
# avoid requests.exceptions.HTTPError: 403 Client Error: Forbidden. Please comply with the User-Agent policy:
|
|
@@ -227,6 +238,7 @@ def download_and_cache(
|
|
|
227
238
|
raise e
|
|
228
239
|
with io.open(filepath, mode="wb") as fout:
|
|
229
240
|
fout.write(r.content)
|
|
241
|
+
logger.info(f"File downloaded to {filepath}")
|
|
230
242
|
return filepath
|
|
231
243
|
|
|
232
244
|
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import types
|
|
3
3
|
import sys
|
|
4
4
|
import functools
|
|
5
|
+
import logging
|
|
5
6
|
from typing import Type, Dict, Any, Tuple, Generator
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
from tempfile import TemporaryDirectory
|
|
@@ -11,6 +12,8 @@ from datamodel_code_generator.parser.jsonschema import JsonSchemaParser
|
|
|
11
12
|
from pydantic import BaseModel
|
|
12
13
|
from contextlib import contextmanager
|
|
13
14
|
|
|
15
|
+
logger = logging.getLogger(__name__)
|
|
16
|
+
|
|
14
17
|
|
|
15
18
|
@functools.lru_cache(maxsize=128)
|
|
16
19
|
def _generate_model_code(json_schema_str: str, class_name: str = 'MyModel') -> str:
|
|
@@ -65,6 +68,7 @@ def json_schema_to_pydantic(json_schema: dict, class_name: str = 'MyModel') -> G
|
|
|
65
68
|
json_schema_str = json.dumps(json_schema)
|
|
66
69
|
|
|
67
70
|
# Generate Pydantic model code from the JSON schema string
|
|
71
|
+
logger.debug(f"Generating Pydantic model code from json schema: {json_schema_str}")
|
|
68
72
|
model_code: str = _generate_model_code(json_schema_str, class_name)
|
|
69
73
|
|
|
70
74
|
# Create a unique module name using the id of the JSON schema string
|
|
@@ -79,6 +83,7 @@ def json_schema_to_pydantic(json_schema: dict, class_name: str = 'MyModel') -> G
|
|
|
79
83
|
# Add the new module to sys.modules to make it importable
|
|
80
84
|
# This is necessary to avoid Pydantic errors related to undefined models
|
|
81
85
|
sys.modules[module_name] = mod
|
|
86
|
+
logger.debug(f"Generated Pydantic model: {model_class}")
|
|
82
87
|
yield model_class
|
|
83
88
|
finally:
|
|
84
89
|
if module_name in sys.modules:
|
|
@@ -47,3 +47,11 @@ class AsyncPagerExt(AsyncPager, typing.Generic[T]):
|
|
|
47
47
|
if exc.status_code == 404:
|
|
48
48
|
return
|
|
49
49
|
raise
|
|
50
|
+
|
|
51
|
+
async def __anext__(self) -> T:
|
|
52
|
+
try:
|
|
53
|
+
return await super().__anext__()
|
|
54
|
+
except ApiError as exc:
|
|
55
|
+
if exc.status_code == 404:
|
|
56
|
+
raise StopAsyncIteration
|
|
57
|
+
raise
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
+
from ..core.client_wrapper import SyncClientWrapper
|
|
5
|
+
from ..core.request_options import RequestOptions
|
|
4
6
|
from json.decoder import JSONDecodeError
|
|
5
|
-
|
|
6
7
|
from ..core.api_error import ApiError
|
|
7
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
-
from ..core.request_options import RequestOptions
|
|
9
|
-
from .types.actions_create_request_filters import ActionsCreateRequestFilters
|
|
10
8
|
from .types.actions_create_request_id import ActionsCreateRequestId
|
|
11
|
-
from .types.
|
|
9
|
+
from .types.actions_create_request_filters import ActionsCreateRequestFilters
|
|
12
10
|
from .types.actions_create_request_selected_items import ActionsCreateRequestSelectedItems
|
|
11
|
+
from .types.actions_create_request_ordering_item import ActionsCreateRequestOrderingItem
|
|
12
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
|
13
14
|
|
|
14
15
|
# this is used as the default value for optional parameters
|
|
15
16
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -34,7 +35,7 @@ class ActionsClient:
|
|
|
34
35
|
|
|
35
36
|
Examples
|
|
36
37
|
--------
|
|
37
|
-
from label_studio_sdk
|
|
38
|
+
from label_studio_sdk import LabelStudio
|
|
38
39
|
|
|
39
40
|
client = LabelStudio(
|
|
40
41
|
api_key="YOUR_API_KEY",
|
|
@@ -42,7 +43,9 @@ class ActionsClient:
|
|
|
42
43
|
client.actions.list()
|
|
43
44
|
"""
|
|
44
45
|
_response = self._client_wrapper.httpx_client.request(
|
|
45
|
-
"api/dm/actions/",
|
|
46
|
+
"api/dm/actions/",
|
|
47
|
+
method="GET",
|
|
48
|
+
request_options=request_options,
|
|
46
49
|
)
|
|
47
50
|
try:
|
|
48
51
|
if 200 <= _response.status_code < 300:
|
|
@@ -61,7 +64,7 @@ class ActionsClient:
|
|
|
61
64
|
filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
|
|
62
65
|
selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
|
|
63
66
|
ordering: typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]] = OMIT,
|
|
64
|
-
request_options: typing.Optional[RequestOptions] = None
|
|
67
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
65
68
|
) -> None:
|
|
66
69
|
"""
|
|
67
70
|
Perform a Data Manager action with the selected tasks and filters. Note: More complex actions require additional parameters in the request body. Call `GET api/actions?project=<id>` to explore them. <br>Example: `GET api/actions?id=delete_tasks&project=1`
|
|
@@ -95,12 +98,12 @@ class ActionsClient:
|
|
|
95
98
|
|
|
96
99
|
Examples
|
|
97
100
|
--------
|
|
98
|
-
from label_studio_sdk import
|
|
101
|
+
from label_studio_sdk import LabelStudio
|
|
102
|
+
from label_studio_sdk.actions import (
|
|
99
103
|
ActionsCreateRequestFilters,
|
|
100
104
|
ActionsCreateRequestFiltersItemsItem,
|
|
101
105
|
ActionsCreateRequestSelectedItemsExcluded,
|
|
102
106
|
)
|
|
103
|
-
from label_studio_sdk.client import LabelStudio
|
|
104
107
|
|
|
105
108
|
client = LabelStudio(
|
|
106
109
|
api_key="YOUR_API_KEY",
|
|
@@ -129,8 +132,23 @@ class ActionsClient:
|
|
|
129
132
|
_response = self._client_wrapper.httpx_client.request(
|
|
130
133
|
"api/dm/actions/",
|
|
131
134
|
method="POST",
|
|
132
|
-
params={
|
|
133
|
-
|
|
135
|
+
params={
|
|
136
|
+
"id": id,
|
|
137
|
+
"project": project,
|
|
138
|
+
"view": view,
|
|
139
|
+
},
|
|
140
|
+
json={
|
|
141
|
+
"filters": convert_and_respect_annotation_metadata(
|
|
142
|
+
object_=filters, annotation=ActionsCreateRequestFilters, direction="write"
|
|
143
|
+
),
|
|
144
|
+
"selectedItems": convert_and_respect_annotation_metadata(
|
|
145
|
+
object_=selected_items, annotation=ActionsCreateRequestSelectedItems, direction="write"
|
|
146
|
+
),
|
|
147
|
+
"ordering": ordering,
|
|
148
|
+
},
|
|
149
|
+
headers={
|
|
150
|
+
"content-type": "application/json",
|
|
151
|
+
},
|
|
134
152
|
request_options=request_options,
|
|
135
153
|
omit=OMIT,
|
|
136
154
|
)
|
|
@@ -162,15 +180,25 @@ class AsyncActionsClient:
|
|
|
162
180
|
|
|
163
181
|
Examples
|
|
164
182
|
--------
|
|
165
|
-
|
|
183
|
+
import asyncio
|
|
184
|
+
|
|
185
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
166
186
|
|
|
167
187
|
client = AsyncLabelStudio(
|
|
168
188
|
api_key="YOUR_API_KEY",
|
|
169
189
|
)
|
|
170
|
-
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async def main() -> None:
|
|
193
|
+
await client.actions.list()
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
asyncio.run(main())
|
|
171
197
|
"""
|
|
172
198
|
_response = await self._client_wrapper.httpx_client.request(
|
|
173
|
-
"api/dm/actions/",
|
|
199
|
+
"api/dm/actions/",
|
|
200
|
+
method="GET",
|
|
201
|
+
request_options=request_options,
|
|
174
202
|
)
|
|
175
203
|
try:
|
|
176
204
|
if 200 <= _response.status_code < 300:
|
|
@@ -189,7 +217,7 @@ class AsyncActionsClient:
|
|
|
189
217
|
filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
|
|
190
218
|
selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
|
|
191
219
|
ordering: typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]] = OMIT,
|
|
192
|
-
request_options: typing.Optional[RequestOptions] = None
|
|
220
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
193
221
|
) -> None:
|
|
194
222
|
"""
|
|
195
223
|
Perform a Data Manager action with the selected tasks and filters. Note: More complex actions require additional parameters in the request body. Call `GET api/actions?project=<id>` to explore them. <br>Example: `GET api/actions?id=delete_tasks&project=1`
|
|
@@ -223,42 +251,65 @@ class AsyncActionsClient:
|
|
|
223
251
|
|
|
224
252
|
Examples
|
|
225
253
|
--------
|
|
226
|
-
|
|
254
|
+
import asyncio
|
|
255
|
+
|
|
256
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
257
|
+
from label_studio_sdk.actions import (
|
|
227
258
|
ActionsCreateRequestFilters,
|
|
228
259
|
ActionsCreateRequestFiltersItemsItem,
|
|
229
260
|
ActionsCreateRequestSelectedItemsExcluded,
|
|
230
261
|
)
|
|
231
|
-
from label_studio_sdk.client import AsyncLabelStudio
|
|
232
262
|
|
|
233
263
|
client = AsyncLabelStudio(
|
|
234
264
|
api_key="YOUR_API_KEY",
|
|
235
265
|
)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
async def main() -> None:
|
|
269
|
+
await client.actions.create(
|
|
270
|
+
id="retrieve_tasks_predictions",
|
|
271
|
+
project=1,
|
|
272
|
+
filters=ActionsCreateRequestFilters(
|
|
273
|
+
conjunction="or",
|
|
274
|
+
items=[
|
|
275
|
+
ActionsCreateRequestFiltersItemsItem(
|
|
276
|
+
filter="filter:tasks:id",
|
|
277
|
+
operator="greater",
|
|
278
|
+
type="Number",
|
|
279
|
+
value=123,
|
|
280
|
+
)
|
|
281
|
+
],
|
|
282
|
+
),
|
|
283
|
+
selected_items=ActionsCreateRequestSelectedItemsExcluded(
|
|
284
|
+
all_=True,
|
|
285
|
+
excluded=[124, 125, 126],
|
|
286
|
+
),
|
|
287
|
+
ordering=["tasks:total_annotations"],
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
asyncio.run(main())
|
|
256
292
|
"""
|
|
257
293
|
_response = await self._client_wrapper.httpx_client.request(
|
|
258
294
|
"api/dm/actions/",
|
|
259
295
|
method="POST",
|
|
260
|
-
params={
|
|
261
|
-
|
|
296
|
+
params={
|
|
297
|
+
"id": id,
|
|
298
|
+
"project": project,
|
|
299
|
+
"view": view,
|
|
300
|
+
},
|
|
301
|
+
json={
|
|
302
|
+
"filters": convert_and_respect_annotation_metadata(
|
|
303
|
+
object_=filters, annotation=ActionsCreateRequestFilters, direction="write"
|
|
304
|
+
),
|
|
305
|
+
"selectedItems": convert_and_respect_annotation_metadata(
|
|
306
|
+
object_=selected_items, annotation=ActionsCreateRequestSelectedItems, direction="write"
|
|
307
|
+
),
|
|
308
|
+
"ordering": ordering,
|
|
309
|
+
},
|
|
310
|
+
headers={
|
|
311
|
+
"content-type": "application/json",
|
|
312
|
+
},
|
|
262
313
|
request_options=request_options,
|
|
263
314
|
omit=OMIT,
|
|
264
315
|
)
|
|
@@ -1,43 +1,33 @@
|
|
|
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
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
8
4
|
from .actions_create_request_filters_conjunction import ActionsCreateRequestFiltersConjunction
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing
|
|
9
7
|
from .actions_create_request_filters_items_item import ActionsCreateRequestFiltersItemsItem
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
class ActionsCreateRequestFilters(
|
|
11
|
+
class ActionsCreateRequestFilters(UniversalBaseModel):
|
|
13
12
|
"""
|
|
14
13
|
Filters to apply on tasks. You can use [the helper class `Filters` from this page](https://labelstud.io/sdk/data_manager.html) to create Data Manager Filters.<br>Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
|
|
15
14
|
"""
|
|
16
15
|
|
|
17
|
-
conjunction: ActionsCreateRequestFiltersConjunction =
|
|
16
|
+
conjunction: ActionsCreateRequestFiltersConjunction = pydantic.Field()
|
|
18
17
|
"""
|
|
19
18
|
Logical conjunction for the filters. This conjunction (either "or" or "and") will be applied to all items in the filters list. It is not possible to combine "or" and "and" within one list of filters. All filters will be either combined with "or" or with "and", but not a mix of both.
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
|
-
items: typing.List[ActionsCreateRequestFiltersItemsItem] =
|
|
21
|
+
items: typing.List[ActionsCreateRequestFiltersItemsItem] = pydantic.Field()
|
|
23
22
|
"""
|
|
24
23
|
List of filter items
|
|
25
24
|
"""
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
32
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
34
|
-
|
|
35
|
-
return deep_union_pydantic_dicts(
|
|
36
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
37
|
-
)
|
|
26
|
+
if IS_PYDANTIC_V2:
|
|
27
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
28
|
+
else:
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
30
|
+
class Config:
|
|
31
|
+
frozen = True
|
|
32
|
+
smart_union = True
|
|
33
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,50 +1,40 @@
|
|
|
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
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
8
4
|
from .actions_create_request_filters_items_item_filter import ActionsCreateRequestFiltersItemsItemFilter
|
|
5
|
+
import pydantic
|
|
9
6
|
from .actions_create_request_filters_items_item_operator import ActionsCreateRequestFiltersItemsItemOperator
|
|
10
7
|
from .actions_create_request_filters_items_item_value import ActionsCreateRequestFiltersItemsItemValue
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
import typing
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
class ActionsCreateRequestFiltersItemsItem(
|
|
14
|
-
filter: ActionsCreateRequestFiltersItemsItemFilter =
|
|
12
|
+
class ActionsCreateRequestFiltersItemsItem(UniversalBaseModel):
|
|
13
|
+
filter: ActionsCreateRequestFiltersItemsItemFilter = pydantic.Field()
|
|
15
14
|
"""
|
|
16
15
|
Filter identifier, it should start with `filter:tasks:` prefix, e.g. `filter:tasks:agreement`. For `task.data` fields it may look like `filter:tasks:data.field_name`. If you need more info about columns, check the [Get data manager columns](#tag/Data-Manager/operation/api_dm_columns_list) API endpoint. Possible values:<br><li>`filter:tasks:agreement`<br> (Number) Agreement for annotation results for a specific task (Enterprise only)</li><br><li>`filter:tasks:annotations_results`<br> (String) Annotation results for the tasks</li><br><li>`filter:tasks:annotators`<br> (List) Annotators that completed the task (Community). Can include assigned annotators (Enterprise only). Important note: the filter `type` should be List, but the filter `value` is integer</li><br><li>`filter:tasks:cancelled_annotations`<br> (Number) Number of cancelled or skipped annotations for the task</li><br><li>`filter:tasks:comments`<br> (Number) Number of comments in a task</li><br><li>`filter:tasks:completed_at`<br> (Datetime) Time when a task was fully annotated</li><br><li>`filter:tasks:created_at`<br> (Datetime) Time the task was created at</li><br><li>`filter:tasks:file_upload`<br> (String) Name of the file uploaded to create the tasks</li><br><li>`filter:tasks:ground_truth`<br> (Boolean) Ground truth status of the tasks</li><br><li>`filter:tasks:id`<br> (Number) Task ID</li><br><li>`filter:tasks:inner_id`<br> (Number) Task Inner ID, it starts from 1 for all projects</li><br><li>`filter:tasks:predictions_model_versions`<br> (String) Model version used for the predictions</li><br><li>`filter:tasks:predictions_results`<br> (String) Prediction results for the tasks</li><br><li>`filter:tasks:predictions_score`<br> (Number) Prediction score for the task</li><br><li>`filter:tasks:reviewed`<br> (Boolean) Whether the tasks have been reviewed (Enterprise only)</li><br><li>`filter:tasks:reviewers`<br> (String) Reviewers that reviewed the task, or assigned reviewers (Enterprise only). Important note: the filter `type` should be List, but the filter `value` is integer</li><br><li>`filter:tasks:reviews_accepted`<br> (Number) Number of annotations accepted for a task in review (Enterprise only)</li><br><li>`filter:tasks:reviews_rejected`<br> (Number) Number of annotations rejected for a task in review (Enterprise only)</li><br><li>`filter:tasks:total_annotations`<br> (Number) Total number of annotations on a task</li><br><li>`filter:tasks:total_predictions`<br> (Number) Total number of predictions for the task</li><br><li>`filter:tasks:unresolved_comment_count`<br> (Number) Number of unresolved comments in a task</li><br><li>`filter:tasks:updated_at`<br> (Datetime) Time the task was updated at (e.g. new annotation was created, review added, etc)</li>
|
|
17
16
|
"""
|
|
18
17
|
|
|
19
|
-
operator: ActionsCreateRequestFiltersItemsItemOperator =
|
|
18
|
+
operator: ActionsCreateRequestFiltersItemsItemOperator = pydantic.Field()
|
|
20
19
|
"""
|
|
21
20
|
Filter operator. Possible values:<br><li>`contains`<br> Contains</li><br><li>`ends_with`<br> Ends with</li><br><li>`equal`<br> Equal to</li><br><li>`exists`<br> Exists</li><br><li>`greater`<br> Greater than</li><br><li>`greater_or_equal`<br> Greater than or equal to</li><br><li>`in`<br> Is between min and max values, so the filter `value` should be e.g. `{"min": 1, "max": 7}`</li><br><li>`less`<br> Less than</li><br><li>`less_or_equal`<br> Less than or equal to</li><br><li>`not_contains`<br> Does not contain</li><br><li>`not_equal`<br> Not equal to</li><br><li>`not_exists`<br> Does not exist</li><br><li>`not_in`<br> Is not between min and max values, so the filter `value` should be e.g. `{"min": 1, "max": 7}`</li><br><li>`starts_with`<br> Starts with</li>
|
|
22
21
|
"""
|
|
23
22
|
|
|
24
|
-
type: str =
|
|
23
|
+
type: str = pydantic.Field()
|
|
25
24
|
"""
|
|
26
25
|
Type of the filter value. Possible values:<br><li>`Boolean`<br> Boolean</li><br><li>`Datetime`<br> Datetime string in `strftime('%Y-%m-%dT%H:%M:%S.%fZ')` format</li><br><li>`List`<br> List of items</li><br><li>`Number`<br> Float or Integer</li><br><li>`String`<br> String</li><br><li>`Unknown`<br> Unknown is explicitly converted to string format</li>
|
|
27
26
|
"""
|
|
28
27
|
|
|
29
|
-
value: ActionsCreateRequestFiltersItemsItemValue =
|
|
28
|
+
value: ActionsCreateRequestFiltersItemsItemValue = pydantic.Field()
|
|
30
29
|
"""
|
|
31
30
|
Value to filter by
|
|
32
31
|
"""
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
39
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
40
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
41
|
-
|
|
42
|
-
return deep_union_pydantic_dicts(
|
|
43
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
44
|
-
)
|
|
33
|
+
if IS_PYDANTIC_V2:
|
|
34
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
35
|
+
else:
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
37
|
+
class Config:
|
|
38
|
+
frozen = True
|
|
39
|
+
smart_union = True
|
|
40
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
-
|
|
5
|
-
from .actions_create_request_selected_items_excluded import ActionsCreateRequestSelectedItemsExcluded
|
|
6
4
|
from .actions_create_request_selected_items_included import ActionsCreateRequestSelectedItemsIncluded
|
|
5
|
+
from .actions_create_request_selected_items_excluded import ActionsCreateRequestSelectedItemsExcluded
|
|
7
6
|
|
|
8
7
|
ActionsCreateRequestSelectedItems = typing.Union[
|
|
9
8
|
ActionsCreateRequestSelectedItemsIncluded, ActionsCreateRequestSelectedItemsExcluded
|