label-studio-sdk 2.0.10__py3-none-any.whl → 2.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.

Files changed (51) hide show
  1. label_studio_sdk/activity_logs/client.py +12 -0
  2. label_studio_sdk/annotation_history/client.py +36 -0
  3. label_studio_sdk/annotation_reviews/client.py +60 -0
  4. label_studio_sdk/billing/client.py +12 -0
  5. label_studio_sdk/comments/client.py +72 -0
  6. label_studio_sdk/export_storage/azure_spi/client.py +84 -0
  7. label_studio_sdk/export_storage/databricks/client.py +84 -0
  8. label_studio_sdk/export_storage/gcswif/client.py +84 -0
  9. label_studio_sdk/export_storage/s3s/client.py +84 -0
  10. label_studio_sdk/import_storage/azure_spi/client.py +84 -0
  11. label_studio_sdk/import_storage/databricks/client.py +84 -0
  12. label_studio_sdk/import_storage/gcswif/client.py +84 -0
  13. label_studio_sdk/import_storage/s3s/client.py +84 -0
  14. label_studio_sdk/label_interface/control_tags.py +12 -7
  15. label_studio_sdk/ml/client.py +14 -2
  16. label_studio_sdk/model_providers/client.py +72 -0
  17. label_studio_sdk/organizations/client.py +30 -6
  18. label_studio_sdk/organizations/invites/client.py +24 -0
  19. label_studio_sdk/organizations/members/client.py +24 -0
  20. label_studio_sdk/organizations/permissions/client.py +60 -0
  21. label_studio_sdk/project_templates/client.py +76 -4
  22. label_studio_sdk/projects/__init__.py +6 -0
  23. label_studio_sdk/projects/assignments/client.py +60 -0
  24. label_studio_sdk/projects/client.py +12 -0
  25. label_studio_sdk/projects/members/bulk/client.py +24 -0
  26. label_studio_sdk/projects/members/client.py +12 -0
  27. label_studio_sdk/projects/members/paginated/client.py +12 -0
  28. label_studio_sdk/projects/metrics/client.py +24 -0
  29. label_studio_sdk/projects/pauses/client.py +60 -0
  30. label_studio_sdk/projects/stats/__init__.py +6 -0
  31. label_studio_sdk/projects/stats/client.py +486 -1
  32. label_studio_sdk/projects/stats/types/__init__.py +6 -0
  33. label_studio_sdk/projects/stats/types/stats_model_version_annotator_agreement_response.py +19 -0
  34. label_studio_sdk/projects/stats/types/stats_model_version_ground_truth_agreement_response.py +19 -0
  35. label_studio_sdk/projects/stats/types/stats_model_version_prediction_agreement_response.py +19 -0
  36. label_studio_sdk/prompts/client.py +96 -0
  37. label_studio_sdk/prompts/indicators/client.py +24 -0
  38. label_studio_sdk/prompts/runs/client.py +36 -0
  39. label_studio_sdk/prompts/versions/client.py +84 -0
  40. label_studio_sdk/sso/saml/client.py +24 -0
  41. label_studio_sdk/sso/scim/client.py +24 -0
  42. label_studio_sdk/types/default_role.py +2 -2
  43. label_studio_sdk/types/lse_organization.py +1 -1
  44. label_studio_sdk/types/project_template.py +1 -1
  45. label_studio_sdk/types/project_template_request.py +1 -1
  46. label_studio_sdk/users/client.py +24 -0
  47. label_studio_sdk/versions/client.py +12 -0
  48. {label_studio_sdk-2.0.10.dist-info → label_studio_sdk-2.0.11.dist-info}/METADATA +1 -1
  49. {label_studio_sdk-2.0.10.dist-info → label_studio_sdk-2.0.11.dist-info}/RECORD +51 -48
  50. {label_studio_sdk-2.0.10.dist-info → label_studio_sdk-2.0.11.dist-info}/LICENSE +0 -0
  51. {label_studio_sdk-2.0.10.dist-info → label_studio_sdk-2.0.11.dist-info}/WHEEL +0 -0
@@ -3,11 +3,14 @@
3
3
  from ...core.client_wrapper import SyncClientWrapper
4
4
  import typing
5
5
  from ...core.request_options import RequestOptions
6
- from .types.stats_iaa_response import StatsIaaResponse
6
+ from .types.stats_model_version_annotator_agreement_response import StatsModelVersionAnnotatorAgreementResponse
7
7
  from ...core.jsonable_encoder import jsonable_encoder
8
8
  from ...core.unchecked_base_model import construct_type
9
9
  from json.decoder import JSONDecodeError
10
10
  from ...core.api_error import ApiError
11
+ from .types.stats_model_version_ground_truth_agreement_response import StatsModelVersionGroundTruthAgreementResponse
12
+ from .types.stats_model_version_prediction_agreement_response import StatsModelVersionPredictionAgreementResponse
13
+ from .types.stats_iaa_response import StatsIaaResponse
11
14
  from .types.stats_agreement_annotator_response import StatsAgreementAnnotatorResponse
12
15
  from .types.stats_data_filters_response import StatsDataFiltersResponse
13
16
  from .types.stats_finished_tasks_response import StatsFinishedTasksResponse
@@ -23,6 +26,199 @@ class StatsClient:
23
26
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
27
  self._client_wrapper = client_wrapper
25
28
 
29
+ def model_version_annotator_agreement(
30
+ self, id: int, model_version: str, *, request_options: typing.Optional[RequestOptions] = None
31
+ ) -> StatsModelVersionAnnotatorAgreementResponse:
32
+ """
33
+ <Card href="https://humansignal.com/goenterprise">
34
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
35
+ <p style="margin-top: 10px; font-size: 14px;">
36
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
37
+ </p>
38
+ </Card>
39
+ Get agreement between a given model version and all annotators in the project for overlapping tasks.
40
+
41
+ Parameters
42
+ ----------
43
+ id : int
44
+
45
+ model_version : str
46
+
47
+ request_options : typing.Optional[RequestOptions]
48
+ Request-specific configuration.
49
+
50
+ Returns
51
+ -------
52
+ StatsModelVersionAnnotatorAgreementResponse
53
+ Model-version overall agreement vs annotators
54
+
55
+ Examples
56
+ --------
57
+ from label_studio_sdk import LabelStudio
58
+
59
+ client = LabelStudio(
60
+ api_key="YOUR_API_KEY",
61
+ )
62
+ client.projects.stats.model_version_annotator_agreement(
63
+ id=1,
64
+ model_version="model_version",
65
+ )
66
+ """
67
+ _response = self._client_wrapper.httpx_client.request(
68
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/agreement",
69
+ method="GET",
70
+ request_options=request_options,
71
+ )
72
+ try:
73
+ if 200 <= _response.status_code < 300:
74
+ return typing.cast(
75
+ StatsModelVersionAnnotatorAgreementResponse,
76
+ construct_type(
77
+ type_=StatsModelVersionAnnotatorAgreementResponse, # type: ignore
78
+ object_=_response.json(),
79
+ ),
80
+ )
81
+ _response_json = _response.json()
82
+ except JSONDecodeError:
83
+ raise ApiError(status_code=_response.status_code, body=_response.text)
84
+ raise ApiError(status_code=_response.status_code, body=_response_json)
85
+
86
+ def model_version_ground_truth_agreement(
87
+ self,
88
+ id: int,
89
+ model_version: str,
90
+ *,
91
+ per_label: typing.Optional[bool] = None,
92
+ request_options: typing.Optional[RequestOptions] = None,
93
+ ) -> StatsModelVersionGroundTruthAgreementResponse:
94
+ """
95
+ <Card href="https://humansignal.com/goenterprise">
96
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
97
+ <p style="margin-top: 10px; font-size: 14px;">
98
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
99
+ </p>
100
+ </Card>
101
+ Get agreement between a given model version and ground truth annotations in the project for overlapping tasks.
102
+
103
+ Parameters
104
+ ----------
105
+ id : int
106
+
107
+ model_version : str
108
+
109
+ per_label : typing.Optional[bool]
110
+ Calculate agreement per label
111
+
112
+ request_options : typing.Optional[RequestOptions]
113
+ Request-specific configuration.
114
+
115
+ Returns
116
+ -------
117
+ StatsModelVersionGroundTruthAgreementResponse
118
+ Model-version ground truth agreement
119
+
120
+ Examples
121
+ --------
122
+ from label_studio_sdk import LabelStudio
123
+
124
+ client = LabelStudio(
125
+ api_key="YOUR_API_KEY",
126
+ )
127
+ client.projects.stats.model_version_ground_truth_agreement(
128
+ id=1,
129
+ model_version="model_version",
130
+ )
131
+ """
132
+ _response = self._client_wrapper.httpx_client.request(
133
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/agreement-groundtruth",
134
+ method="GET",
135
+ params={
136
+ "per_label": per_label,
137
+ },
138
+ request_options=request_options,
139
+ )
140
+ try:
141
+ if 200 <= _response.status_code < 300:
142
+ return typing.cast(
143
+ StatsModelVersionGroundTruthAgreementResponse,
144
+ construct_type(
145
+ type_=StatsModelVersionGroundTruthAgreementResponse, # type: ignore
146
+ object_=_response.json(),
147
+ ),
148
+ )
149
+ _response_json = _response.json()
150
+ except JSONDecodeError:
151
+ raise ApiError(status_code=_response.status_code, body=_response.text)
152
+ raise ApiError(status_code=_response.status_code, body=_response_json)
153
+
154
+ def model_version_prediction_agreement(
155
+ self,
156
+ id: int,
157
+ model_version: str,
158
+ *,
159
+ per_label: typing.Optional[bool] = None,
160
+ request_options: typing.Optional[RequestOptions] = None,
161
+ ) -> StatsModelVersionPredictionAgreementResponse:
162
+ """
163
+ <Card href="https://humansignal.com/goenterprise">
164
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
165
+ <p style="margin-top: 10px; font-size: 14px;">
166
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
167
+ </p>
168
+ </Card>
169
+ Get agreement between a given model version and all other model versions in the project for overlapping tasks.
170
+
171
+ Parameters
172
+ ----------
173
+ id : int
174
+
175
+ model_version : str
176
+
177
+ per_label : typing.Optional[bool]
178
+ Calculate agreement per label
179
+
180
+ request_options : typing.Optional[RequestOptions]
181
+ Request-specific configuration.
182
+
183
+ Returns
184
+ -------
185
+ StatsModelVersionPredictionAgreementResponse
186
+ Model-version prediction agreement
187
+
188
+ Examples
189
+ --------
190
+ from label_studio_sdk import LabelStudio
191
+
192
+ client = LabelStudio(
193
+ api_key="YOUR_API_KEY",
194
+ )
195
+ client.projects.stats.model_version_prediction_agreement(
196
+ id=1,
197
+ model_version="model_version",
198
+ )
199
+ """
200
+ _response = self._client_wrapper.httpx_client.request(
201
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/prediction",
202
+ method="GET",
203
+ params={
204
+ "per_label": per_label,
205
+ },
206
+ request_options=request_options,
207
+ )
208
+ try:
209
+ if 200 <= _response.status_code < 300:
210
+ return typing.cast(
211
+ StatsModelVersionPredictionAgreementResponse,
212
+ construct_type(
213
+ type_=StatsModelVersionPredictionAgreementResponse, # type: ignore
214
+ object_=_response.json(),
215
+ ),
216
+ )
217
+ _response_json = _response.json()
218
+ except JSONDecodeError:
219
+ raise ApiError(status_code=_response.status_code, body=_response.text)
220
+ raise ApiError(status_code=_response.status_code, body=_response_json)
221
+
26
222
  def iaa(
27
223
  self,
28
224
  id: int,
@@ -34,6 +230,12 @@ class StatsClient:
34
230
  request_options: typing.Optional[RequestOptions] = None,
35
231
  ) -> StatsIaaResponse:
36
232
  """
233
+ <Card href="https://humansignal.com/goenterprise">
234
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
235
+ <p style="margin-top: 10px; font-size: 14px;">
236
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
237
+ </p>
238
+ </Card>
37
239
  Get Inter-Annotator Agreement (IAA) matrix for a project, showing agreement between all annotators.
38
240
 
39
241
  Parameters
@@ -100,6 +302,12 @@ class StatsClient:
100
302
  self, id: int, user_id: int, *, request_options: typing.Optional[RequestOptions] = None
101
303
  ) -> StatsAgreementAnnotatorResponse:
102
304
  """
305
+ <Card href="https://humansignal.com/goenterprise">
306
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
307
+ <p style="margin-top: 10px; font-size: 14px;">
308
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
309
+ </p>
310
+ </Card>
103
311
  Get agreement statistics for a specific annotator within a project.
104
312
 
105
313
  Parameters
@@ -303,6 +511,12 @@ class StatsClient:
303
511
  request_options: typing.Optional[RequestOptions] = None,
304
512
  ) -> StatsTotalAgreementResponse:
305
513
  """
514
+ <Card href="https://humansignal.com/goenterprise">
515
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
516
+ <p style="margin-top: 10px; font-size: 14px;">
517
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
518
+ </p>
519
+ </Card>
306
520
  Overall or per-label total agreement across the project.
307
521
 
308
522
  NOTE: due to an open issue in Fern, SDK clients will raise ApiError upon handling a 204 response. As a workaround, wrap call to this function in a try-except block.
@@ -422,6 +636,12 @@ class StatsClient:
422
636
  request_options: typing.Optional[RequestOptions] = None,
423
637
  ) -> StatsUserPredictionAgreementResponse:
424
638
  """
639
+ <Card href="https://humansignal.com/goenterprise">
640
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
641
+ <p style="margin-top: 10px; font-size: 14px;">
642
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
643
+ </p>
644
+ </Card>
425
645
  Get prediction agreement statistics for a specific user within a project.
426
646
 
427
647
  Parameters
@@ -484,6 +704,12 @@ class StatsClient:
484
704
  request_options: typing.Optional[RequestOptions] = None,
485
705
  ) -> StatsUserReviewScoreResponse:
486
706
  """
707
+ <Card href="https://humansignal.com/goenterprise">
708
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
709
+ <p style="margin-top: 10px; font-size: 14px;">
710
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
711
+ </p>
712
+ </Card>
487
713
  Get review score statistics for a specific user within a project.
488
714
 
489
715
  Parameters
@@ -546,6 +772,12 @@ class StatsClient:
546
772
  request_options: typing.Optional[RequestOptions] = None,
547
773
  ) -> StatsUserGroundTruthAgreementResponse:
548
774
  """
775
+ <Card href="https://humansignal.com/goenterprise">
776
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
777
+ <p style="margin-top: 10px; font-size: 14px;">
778
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
779
+ </p>
780
+ </Card>
549
781
  Get ground truth agreement statistics for a specific user within a project.
550
782
 
551
783
  Parameters
@@ -604,6 +836,223 @@ class AsyncStatsClient:
604
836
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
605
837
  self._client_wrapper = client_wrapper
606
838
 
839
+ async def model_version_annotator_agreement(
840
+ self, id: int, model_version: str, *, request_options: typing.Optional[RequestOptions] = None
841
+ ) -> StatsModelVersionAnnotatorAgreementResponse:
842
+ """
843
+ <Card href="https://humansignal.com/goenterprise">
844
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
845
+ <p style="margin-top: 10px; font-size: 14px;">
846
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
847
+ </p>
848
+ </Card>
849
+ Get agreement between a given model version and all annotators in the project for overlapping tasks.
850
+
851
+ Parameters
852
+ ----------
853
+ id : int
854
+
855
+ model_version : str
856
+
857
+ request_options : typing.Optional[RequestOptions]
858
+ Request-specific configuration.
859
+
860
+ Returns
861
+ -------
862
+ StatsModelVersionAnnotatorAgreementResponse
863
+ Model-version overall agreement vs annotators
864
+
865
+ Examples
866
+ --------
867
+ import asyncio
868
+
869
+ from label_studio_sdk import AsyncLabelStudio
870
+
871
+ client = AsyncLabelStudio(
872
+ api_key="YOUR_API_KEY",
873
+ )
874
+
875
+
876
+ async def main() -> None:
877
+ await client.projects.stats.model_version_annotator_agreement(
878
+ id=1,
879
+ model_version="model_version",
880
+ )
881
+
882
+
883
+ asyncio.run(main())
884
+ """
885
+ _response = await self._client_wrapper.httpx_client.request(
886
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/agreement",
887
+ method="GET",
888
+ request_options=request_options,
889
+ )
890
+ try:
891
+ if 200 <= _response.status_code < 300:
892
+ return typing.cast(
893
+ StatsModelVersionAnnotatorAgreementResponse,
894
+ construct_type(
895
+ type_=StatsModelVersionAnnotatorAgreementResponse, # type: ignore
896
+ object_=_response.json(),
897
+ ),
898
+ )
899
+ _response_json = _response.json()
900
+ except JSONDecodeError:
901
+ raise ApiError(status_code=_response.status_code, body=_response.text)
902
+ raise ApiError(status_code=_response.status_code, body=_response_json)
903
+
904
+ async def model_version_ground_truth_agreement(
905
+ self,
906
+ id: int,
907
+ model_version: str,
908
+ *,
909
+ per_label: typing.Optional[bool] = None,
910
+ request_options: typing.Optional[RequestOptions] = None,
911
+ ) -> StatsModelVersionGroundTruthAgreementResponse:
912
+ """
913
+ <Card href="https://humansignal.com/goenterprise">
914
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
915
+ <p style="margin-top: 10px; font-size: 14px;">
916
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
917
+ </p>
918
+ </Card>
919
+ Get agreement between a given model version and ground truth annotations in the project for overlapping tasks.
920
+
921
+ Parameters
922
+ ----------
923
+ id : int
924
+
925
+ model_version : str
926
+
927
+ per_label : typing.Optional[bool]
928
+ Calculate agreement per label
929
+
930
+ request_options : typing.Optional[RequestOptions]
931
+ Request-specific configuration.
932
+
933
+ Returns
934
+ -------
935
+ StatsModelVersionGroundTruthAgreementResponse
936
+ Model-version ground truth agreement
937
+
938
+ Examples
939
+ --------
940
+ import asyncio
941
+
942
+ from label_studio_sdk import AsyncLabelStudio
943
+
944
+ client = AsyncLabelStudio(
945
+ api_key="YOUR_API_KEY",
946
+ )
947
+
948
+
949
+ async def main() -> None:
950
+ await client.projects.stats.model_version_ground_truth_agreement(
951
+ id=1,
952
+ model_version="model_version",
953
+ )
954
+
955
+
956
+ asyncio.run(main())
957
+ """
958
+ _response = await self._client_wrapper.httpx_client.request(
959
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/agreement-groundtruth",
960
+ method="GET",
961
+ params={
962
+ "per_label": per_label,
963
+ },
964
+ request_options=request_options,
965
+ )
966
+ try:
967
+ if 200 <= _response.status_code < 300:
968
+ return typing.cast(
969
+ StatsModelVersionGroundTruthAgreementResponse,
970
+ construct_type(
971
+ type_=StatsModelVersionGroundTruthAgreementResponse, # type: ignore
972
+ object_=_response.json(),
973
+ ),
974
+ )
975
+ _response_json = _response.json()
976
+ except JSONDecodeError:
977
+ raise ApiError(status_code=_response.status_code, body=_response.text)
978
+ raise ApiError(status_code=_response.status_code, body=_response_json)
979
+
980
+ async def model_version_prediction_agreement(
981
+ self,
982
+ id: int,
983
+ model_version: str,
984
+ *,
985
+ per_label: typing.Optional[bool] = None,
986
+ request_options: typing.Optional[RequestOptions] = None,
987
+ ) -> StatsModelVersionPredictionAgreementResponse:
988
+ """
989
+ <Card href="https://humansignal.com/goenterprise">
990
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
991
+ <p style="margin-top: 10px; font-size: 14px;">
992
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
993
+ </p>
994
+ </Card>
995
+ Get agreement between a given model version and all other model versions in the project for overlapping tasks.
996
+
997
+ Parameters
998
+ ----------
999
+ id : int
1000
+
1001
+ model_version : str
1002
+
1003
+ per_label : typing.Optional[bool]
1004
+ Calculate agreement per label
1005
+
1006
+ request_options : typing.Optional[RequestOptions]
1007
+ Request-specific configuration.
1008
+
1009
+ Returns
1010
+ -------
1011
+ StatsModelVersionPredictionAgreementResponse
1012
+ Model-version prediction agreement
1013
+
1014
+ Examples
1015
+ --------
1016
+ import asyncio
1017
+
1018
+ from label_studio_sdk import AsyncLabelStudio
1019
+
1020
+ client = AsyncLabelStudio(
1021
+ api_key="YOUR_API_KEY",
1022
+ )
1023
+
1024
+
1025
+ async def main() -> None:
1026
+ await client.projects.stats.model_version_prediction_agreement(
1027
+ id=1,
1028
+ model_version="model_version",
1029
+ )
1030
+
1031
+
1032
+ asyncio.run(main())
1033
+ """
1034
+ _response = await self._client_wrapper.httpx_client.request(
1035
+ f"api/projects/{jsonable_encoder(id)}/model-stats/{jsonable_encoder(model_version)}/prediction",
1036
+ method="GET",
1037
+ params={
1038
+ "per_label": per_label,
1039
+ },
1040
+ request_options=request_options,
1041
+ )
1042
+ try:
1043
+ if 200 <= _response.status_code < 300:
1044
+ return typing.cast(
1045
+ StatsModelVersionPredictionAgreementResponse,
1046
+ construct_type(
1047
+ type_=StatsModelVersionPredictionAgreementResponse, # type: ignore
1048
+ object_=_response.json(),
1049
+ ),
1050
+ )
1051
+ _response_json = _response.json()
1052
+ except JSONDecodeError:
1053
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1054
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1055
+
607
1056
  async def iaa(
608
1057
  self,
609
1058
  id: int,
@@ -615,6 +1064,12 @@ class AsyncStatsClient:
615
1064
  request_options: typing.Optional[RequestOptions] = None,
616
1065
  ) -> StatsIaaResponse:
617
1066
  """
1067
+ <Card href="https://humansignal.com/goenterprise">
1068
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1069
+ <p style="margin-top: 10px; font-size: 14px;">
1070
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1071
+ </p>
1072
+ </Card>
618
1073
  Get Inter-Annotator Agreement (IAA) matrix for a project, showing agreement between all annotators.
619
1074
 
620
1075
  Parameters
@@ -689,6 +1144,12 @@ class AsyncStatsClient:
689
1144
  self, id: int, user_id: int, *, request_options: typing.Optional[RequestOptions] = None
690
1145
  ) -> StatsAgreementAnnotatorResponse:
691
1146
  """
1147
+ <Card href="https://humansignal.com/goenterprise">
1148
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1149
+ <p style="margin-top: 10px; font-size: 14px;">
1150
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1151
+ </p>
1152
+ </Card>
692
1153
  Get agreement statistics for a specific annotator within a project.
693
1154
 
694
1155
  Parameters
@@ -926,6 +1387,12 @@ class AsyncStatsClient:
926
1387
  request_options: typing.Optional[RequestOptions] = None,
927
1388
  ) -> StatsTotalAgreementResponse:
928
1389
  """
1390
+ <Card href="https://humansignal.com/goenterprise">
1391
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1392
+ <p style="margin-top: 10px; font-size: 14px;">
1393
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1394
+ </p>
1395
+ </Card>
929
1396
  Overall or per-label total agreement across the project.
930
1397
 
931
1398
  NOTE: due to an open issue in Fern, SDK clients will raise ApiError upon handling a 204 response. As a workaround, wrap call to this function in a try-except block.
@@ -1061,6 +1528,12 @@ class AsyncStatsClient:
1061
1528
  request_options: typing.Optional[RequestOptions] = None,
1062
1529
  ) -> StatsUserPredictionAgreementResponse:
1063
1530
  """
1531
+ <Card href="https://humansignal.com/goenterprise">
1532
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1533
+ <p style="margin-top: 10px; font-size: 14px;">
1534
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1535
+ </p>
1536
+ </Card>
1064
1537
  Get prediction agreement statistics for a specific user within a project.
1065
1538
 
1066
1539
  Parameters
@@ -1131,6 +1604,12 @@ class AsyncStatsClient:
1131
1604
  request_options: typing.Optional[RequestOptions] = None,
1132
1605
  ) -> StatsUserReviewScoreResponse:
1133
1606
  """
1607
+ <Card href="https://humansignal.com/goenterprise">
1608
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1609
+ <p style="margin-top: 10px; font-size: 14px;">
1610
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1611
+ </p>
1612
+ </Card>
1134
1613
  Get review score statistics for a specific user within a project.
1135
1614
 
1136
1615
  Parameters
@@ -1201,6 +1680,12 @@ class AsyncStatsClient:
1201
1680
  request_options: typing.Optional[RequestOptions] = None,
1202
1681
  ) -> StatsUserGroundTruthAgreementResponse:
1203
1682
  """
1683
+ <Card href="https://humansignal.com/goenterprise">
1684
+ <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
1685
+ <p style="margin-top: 10px; font-size: 14px;">
1686
+ This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
1687
+ </p>
1688
+ </Card>
1204
1689
  Get ground truth agreement statistics for a specific user within a project.
1205
1690
 
1206
1691
  Parameters
@@ -11,6 +11,9 @@ from .stats_iaa_response_iaa import StatsIaaResponseIaa
11
11
  from .stats_iaa_response_std import StatsIaaResponseStd
12
12
  from .stats_lead_time_response import StatsLeadTimeResponse
13
13
  from .stats_lead_time_response_lead_time_stats_item import StatsLeadTimeResponseLeadTimeStatsItem
14
+ from .stats_model_version_annotator_agreement_response import StatsModelVersionAnnotatorAgreementResponse
15
+ from .stats_model_version_ground_truth_agreement_response import StatsModelVersionGroundTruthAgreementResponse
16
+ from .stats_model_version_prediction_agreement_response import StatsModelVersionPredictionAgreementResponse
14
17
  from .stats_total_agreement_response import StatsTotalAgreementResponse
15
18
  from .stats_total_agreement_response_one import StatsTotalAgreementResponseOne
16
19
  from .stats_total_agreement_response_zero import StatsTotalAgreementResponseZero
@@ -36,6 +39,9 @@ __all__ = [
36
39
  "StatsIaaResponseStd",
37
40
  "StatsLeadTimeResponse",
38
41
  "StatsLeadTimeResponseLeadTimeStatsItem",
42
+ "StatsModelVersionAnnotatorAgreementResponse",
43
+ "StatsModelVersionGroundTruthAgreementResponse",
44
+ "StatsModelVersionPredictionAgreementResponse",
39
45
  "StatsTotalAgreementResponse",
40
46
  "StatsTotalAgreementResponseOne",
41
47
  "StatsTotalAgreementResponseZero",
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ....core.unchecked_base_model import UncheckedBaseModel
4
+ import typing
5
+ from ....core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class StatsModelVersionAnnotatorAgreementResponse(UncheckedBaseModel):
10
+ agreement: typing.Optional[float] = None
11
+
12
+ if IS_PYDANTIC_V2:
13
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
+ else:
15
+
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ....core.unchecked_base_model import UncheckedBaseModel
4
+ import typing
5
+ from ....core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class StatsModelVersionGroundTruthAgreementResponse(UncheckedBaseModel):
10
+ agreement: typing.Optional[float] = None
11
+
12
+ if IS_PYDANTIC_V2:
13
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
+ else:
15
+
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ....core.unchecked_base_model import UncheckedBaseModel
4
+ import typing
5
+ from ....core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class StatsModelVersionPredictionAgreementResponse(UncheckedBaseModel):
10
+ average_prediction_agreement_per_model: typing.Optional[float] = None
11
+
12
+ if IS_PYDANTIC_V2:
13
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
+ else:
15
+
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow