label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.2__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 +4 -0
- label_studio_sdk/actions/client.py +13 -13
- label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
- label_studio_sdk/annotations/client.py +441 -441
- label_studio_sdk/comments/client.py +176 -176
- label_studio_sdk/export_storage/azure/client.py +274 -274
- label_studio_sdk/export_storage/gcs/client.py +263 -263
- label_studio_sdk/export_storage/local/client.py +206 -206
- label_studio_sdk/export_storage/redis/client.py +287 -287
- label_studio_sdk/export_storage/s3/client.py +347 -347
- label_studio_sdk/export_storage/s3s/client.py +678 -678
- label_studio_sdk/import_storage/azure/client.py +357 -357
- label_studio_sdk/import_storage/gcs/client.py +357 -357
- label_studio_sdk/import_storage/local/client.py +206 -206
- label_studio_sdk/import_storage/redis/client.py +309 -309
- label_studio_sdk/import_storage/s3/client.py +452 -452
- label_studio_sdk/import_storage/s3s/client.py +735 -735
- label_studio_sdk/jwt_settings/client.py +10 -10
- label_studio_sdk/ml/client.py +118 -118
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
- label_studio_sdk/model_providers/client.py +181 -181
- label_studio_sdk/organizations/members/client.py +8 -8
- label_studio_sdk/predictions/client.py +60 -60
- label_studio_sdk/projects/__init__.py +30 -1
- label_studio_sdk/projects/assignments/__init__.py +33 -0
- label_studio_sdk/projects/assignments/client.py +764 -0
- label_studio_sdk/projects/assignments/types/__init__.py +35 -0
- label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
- label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
- label_studio_sdk/projects/client.py +441 -425
- label_studio_sdk/projects/exports/client.py +55 -55
- label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
- label_studio_sdk/prompts/client.py +211 -211
- label_studio_sdk/prompts/runs/client.py +33 -33
- label_studio_sdk/prompts/versions/client.py +72 -72
- label_studio_sdk/tasks/client.py +174 -174
- label_studio_sdk/types/__init__.py +4 -0
- label_studio_sdk/types/all_roles_project_list.py +94 -94
- label_studio_sdk/types/annotation.py +35 -35
- label_studio_sdk/types/annotation_request.py +27 -27
- label_studio_sdk/types/azure_blob_export_storage.py +29 -29
- label_studio_sdk/types/azure_blob_import_storage.py +33 -33
- label_studio_sdk/types/batch_failed_predictions.py +1 -1
- label_studio_sdk/types/billing_checks.py +14 -14
- label_studio_sdk/types/billing_flags.py +16 -16
- label_studio_sdk/types/blueprint_list.py +7 -8
- label_studio_sdk/types/child_filter.py +11 -10
- label_studio_sdk/types/comment.py +15 -15
- label_studio_sdk/types/comment_request.py +7 -8
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
- label_studio_sdk/types/converted_format.py +1 -1
- label_studio_sdk/types/converted_format_request.py +1 -1
- label_studio_sdk/types/export.py +8 -8
- label_studio_sdk/types/file_upload.py +3 -2
- label_studio_sdk/types/filter.py +10 -9
- label_studio_sdk/types/filter_group.py +4 -3
- label_studio_sdk/types/gcs_export_storage.py +23 -23
- label_studio_sdk/types/gcs_import_storage.py +27 -27
- label_studio_sdk/types/import_api_request.py +26 -26
- label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
- label_studio_sdk/types/local_files_export_storage.py +23 -23
- label_studio_sdk/types/local_files_import_storage.py +26 -26
- label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
- label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
- label_studio_sdk/types/lse_export_create.py +12 -12
- label_studio_sdk/types/lse_fields.py +14 -14
- label_studio_sdk/types/lse_organization.py +17 -17
- label_studio_sdk/types/lse_organization_member_list.py +1 -1
- label_studio_sdk/types/lse_project_create.py +72 -72
- label_studio_sdk/types/lse_project_update.py +89 -89
- label_studio_sdk/types/lse_s3export_storage.py +46 -46
- label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
- label_studio_sdk/types/lse_s3import_storage.py +53 -53
- label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
- label_studio_sdk/types/lse_task.py +49 -49
- label_studio_sdk/types/lse_task_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_filter_options.py +14 -14
- label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
- label_studio_sdk/types/lse_task_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
- label_studio_sdk/types/lse_user.py +13 -13
- label_studio_sdk/types/lse_user_api.py +11 -11
- label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
- label_studio_sdk/types/lseapi_token_create.py +1 -1
- label_studio_sdk/types/lseapi_token_list.py +1 -1
- label_studio_sdk/types/lsejwt_settings.py +5 -5
- label_studio_sdk/types/ml_backend.py +27 -28
- label_studio_sdk/types/model_interface.py +12 -12
- label_studio_sdk/types/model_interface_request.py +7 -8
- label_studio_sdk/types/model_interface_serializer_get.py +13 -13
- label_studio_sdk/types/model_provider_connection.py +34 -34
- label_studio_sdk/types/model_provider_connection_request.py +15 -14
- label_studio_sdk/types/model_run.py +12 -12
- label_studio_sdk/types/organization_billing.py +1 -1
- label_studio_sdk/types/organization_id.py +2 -2
- label_studio_sdk/types/organization_invite.py +1 -1
- label_studio_sdk/types/organization_member.py +8 -9
- label_studio_sdk/types/organization_membership.py +2 -1
- label_studio_sdk/types/pause.py +23 -23
- label_studio_sdk/types/prediction.py +21 -21
- label_studio_sdk/types/prediction_request.py +16 -16
- label_studio_sdk/types/project.py +72 -72
- label_studio_sdk/types/project_import.py +21 -21
- label_studio_sdk/types/redis_export_storage.py +34 -34
- label_studio_sdk/types/redis_import_storage.py +37 -37
- label_studio_sdk/types/refined_prompt_response.py +11 -11
- label_studio_sdk/types/review_settings.py +29 -30
- label_studio_sdk/types/review_settings_request.py +29 -30
- label_studio_sdk/types/s3export_storage.py +45 -45
- label_studio_sdk/types/s3import_storage.py +44 -44
- label_studio_sdk/types/selected_items_request.py +1 -1
- label_studio_sdk/types/serialization_options.py +10 -10
- label_studio_sdk/types/serialization_options_request.py +10 -10
- label_studio_sdk/types/task_assignment.py +43 -0
- label_studio_sdk/types/third_party_model_version.py +11 -11
- label_studio_sdk/types/third_party_model_version_request.py +6 -7
- label_studio_sdk/types/type_enum.py +5 -0
- label_studio_sdk/types/user_simple.py +3 -3
- label_studio_sdk/types/user_simple_request.py +1 -1
- label_studio_sdk/types/version_response.py +19 -20
- label_studio_sdk/types/view.py +8 -8
- label_studio_sdk/types/webhook.py +16 -16
- label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
- label_studio_sdk/types/workspace.py +10 -11
- label_studio_sdk/users/client.py +160 -160
- label_studio_sdk/views/client.py +164 -164
- label_studio_sdk/webhooks/client.py +183 -183
- label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
- label_studio_sdk/workspaces/client.py +40 -40
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +167 -149
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
|
@@ -95,12 +95,12 @@ class CommentsClient:
|
|
|
95
95
|
self,
|
|
96
96
|
*,
|
|
97
97
|
expand_created_by: typing.Optional[bool] = None,
|
|
98
|
-
|
|
98
|
+
annotation: typing.Optional[int] = OMIT,
|
|
99
99
|
classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
100
|
-
text: typing.Optional[str] = OMIT,
|
|
101
|
-
is_resolved: typing.Optional[bool] = OMIT,
|
|
102
100
|
draft: typing.Optional[int] = OMIT,
|
|
103
|
-
|
|
101
|
+
is_resolved: typing.Optional[bool] = OMIT,
|
|
102
|
+
region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
103
|
+
text: typing.Optional[str] = OMIT,
|
|
104
104
|
request_options: typing.Optional[RequestOptions] = None,
|
|
105
105
|
) -> MaybeExpandedComment:
|
|
106
106
|
"""
|
|
@@ -111,19 +111,19 @@ class CommentsClient:
|
|
|
111
111
|
expand_created_by : typing.Optional[bool]
|
|
112
112
|
Expand the created_by field
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
annotation : typing.Optional[int]
|
|
115
115
|
|
|
116
116
|
classifications : typing.Optional[typing.Optional[typing.Any]]
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
Reviewer or annotator comment
|
|
118
|
+
draft : typing.Optional[int]
|
|
120
119
|
|
|
121
120
|
is_resolved : typing.Optional[bool]
|
|
122
121
|
True if the comment is resolved
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
region_ref : typing.Optional[typing.Optional[typing.Any]]
|
|
125
124
|
|
|
126
|
-
|
|
125
|
+
text : typing.Optional[str]
|
|
126
|
+
Reviewer or annotator comment
|
|
127
127
|
|
|
128
128
|
request_options : typing.Optional[RequestOptions]
|
|
129
129
|
Request-specific configuration.
|
|
@@ -149,12 +149,12 @@ class CommentsClient:
|
|
|
149
149
|
"expand_created_by": expand_created_by,
|
|
150
150
|
},
|
|
151
151
|
json={
|
|
152
|
-
"
|
|
152
|
+
"annotation": annotation,
|
|
153
153
|
"classifications": classifications,
|
|
154
|
-
"text": text,
|
|
155
|
-
"is_resolved": is_resolved,
|
|
156
154
|
"draft": draft,
|
|
157
|
-
"
|
|
155
|
+
"is_resolved": is_resolved,
|
|
156
|
+
"region_ref": region_ref,
|
|
157
|
+
"text": text,
|
|
158
158
|
},
|
|
159
159
|
request_options=request_options,
|
|
160
160
|
omit=OMIT,
|
|
@@ -173,6 +173,68 @@ class CommentsClient:
|
|
|
173
173
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
174
174
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
175
175
|
|
|
176
|
+
def export(
|
|
177
|
+
self,
|
|
178
|
+
*,
|
|
179
|
+
annotation: typing.Optional[int] = None,
|
|
180
|
+
annotators: typing.Optional[str] = None,
|
|
181
|
+
draft: typing.Optional[int] = None,
|
|
182
|
+
expand_created_by: typing.Optional[bool] = None,
|
|
183
|
+
projects: typing.Optional[str] = None,
|
|
184
|
+
tz: typing.Optional[str] = None,
|
|
185
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
186
|
+
) -> typing.Iterator[bytes]:
|
|
187
|
+
"""
|
|
188
|
+
Export comments to CSV file
|
|
189
|
+
|
|
190
|
+
Parameters
|
|
191
|
+
----------
|
|
192
|
+
annotation : typing.Optional[int]
|
|
193
|
+
|
|
194
|
+
annotators : typing.Optional[str]
|
|
195
|
+
|
|
196
|
+
draft : typing.Optional[int]
|
|
197
|
+
|
|
198
|
+
expand_created_by : typing.Optional[bool]
|
|
199
|
+
|
|
200
|
+
projects : typing.Optional[str]
|
|
201
|
+
|
|
202
|
+
tz : typing.Optional[str]
|
|
203
|
+
Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
|
|
204
|
+
|
|
205
|
+
request_options : typing.Optional[RequestOptions]
|
|
206
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
207
|
+
|
|
208
|
+
Yields
|
|
209
|
+
------
|
|
210
|
+
typing.Iterator[bytes]
|
|
211
|
+
CSV file with comments
|
|
212
|
+
"""
|
|
213
|
+
with self._client_wrapper.httpx_client.stream(
|
|
214
|
+
"api/comments/export/",
|
|
215
|
+
method="GET",
|
|
216
|
+
params={
|
|
217
|
+
"annotation": annotation,
|
|
218
|
+
"annotators": annotators,
|
|
219
|
+
"draft": draft,
|
|
220
|
+
"expand_created_by": expand_created_by,
|
|
221
|
+
"projects": projects,
|
|
222
|
+
"tz": tz,
|
|
223
|
+
},
|
|
224
|
+
request_options=request_options,
|
|
225
|
+
) as _response:
|
|
226
|
+
try:
|
|
227
|
+
if 200 <= _response.status_code < 300:
|
|
228
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
229
|
+
for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
|
|
230
|
+
yield _chunk
|
|
231
|
+
return
|
|
232
|
+
_response.read()
|
|
233
|
+
_response_json = _response.json()
|
|
234
|
+
except JSONDecodeError:
|
|
235
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
236
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
237
|
+
|
|
176
238
|
def get(
|
|
177
239
|
self,
|
|
178
240
|
id: str,
|
|
@@ -287,12 +349,12 @@ class CommentsClient:
|
|
|
287
349
|
id: str,
|
|
288
350
|
*,
|
|
289
351
|
expand_created_by: typing.Optional[bool] = None,
|
|
290
|
-
|
|
352
|
+
annotation: typing.Optional[int] = OMIT,
|
|
291
353
|
classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
292
|
-
text: typing.Optional[str] = OMIT,
|
|
293
|
-
is_resolved: typing.Optional[bool] = OMIT,
|
|
294
354
|
draft: typing.Optional[int] = OMIT,
|
|
295
|
-
|
|
355
|
+
is_resolved: typing.Optional[bool] = OMIT,
|
|
356
|
+
region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
357
|
+
text: typing.Optional[str] = OMIT,
|
|
296
358
|
request_options: typing.Optional[RequestOptions] = None,
|
|
297
359
|
) -> MaybeExpandedComment:
|
|
298
360
|
"""
|
|
@@ -305,19 +367,19 @@ class CommentsClient:
|
|
|
305
367
|
expand_created_by : typing.Optional[bool]
|
|
306
368
|
Expand the created_by field
|
|
307
369
|
|
|
308
|
-
|
|
370
|
+
annotation : typing.Optional[int]
|
|
309
371
|
|
|
310
372
|
classifications : typing.Optional[typing.Optional[typing.Any]]
|
|
311
373
|
|
|
312
|
-
|
|
313
|
-
Reviewer or annotator comment
|
|
374
|
+
draft : typing.Optional[int]
|
|
314
375
|
|
|
315
376
|
is_resolved : typing.Optional[bool]
|
|
316
377
|
True if the comment is resolved
|
|
317
378
|
|
|
318
|
-
|
|
379
|
+
region_ref : typing.Optional[typing.Optional[typing.Any]]
|
|
319
380
|
|
|
320
|
-
|
|
381
|
+
text : typing.Optional[str]
|
|
382
|
+
Reviewer or annotator comment
|
|
321
383
|
|
|
322
384
|
request_options : typing.Optional[RequestOptions]
|
|
323
385
|
Request-specific configuration.
|
|
@@ -345,12 +407,12 @@ class CommentsClient:
|
|
|
345
407
|
"expand_created_by": expand_created_by,
|
|
346
408
|
},
|
|
347
409
|
json={
|
|
348
|
-
"
|
|
410
|
+
"annotation": annotation,
|
|
349
411
|
"classifications": classifications,
|
|
350
|
-
"text": text,
|
|
351
|
-
"is_resolved": is_resolved,
|
|
352
412
|
"draft": draft,
|
|
353
|
-
"
|
|
413
|
+
"is_resolved": is_resolved,
|
|
414
|
+
"region_ref": region_ref,
|
|
415
|
+
"text": text,
|
|
354
416
|
},
|
|
355
417
|
headers={
|
|
356
418
|
"content-type": "application/json",
|
|
@@ -372,68 +434,6 @@ class CommentsClient:
|
|
|
372
434
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
373
435
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
374
436
|
|
|
375
|
-
def export(
|
|
376
|
-
self,
|
|
377
|
-
*,
|
|
378
|
-
annotation: typing.Optional[int] = None,
|
|
379
|
-
annotators: typing.Optional[str] = None,
|
|
380
|
-
draft: typing.Optional[int] = None,
|
|
381
|
-
expand_created_by: typing.Optional[bool] = None,
|
|
382
|
-
projects: typing.Optional[str] = None,
|
|
383
|
-
tz: typing.Optional[str] = None,
|
|
384
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
385
|
-
) -> typing.Iterator[bytes]:
|
|
386
|
-
"""
|
|
387
|
-
Export comments to CSV file
|
|
388
|
-
|
|
389
|
-
Parameters
|
|
390
|
-
----------
|
|
391
|
-
annotation : typing.Optional[int]
|
|
392
|
-
|
|
393
|
-
annotators : typing.Optional[str]
|
|
394
|
-
|
|
395
|
-
draft : typing.Optional[int]
|
|
396
|
-
|
|
397
|
-
expand_created_by : typing.Optional[bool]
|
|
398
|
-
|
|
399
|
-
projects : typing.Optional[str]
|
|
400
|
-
|
|
401
|
-
tz : typing.Optional[str]
|
|
402
|
-
Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
|
|
403
|
-
|
|
404
|
-
request_options : typing.Optional[RequestOptions]
|
|
405
|
-
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
406
|
-
|
|
407
|
-
Yields
|
|
408
|
-
------
|
|
409
|
-
typing.Iterator[bytes]
|
|
410
|
-
CSV file with comments
|
|
411
|
-
"""
|
|
412
|
-
with self._client_wrapper.httpx_client.stream(
|
|
413
|
-
"api/comments/export/",
|
|
414
|
-
method="GET",
|
|
415
|
-
params={
|
|
416
|
-
"annotation": annotation,
|
|
417
|
-
"annotators": annotators,
|
|
418
|
-
"draft": draft,
|
|
419
|
-
"expand_created_by": expand_created_by,
|
|
420
|
-
"projects": projects,
|
|
421
|
-
"tz": tz,
|
|
422
|
-
},
|
|
423
|
-
request_options=request_options,
|
|
424
|
-
) as _response:
|
|
425
|
-
try:
|
|
426
|
-
if 200 <= _response.status_code < 300:
|
|
427
|
-
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
428
|
-
for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
|
|
429
|
-
yield _chunk
|
|
430
|
-
return
|
|
431
|
-
_response.read()
|
|
432
|
-
_response_json = _response.json()
|
|
433
|
-
except JSONDecodeError:
|
|
434
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
435
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
436
|
-
|
|
437
437
|
|
|
438
438
|
class AsyncCommentsClient:
|
|
439
439
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -524,12 +524,12 @@ class AsyncCommentsClient:
|
|
|
524
524
|
self,
|
|
525
525
|
*,
|
|
526
526
|
expand_created_by: typing.Optional[bool] = None,
|
|
527
|
-
|
|
527
|
+
annotation: typing.Optional[int] = OMIT,
|
|
528
528
|
classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
529
|
-
text: typing.Optional[str] = OMIT,
|
|
530
|
-
is_resolved: typing.Optional[bool] = OMIT,
|
|
531
529
|
draft: typing.Optional[int] = OMIT,
|
|
532
|
-
|
|
530
|
+
is_resolved: typing.Optional[bool] = OMIT,
|
|
531
|
+
region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
532
|
+
text: typing.Optional[str] = OMIT,
|
|
533
533
|
request_options: typing.Optional[RequestOptions] = None,
|
|
534
534
|
) -> MaybeExpandedComment:
|
|
535
535
|
"""
|
|
@@ -540,19 +540,19 @@ class AsyncCommentsClient:
|
|
|
540
540
|
expand_created_by : typing.Optional[bool]
|
|
541
541
|
Expand the created_by field
|
|
542
542
|
|
|
543
|
-
|
|
543
|
+
annotation : typing.Optional[int]
|
|
544
544
|
|
|
545
545
|
classifications : typing.Optional[typing.Optional[typing.Any]]
|
|
546
546
|
|
|
547
|
-
|
|
548
|
-
Reviewer or annotator comment
|
|
547
|
+
draft : typing.Optional[int]
|
|
549
548
|
|
|
550
549
|
is_resolved : typing.Optional[bool]
|
|
551
550
|
True if the comment is resolved
|
|
552
551
|
|
|
553
|
-
|
|
552
|
+
region_ref : typing.Optional[typing.Optional[typing.Any]]
|
|
554
553
|
|
|
555
|
-
|
|
554
|
+
text : typing.Optional[str]
|
|
555
|
+
Reviewer or annotator comment
|
|
556
556
|
|
|
557
557
|
request_options : typing.Optional[RequestOptions]
|
|
558
558
|
Request-specific configuration.
|
|
@@ -586,12 +586,12 @@ class AsyncCommentsClient:
|
|
|
586
586
|
"expand_created_by": expand_created_by,
|
|
587
587
|
},
|
|
588
588
|
json={
|
|
589
|
-
"
|
|
589
|
+
"annotation": annotation,
|
|
590
590
|
"classifications": classifications,
|
|
591
|
-
"text": text,
|
|
592
|
-
"is_resolved": is_resolved,
|
|
593
591
|
"draft": draft,
|
|
594
|
-
"
|
|
592
|
+
"is_resolved": is_resolved,
|
|
593
|
+
"region_ref": region_ref,
|
|
594
|
+
"text": text,
|
|
595
595
|
},
|
|
596
596
|
request_options=request_options,
|
|
597
597
|
omit=OMIT,
|
|
@@ -610,6 +610,68 @@ class AsyncCommentsClient:
|
|
|
610
610
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
611
611
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
612
612
|
|
|
613
|
+
async def export(
|
|
614
|
+
self,
|
|
615
|
+
*,
|
|
616
|
+
annotation: typing.Optional[int] = None,
|
|
617
|
+
annotators: typing.Optional[str] = None,
|
|
618
|
+
draft: typing.Optional[int] = None,
|
|
619
|
+
expand_created_by: typing.Optional[bool] = None,
|
|
620
|
+
projects: typing.Optional[str] = None,
|
|
621
|
+
tz: typing.Optional[str] = None,
|
|
622
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
623
|
+
) -> typing.AsyncIterator[bytes]:
|
|
624
|
+
"""
|
|
625
|
+
Export comments to CSV file
|
|
626
|
+
|
|
627
|
+
Parameters
|
|
628
|
+
----------
|
|
629
|
+
annotation : typing.Optional[int]
|
|
630
|
+
|
|
631
|
+
annotators : typing.Optional[str]
|
|
632
|
+
|
|
633
|
+
draft : typing.Optional[int]
|
|
634
|
+
|
|
635
|
+
expand_created_by : typing.Optional[bool]
|
|
636
|
+
|
|
637
|
+
projects : typing.Optional[str]
|
|
638
|
+
|
|
639
|
+
tz : typing.Optional[str]
|
|
640
|
+
Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
|
|
641
|
+
|
|
642
|
+
request_options : typing.Optional[RequestOptions]
|
|
643
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
644
|
+
|
|
645
|
+
Yields
|
|
646
|
+
------
|
|
647
|
+
typing.AsyncIterator[bytes]
|
|
648
|
+
CSV file with comments
|
|
649
|
+
"""
|
|
650
|
+
async with self._client_wrapper.httpx_client.stream(
|
|
651
|
+
"api/comments/export/",
|
|
652
|
+
method="GET",
|
|
653
|
+
params={
|
|
654
|
+
"annotation": annotation,
|
|
655
|
+
"annotators": annotators,
|
|
656
|
+
"draft": draft,
|
|
657
|
+
"expand_created_by": expand_created_by,
|
|
658
|
+
"projects": projects,
|
|
659
|
+
"tz": tz,
|
|
660
|
+
},
|
|
661
|
+
request_options=request_options,
|
|
662
|
+
) as _response:
|
|
663
|
+
try:
|
|
664
|
+
if 200 <= _response.status_code < 300:
|
|
665
|
+
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
666
|
+
async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
|
|
667
|
+
yield _chunk
|
|
668
|
+
return
|
|
669
|
+
await _response.aread()
|
|
670
|
+
_response_json = _response.json()
|
|
671
|
+
except JSONDecodeError:
|
|
672
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
673
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
674
|
+
|
|
613
675
|
async def get(
|
|
614
676
|
self,
|
|
615
677
|
id: str,
|
|
@@ -740,12 +802,12 @@ class AsyncCommentsClient:
|
|
|
740
802
|
id: str,
|
|
741
803
|
*,
|
|
742
804
|
expand_created_by: typing.Optional[bool] = None,
|
|
743
|
-
|
|
805
|
+
annotation: typing.Optional[int] = OMIT,
|
|
744
806
|
classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
745
|
-
text: typing.Optional[str] = OMIT,
|
|
746
|
-
is_resolved: typing.Optional[bool] = OMIT,
|
|
747
807
|
draft: typing.Optional[int] = OMIT,
|
|
748
|
-
|
|
808
|
+
is_resolved: typing.Optional[bool] = OMIT,
|
|
809
|
+
region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
|
|
810
|
+
text: typing.Optional[str] = OMIT,
|
|
749
811
|
request_options: typing.Optional[RequestOptions] = None,
|
|
750
812
|
) -> MaybeExpandedComment:
|
|
751
813
|
"""
|
|
@@ -758,19 +820,19 @@ class AsyncCommentsClient:
|
|
|
758
820
|
expand_created_by : typing.Optional[bool]
|
|
759
821
|
Expand the created_by field
|
|
760
822
|
|
|
761
|
-
|
|
823
|
+
annotation : typing.Optional[int]
|
|
762
824
|
|
|
763
825
|
classifications : typing.Optional[typing.Optional[typing.Any]]
|
|
764
826
|
|
|
765
|
-
|
|
766
|
-
Reviewer or annotator comment
|
|
827
|
+
draft : typing.Optional[int]
|
|
767
828
|
|
|
768
829
|
is_resolved : typing.Optional[bool]
|
|
769
830
|
True if the comment is resolved
|
|
770
831
|
|
|
771
|
-
|
|
832
|
+
region_ref : typing.Optional[typing.Optional[typing.Any]]
|
|
772
833
|
|
|
773
|
-
|
|
834
|
+
text : typing.Optional[str]
|
|
835
|
+
Reviewer or annotator comment
|
|
774
836
|
|
|
775
837
|
request_options : typing.Optional[RequestOptions]
|
|
776
838
|
Request-specific configuration.
|
|
@@ -806,12 +868,12 @@ class AsyncCommentsClient:
|
|
|
806
868
|
"expand_created_by": expand_created_by,
|
|
807
869
|
},
|
|
808
870
|
json={
|
|
809
|
-
"
|
|
871
|
+
"annotation": annotation,
|
|
810
872
|
"classifications": classifications,
|
|
811
|
-
"text": text,
|
|
812
|
-
"is_resolved": is_resolved,
|
|
813
873
|
"draft": draft,
|
|
814
|
-
"
|
|
874
|
+
"is_resolved": is_resolved,
|
|
875
|
+
"region_ref": region_ref,
|
|
876
|
+
"text": text,
|
|
815
877
|
},
|
|
816
878
|
headers={
|
|
817
879
|
"content-type": "application/json",
|
|
@@ -832,65 +894,3 @@ class AsyncCommentsClient:
|
|
|
832
894
|
except JSONDecodeError:
|
|
833
895
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
834
896
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
835
|
-
|
|
836
|
-
async def export(
|
|
837
|
-
self,
|
|
838
|
-
*,
|
|
839
|
-
annotation: typing.Optional[int] = None,
|
|
840
|
-
annotators: typing.Optional[str] = None,
|
|
841
|
-
draft: typing.Optional[int] = None,
|
|
842
|
-
expand_created_by: typing.Optional[bool] = None,
|
|
843
|
-
projects: typing.Optional[str] = None,
|
|
844
|
-
tz: typing.Optional[str] = None,
|
|
845
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
846
|
-
) -> typing.AsyncIterator[bytes]:
|
|
847
|
-
"""
|
|
848
|
-
Export comments to CSV file
|
|
849
|
-
|
|
850
|
-
Parameters
|
|
851
|
-
----------
|
|
852
|
-
annotation : typing.Optional[int]
|
|
853
|
-
|
|
854
|
-
annotators : typing.Optional[str]
|
|
855
|
-
|
|
856
|
-
draft : typing.Optional[int]
|
|
857
|
-
|
|
858
|
-
expand_created_by : typing.Optional[bool]
|
|
859
|
-
|
|
860
|
-
projects : typing.Optional[str]
|
|
861
|
-
|
|
862
|
-
tz : typing.Optional[str]
|
|
863
|
-
Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
|
|
864
|
-
|
|
865
|
-
request_options : typing.Optional[RequestOptions]
|
|
866
|
-
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
867
|
-
|
|
868
|
-
Yields
|
|
869
|
-
------
|
|
870
|
-
typing.AsyncIterator[bytes]
|
|
871
|
-
CSV file with comments
|
|
872
|
-
"""
|
|
873
|
-
async with self._client_wrapper.httpx_client.stream(
|
|
874
|
-
"api/comments/export/",
|
|
875
|
-
method="GET",
|
|
876
|
-
params={
|
|
877
|
-
"annotation": annotation,
|
|
878
|
-
"annotators": annotators,
|
|
879
|
-
"draft": draft,
|
|
880
|
-
"expand_created_by": expand_created_by,
|
|
881
|
-
"projects": projects,
|
|
882
|
-
"tz": tz,
|
|
883
|
-
},
|
|
884
|
-
request_options=request_options,
|
|
885
|
-
) as _response:
|
|
886
|
-
try:
|
|
887
|
-
if 200 <= _response.status_code < 300:
|
|
888
|
-
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
|
|
889
|
-
async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
|
|
890
|
-
yield _chunk
|
|
891
|
-
return
|
|
892
|
-
await _response.aread()
|
|
893
|
-
_response_json = _response.json()
|
|
894
|
-
except JSONDecodeError:
|
|
895
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
896
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|