label-studio-sdk 1.0.5__py3-none-any.whl → 1.0.7__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.
- label_studio_sdk/__init__.py +70 -0
- label_studio_sdk/_extensions/eval/categorical.py +83 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +35 -17
- label_studio_sdk/annotations/__init__.py +3 -0
- label_studio_sdk/annotations/client.py +109 -0
- label_studio_sdk/annotations/types/__init__.py +5 -0
- label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +29 -0
- label_studio_sdk/base_client.py +9 -0
- label_studio_sdk/comments/__init__.py +2 -0
- label_studio_sdk/comments/client.py +512 -0
- label_studio_sdk/converter/converter.py +2 -0
- label_studio_sdk/converter/imports/coco.py +14 -13
- label_studio_sdk/converter/utils.py +72 -3
- label_studio_sdk/core/client_wrapper.py +1 -1
- label_studio_sdk/files/client.py +26 -16
- label_studio_sdk/label_interface/interface.py +38 -5
- label_studio_sdk/model_providers/__init__.py +2 -0
- label_studio_sdk/model_providers/client.py +190 -0
- label_studio_sdk/projects/client.py +32 -16
- label_studio_sdk/projects/exports/client.py +133 -40
- label_studio_sdk/prompts/__init__.py +21 -0
- label_studio_sdk/prompts/client.py +862 -0
- label_studio_sdk/prompts/indicators/__init__.py +2 -0
- label_studio_sdk/prompts/indicators/client.py +194 -0
- label_studio_sdk/prompts/runs/__init__.py +5 -0
- label_studio_sdk/prompts/runs/client.py +354 -0
- label_studio_sdk/prompts/runs/types/__init__.py +5 -0
- label_studio_sdk/prompts/runs/types/runs_list_request_project_subset.py +5 -0
- label_studio_sdk/prompts/types/__init__.py +15 -0
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +42 -0
- label_studio_sdk/prompts/types/prompts_batch_failed_predictions_response.py +29 -0
- label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +62 -0
- label_studio_sdk/prompts/types/prompts_batch_predictions_response.py +29 -0
- label_studio_sdk/prompts/versions/__init__.py +2 -0
- label_studio_sdk/prompts/versions/client.py +921 -0
- label_studio_sdk/types/__init__.py +52 -0
- label_studio_sdk/types/comment.py +39 -0
- label_studio_sdk/types/comment_created_by.py +5 -0
- label_studio_sdk/types/inference_run.py +43 -0
- label_studio_sdk/types/inference_run_created_by.py +5 -0
- label_studio_sdk/types/inference_run_organization.py +5 -0
- label_studio_sdk/types/inference_run_project_subset.py +5 -0
- label_studio_sdk/types/inference_run_status.py +7 -0
- label_studio_sdk/types/key_indicator_value.py +30 -0
- label_studio_sdk/types/key_indicators.py +7 -0
- label_studio_sdk/types/key_indicators_item.py +51 -0
- label_studio_sdk/types/key_indicators_item_additional_kpis_item.py +37 -0
- label_studio_sdk/types/key_indicators_item_extra_kpis_item.py +37 -0
- label_studio_sdk/types/model_provider_connection.py +41 -0
- label_studio_sdk/types/model_provider_connection_created_by.py +5 -0
- label_studio_sdk/types/model_provider_connection_organization.py +5 -0
- label_studio_sdk/types/model_provider_connection_provider.py +5 -0
- label_studio_sdk/types/model_provider_connection_scope.py +5 -0
- label_studio_sdk/types/prompt.py +79 -0
- label_studio_sdk/types/prompt_created_by.py +5 -0
- label_studio_sdk/types/prompt_organization.py +5 -0
- label_studio_sdk/types/prompt_version.py +41 -0
- label_studio_sdk/types/prompt_version_created_by.py +5 -0
- label_studio_sdk/types/prompt_version_organization.py +5 -0
- label_studio_sdk/types/prompt_version_provider.py +5 -0
- label_studio_sdk/types/refined_prompt_response.py +64 -0
- label_studio_sdk/types/refined_prompt_response_refinement_status.py +7 -0
- label_studio_sdk/webhooks/client.py +245 -36
- label_studio_sdk/workspaces/client.py +20 -20
- label_studio_sdk-1.0.7.dist-info/LICENSE +201 -0
- {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.7.dist-info}/METADATA +17 -3
- {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.7.dist-info}/RECORD +68 -19
- {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.7.dist-info}/WHEEL +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
5
|
from json.decoder import JSONDecodeError
|
|
5
6
|
|
|
@@ -8,9 +9,15 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
8
9
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
9
10
|
from ...core.pydantic_utilities import pydantic_v1
|
|
10
11
|
from ...core.request_options import RequestOptions
|
|
12
|
+
from ...types.annotation_filter_options import AnnotationFilterOptions
|
|
13
|
+
from ...types.converted_format import ConvertedFormat
|
|
11
14
|
from ...types.export import Export
|
|
12
15
|
from ...types.export_convert import ExportConvert
|
|
13
16
|
from ...types.export_create import ExportCreate
|
|
17
|
+
from ...types.export_create_status import ExportCreateStatus
|
|
18
|
+
from ...types.serialization_options import SerializationOptions
|
|
19
|
+
from ...types.task_filter_options import TaskFilterOptions
|
|
20
|
+
from ...types.user_simple import UserSimple
|
|
14
21
|
|
|
15
22
|
# this is used as the default value for optional parameters
|
|
16
23
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -199,7 +206,22 @@ class ExportsClient:
|
|
|
199
206
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
200
207
|
|
|
201
208
|
def create(
|
|
202
|
-
self,
|
|
209
|
+
self,
|
|
210
|
+
id_: int,
|
|
211
|
+
*,
|
|
212
|
+
title: typing.Optional[str] = OMIT,
|
|
213
|
+
id: typing.Optional[int] = OMIT,
|
|
214
|
+
created_by: typing.Optional[UserSimple] = OMIT,
|
|
215
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
216
|
+
finished_at: typing.Optional[dt.datetime] = OMIT,
|
|
217
|
+
status: typing.Optional[ExportCreateStatus] = OMIT,
|
|
218
|
+
md5: typing.Optional[str] = OMIT,
|
|
219
|
+
counters: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
220
|
+
converted_formats: typing.Optional[typing.Sequence[ConvertedFormat]] = OMIT,
|
|
221
|
+
task_filter_options: typing.Optional[TaskFilterOptions] = OMIT,
|
|
222
|
+
annotation_filter_options: typing.Optional[AnnotationFilterOptions] = OMIT,
|
|
223
|
+
serialization_options: typing.Optional[SerializationOptions] = OMIT,
|
|
224
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
203
225
|
) -> ExportCreate:
|
|
204
226
|
"""
|
|
205
227
|
Create a new export request to start a background task and generate an export file (snapshot) for a specific project by ID. The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../list).
|
|
@@ -210,10 +232,34 @@ class ExportsClient:
|
|
|
210
232
|
|
|
211
233
|
Parameters
|
|
212
234
|
----------
|
|
213
|
-
|
|
235
|
+
id_ : int
|
|
214
236
|
A unique integer value identifying this project.
|
|
215
237
|
|
|
216
|
-
|
|
238
|
+
title : typing.Optional[str]
|
|
239
|
+
|
|
240
|
+
id : typing.Optional[int]
|
|
241
|
+
|
|
242
|
+
created_by : typing.Optional[UserSimple]
|
|
243
|
+
|
|
244
|
+
created_at : typing.Optional[dt.datetime]
|
|
245
|
+
Creation time
|
|
246
|
+
|
|
247
|
+
finished_at : typing.Optional[dt.datetime]
|
|
248
|
+
Complete or fail time
|
|
249
|
+
|
|
250
|
+
status : typing.Optional[ExportCreateStatus]
|
|
251
|
+
|
|
252
|
+
md5 : typing.Optional[str]
|
|
253
|
+
|
|
254
|
+
counters : typing.Optional[typing.Dict[str, typing.Any]]
|
|
255
|
+
|
|
256
|
+
converted_formats : typing.Optional[typing.Sequence[ConvertedFormat]]
|
|
257
|
+
|
|
258
|
+
task_filter_options : typing.Optional[TaskFilterOptions]
|
|
259
|
+
|
|
260
|
+
annotation_filter_options : typing.Optional[AnnotationFilterOptions]
|
|
261
|
+
|
|
262
|
+
serialization_options : typing.Optional[SerializationOptions]
|
|
217
263
|
|
|
218
264
|
request_options : typing.Optional[RequestOptions]
|
|
219
265
|
Request-specific configuration.
|
|
@@ -225,21 +271,32 @@ class ExportsClient:
|
|
|
225
271
|
|
|
226
272
|
Examples
|
|
227
273
|
--------
|
|
228
|
-
from label_studio_sdk import ExportCreate
|
|
229
274
|
from label_studio_sdk.client import LabelStudio
|
|
230
275
|
|
|
231
276
|
client = LabelStudio(
|
|
232
277
|
api_key="YOUR_API_KEY",
|
|
233
278
|
)
|
|
234
279
|
client.projects.exports.create(
|
|
235
|
-
|
|
236
|
-
request=ExportCreate(),
|
|
280
|
+
id_=1,
|
|
237
281
|
)
|
|
238
282
|
"""
|
|
239
283
|
_response = self._client_wrapper.httpx_client.request(
|
|
240
|
-
f"api/projects/{jsonable_encoder(
|
|
284
|
+
f"api/projects/{jsonable_encoder(id_)}/exports/",
|
|
241
285
|
method="POST",
|
|
242
|
-
json=
|
|
286
|
+
json={
|
|
287
|
+
"title": title,
|
|
288
|
+
"id": id,
|
|
289
|
+
"created_by": created_by,
|
|
290
|
+
"created_at": created_at,
|
|
291
|
+
"finished_at": finished_at,
|
|
292
|
+
"status": status,
|
|
293
|
+
"md5": md5,
|
|
294
|
+
"counters": counters,
|
|
295
|
+
"converted_formats": converted_formats,
|
|
296
|
+
"task_filter_options": task_filter_options,
|
|
297
|
+
"annotation_filter_options": annotation_filter_options,
|
|
298
|
+
"serialization_options": serialization_options,
|
|
299
|
+
},
|
|
243
300
|
request_options=request_options,
|
|
244
301
|
omit=OMIT,
|
|
245
302
|
)
|
|
@@ -347,12 +404,7 @@ class ExportsClient:
|
|
|
347
404
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
348
405
|
|
|
349
406
|
def convert(
|
|
350
|
-
self,
|
|
351
|
-
id: int,
|
|
352
|
-
export_pk: str,
|
|
353
|
-
*,
|
|
354
|
-
request: ExportConvert,
|
|
355
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
407
|
+
self, id: int, export_pk: str, *, export_type: str, request_options: typing.Optional[RequestOptions] = None
|
|
356
408
|
) -> ExportConvert:
|
|
357
409
|
"""
|
|
358
410
|
You can use this to convert an export snapshot into the selected format.
|
|
@@ -371,7 +423,8 @@ class ExportsClient:
|
|
|
371
423
|
export_pk : str
|
|
372
424
|
Primary key identifying the export file.
|
|
373
425
|
|
|
374
|
-
|
|
426
|
+
export_type : str
|
|
427
|
+
Export file format.
|
|
375
428
|
|
|
376
429
|
request_options : typing.Optional[RequestOptions]
|
|
377
430
|
Request-specific configuration.
|
|
@@ -383,7 +436,6 @@ class ExportsClient:
|
|
|
383
436
|
|
|
384
437
|
Examples
|
|
385
438
|
--------
|
|
386
|
-
from label_studio_sdk import ExportConvert
|
|
387
439
|
from label_studio_sdk.client import LabelStudio
|
|
388
440
|
|
|
389
441
|
client = LabelStudio(
|
|
@@ -392,15 +444,13 @@ class ExportsClient:
|
|
|
392
444
|
client.projects.exports.convert(
|
|
393
445
|
id=1,
|
|
394
446
|
export_pk="export_pk",
|
|
395
|
-
|
|
396
|
-
export_type="export_type",
|
|
397
|
-
),
|
|
447
|
+
export_type="export_type",
|
|
398
448
|
)
|
|
399
449
|
"""
|
|
400
450
|
_response = self._client_wrapper.httpx_client.request(
|
|
401
451
|
f"api/projects/{jsonable_encoder(id)}/exports/{jsonable_encoder(export_pk)}/convert",
|
|
402
452
|
method="POST",
|
|
403
|
-
json=
|
|
453
|
+
json={"export_type": export_type},
|
|
404
454
|
request_options=request_options,
|
|
405
455
|
omit=OMIT,
|
|
406
456
|
)
|
|
@@ -657,7 +707,22 @@ class AsyncExportsClient:
|
|
|
657
707
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
658
708
|
|
|
659
709
|
async def create(
|
|
660
|
-
self,
|
|
710
|
+
self,
|
|
711
|
+
id_: int,
|
|
712
|
+
*,
|
|
713
|
+
title: typing.Optional[str] = OMIT,
|
|
714
|
+
id: typing.Optional[int] = OMIT,
|
|
715
|
+
created_by: typing.Optional[UserSimple] = OMIT,
|
|
716
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
717
|
+
finished_at: typing.Optional[dt.datetime] = OMIT,
|
|
718
|
+
status: typing.Optional[ExportCreateStatus] = OMIT,
|
|
719
|
+
md5: typing.Optional[str] = OMIT,
|
|
720
|
+
counters: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
721
|
+
converted_formats: typing.Optional[typing.Sequence[ConvertedFormat]] = OMIT,
|
|
722
|
+
task_filter_options: typing.Optional[TaskFilterOptions] = OMIT,
|
|
723
|
+
annotation_filter_options: typing.Optional[AnnotationFilterOptions] = OMIT,
|
|
724
|
+
serialization_options: typing.Optional[SerializationOptions] = OMIT,
|
|
725
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
661
726
|
) -> ExportCreate:
|
|
662
727
|
"""
|
|
663
728
|
Create a new export request to start a background task and generate an export file (snapshot) for a specific project by ID. The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../list).
|
|
@@ -668,10 +733,34 @@ class AsyncExportsClient:
|
|
|
668
733
|
|
|
669
734
|
Parameters
|
|
670
735
|
----------
|
|
671
|
-
|
|
736
|
+
id_ : int
|
|
672
737
|
A unique integer value identifying this project.
|
|
673
738
|
|
|
674
|
-
|
|
739
|
+
title : typing.Optional[str]
|
|
740
|
+
|
|
741
|
+
id : typing.Optional[int]
|
|
742
|
+
|
|
743
|
+
created_by : typing.Optional[UserSimple]
|
|
744
|
+
|
|
745
|
+
created_at : typing.Optional[dt.datetime]
|
|
746
|
+
Creation time
|
|
747
|
+
|
|
748
|
+
finished_at : typing.Optional[dt.datetime]
|
|
749
|
+
Complete or fail time
|
|
750
|
+
|
|
751
|
+
status : typing.Optional[ExportCreateStatus]
|
|
752
|
+
|
|
753
|
+
md5 : typing.Optional[str]
|
|
754
|
+
|
|
755
|
+
counters : typing.Optional[typing.Dict[str, typing.Any]]
|
|
756
|
+
|
|
757
|
+
converted_formats : typing.Optional[typing.Sequence[ConvertedFormat]]
|
|
758
|
+
|
|
759
|
+
task_filter_options : typing.Optional[TaskFilterOptions]
|
|
760
|
+
|
|
761
|
+
annotation_filter_options : typing.Optional[AnnotationFilterOptions]
|
|
762
|
+
|
|
763
|
+
serialization_options : typing.Optional[SerializationOptions]
|
|
675
764
|
|
|
676
765
|
request_options : typing.Optional[RequestOptions]
|
|
677
766
|
Request-specific configuration.
|
|
@@ -683,21 +772,32 @@ class AsyncExportsClient:
|
|
|
683
772
|
|
|
684
773
|
Examples
|
|
685
774
|
--------
|
|
686
|
-
from label_studio_sdk import ExportCreate
|
|
687
775
|
from label_studio_sdk.client import AsyncLabelStudio
|
|
688
776
|
|
|
689
777
|
client = AsyncLabelStudio(
|
|
690
778
|
api_key="YOUR_API_KEY",
|
|
691
779
|
)
|
|
692
780
|
await client.projects.exports.create(
|
|
693
|
-
|
|
694
|
-
request=ExportCreate(),
|
|
781
|
+
id_=1,
|
|
695
782
|
)
|
|
696
783
|
"""
|
|
697
784
|
_response = await self._client_wrapper.httpx_client.request(
|
|
698
|
-
f"api/projects/{jsonable_encoder(
|
|
785
|
+
f"api/projects/{jsonable_encoder(id_)}/exports/",
|
|
699
786
|
method="POST",
|
|
700
|
-
json=
|
|
787
|
+
json={
|
|
788
|
+
"title": title,
|
|
789
|
+
"id": id,
|
|
790
|
+
"created_by": created_by,
|
|
791
|
+
"created_at": created_at,
|
|
792
|
+
"finished_at": finished_at,
|
|
793
|
+
"status": status,
|
|
794
|
+
"md5": md5,
|
|
795
|
+
"counters": counters,
|
|
796
|
+
"converted_formats": converted_formats,
|
|
797
|
+
"task_filter_options": task_filter_options,
|
|
798
|
+
"annotation_filter_options": annotation_filter_options,
|
|
799
|
+
"serialization_options": serialization_options,
|
|
800
|
+
},
|
|
701
801
|
request_options=request_options,
|
|
702
802
|
omit=OMIT,
|
|
703
803
|
)
|
|
@@ -805,12 +905,7 @@ class AsyncExportsClient:
|
|
|
805
905
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
806
906
|
|
|
807
907
|
async def convert(
|
|
808
|
-
self,
|
|
809
|
-
id: int,
|
|
810
|
-
export_pk: str,
|
|
811
|
-
*,
|
|
812
|
-
request: ExportConvert,
|
|
813
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
908
|
+
self, id: int, export_pk: str, *, export_type: str, request_options: typing.Optional[RequestOptions] = None
|
|
814
909
|
) -> ExportConvert:
|
|
815
910
|
"""
|
|
816
911
|
You can use this to convert an export snapshot into the selected format.
|
|
@@ -829,7 +924,8 @@ class AsyncExportsClient:
|
|
|
829
924
|
export_pk : str
|
|
830
925
|
Primary key identifying the export file.
|
|
831
926
|
|
|
832
|
-
|
|
927
|
+
export_type : str
|
|
928
|
+
Export file format.
|
|
833
929
|
|
|
834
930
|
request_options : typing.Optional[RequestOptions]
|
|
835
931
|
Request-specific configuration.
|
|
@@ -841,7 +937,6 @@ class AsyncExportsClient:
|
|
|
841
937
|
|
|
842
938
|
Examples
|
|
843
939
|
--------
|
|
844
|
-
from label_studio_sdk import ExportConvert
|
|
845
940
|
from label_studio_sdk.client import AsyncLabelStudio
|
|
846
941
|
|
|
847
942
|
client = AsyncLabelStudio(
|
|
@@ -850,15 +945,13 @@ class AsyncExportsClient:
|
|
|
850
945
|
await client.projects.exports.convert(
|
|
851
946
|
id=1,
|
|
852
947
|
export_pk="export_pk",
|
|
853
|
-
|
|
854
|
-
export_type="export_type",
|
|
855
|
-
),
|
|
948
|
+
export_type="export_type",
|
|
856
949
|
)
|
|
857
950
|
"""
|
|
858
951
|
_response = await self._client_wrapper.httpx_client.request(
|
|
859
952
|
f"api/projects/{jsonable_encoder(id)}/exports/{jsonable_encoder(export_pk)}/convert",
|
|
860
953
|
method="POST",
|
|
861
|
-
json=
|
|
954
|
+
json={"export_type": export_type},
|
|
862
955
|
request_options=request_options,
|
|
863
956
|
omit=OMIT,
|
|
864
957
|
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .types import (
|
|
4
|
+
PromptsBatchFailedPredictionsRequestFailedPredictionsItem,
|
|
5
|
+
PromptsBatchFailedPredictionsResponse,
|
|
6
|
+
PromptsBatchPredictionsRequestResultsItem,
|
|
7
|
+
PromptsBatchPredictionsResponse,
|
|
8
|
+
)
|
|
9
|
+
from . import indicators, runs, versions
|
|
10
|
+
from .runs import RunsListRequestProjectSubset
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"PromptsBatchFailedPredictionsRequestFailedPredictionsItem",
|
|
14
|
+
"PromptsBatchFailedPredictionsResponse",
|
|
15
|
+
"PromptsBatchPredictionsRequestResultsItem",
|
|
16
|
+
"PromptsBatchPredictionsResponse",
|
|
17
|
+
"RunsListRequestProjectSubset",
|
|
18
|
+
"indicators",
|
|
19
|
+
"runs",
|
|
20
|
+
"versions",
|
|
21
|
+
]
|