label-studio-sdk 1.0.1__py3-none-any.whl → 1.0.3__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.
Files changed (36) hide show
  1. label_studio_sdk/__init__.py +26 -1
  2. label_studio_sdk/actions/__init__.py +2 -0
  3. label_studio_sdk/actions/client.py +62 -14
  4. label_studio_sdk/actions/types/__init__.py +2 -0
  5. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +3 -2
  6. label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +5 -0
  7. label_studio_sdk/core/client_wrapper.py +1 -1
  8. label_studio_sdk/errors/bad_request_error.py +3 -1
  9. label_studio_sdk/label_interface/interface.py +1 -1
  10. label_studio_sdk/{_legacy → label_interface}/objects.py +8 -22
  11. label_studio_sdk/projects/__init__.py +8 -2
  12. label_studio_sdk/projects/client.py +150 -17
  13. label_studio_sdk/projects/types/__init__.py +2 -1
  14. label_studio_sdk/projects/types/projects_update_response.py +96 -0
  15. label_studio_sdk/tasks/client.py +11 -8
  16. label_studio_sdk/types/__init__.py +18 -0
  17. label_studio_sdk/types/annotations_dm_field.py +120 -0
  18. label_studio_sdk/types/annotations_dm_field_last_action.py +19 -0
  19. label_studio_sdk/types/base_task.py +4 -2
  20. label_studio_sdk/types/base_task_file_upload.py +5 -0
  21. label_studio_sdk/types/base_task_updated_by.py +5 -0
  22. label_studio_sdk/types/data_manager_task_serializer.py +124 -0
  23. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +5 -0
  24. label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +31 -0
  25. label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +37 -0
  26. label_studio_sdk/types/task.py +3 -2
  27. label_studio_sdk/types/task_annotators_item.py +5 -0
  28. label_studio_sdk/views/__init__.py +4 -0
  29. label_studio_sdk/views/types/__init__.py +4 -0
  30. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +3 -2
  31. label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +5 -0
  32. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +3 -2
  33. label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +5 -0
  34. {label_studio_sdk-1.0.1.dist-info → label_studio_sdk-1.0.3.dist-info}/METADATA +39 -7
  35. {label_studio_sdk-1.0.1.dist-info → label_studio_sdk-1.0.3.dist-info}/RECORD +36 -23
  36. {label_studio_sdk-1.0.1.dist-info → label_studio_sdk-1.0.3.dist-info}/WHEEL +0 -0
@@ -4,14 +4,22 @@ from .types import (
4
4
  Annotation,
5
5
  AnnotationFilterOptions,
6
6
  AnnotationLastAction,
7
+ AnnotationsDmField,
8
+ AnnotationsDmFieldLastAction,
7
9
  AzureBlobExportStorage,
8
10
  AzureBlobExportStorageStatus,
9
11
  AzureBlobImportStorage,
10
12
  AzureBlobImportStorageStatus,
11
13
  BaseTask,
14
+ BaseTaskFileUpload,
15
+ BaseTaskUpdatedBy,
12
16
  BaseUser,
13
17
  ConvertedFormat,
14
18
  ConvertedFormatStatus,
19
+ DataManagerTaskSerializer,
20
+ DataManagerTaskSerializerAnnotatorsItem,
21
+ DataManagerTaskSerializerDraftsItem,
22
+ DataManagerTaskSerializerPredictionsItem,
15
23
  Export,
16
24
  ExportConvert,
17
25
  ExportCreate,
@@ -49,6 +57,7 @@ from .types import (
49
57
  SerializationOption,
50
58
  SerializationOptions,
51
59
  Task,
60
+ TaskAnnotatorsItem,
52
61
  TaskFilterOptions,
53
62
  UserSimple,
54
63
  View,
@@ -79,6 +88,7 @@ from .actions import (
79
88
  ActionsCreateRequestFiltersItemsItem,
80
89
  ActionsCreateRequestFiltersItemsItemFilter,
81
90
  ActionsCreateRequestFiltersItemsItemOperator,
91
+ ActionsCreateRequestFiltersItemsItemValue,
82
92
  ActionsCreateRequestId,
83
93
  ActionsCreateRequestOrderingItem,
84
94
  ActionsCreateRequestSelectedItems,
@@ -96,7 +106,7 @@ from .ml import (
96
106
  MlUpdateResponse,
97
107
  MlUpdateResponseAuthMethod,
98
108
  )
99
- from .projects import ProjectsCreateResponse, ProjectsImportTasksResponse, ProjectsListResponse
109
+ from .projects import ProjectsCreateResponse, ProjectsImportTasksResponse, ProjectsListResponse, ProjectsUpdateResponse
100
110
  from .tasks import TasksListRequestFields, TasksListResponse
101
111
  from .users import UsersGetTokenResponse, UsersResetTokenResponse
102
112
  from .version import __version__
@@ -107,6 +117,7 @@ from .views import (
107
117
  ViewsCreateRequestDataFiltersItemsItem,
108
118
  ViewsCreateRequestDataFiltersItemsItemFilter,
109
119
  ViewsCreateRequestDataFiltersItemsItemOperator,
120
+ ViewsCreateRequestDataFiltersItemsItemValue,
110
121
  ViewsCreateRequestDataOrderingItem,
111
122
  ViewsUpdateRequestData,
112
123
  ViewsUpdateRequestDataFilters,
@@ -114,6 +125,7 @@ from .views import (
114
125
  ViewsUpdateRequestDataFiltersItemsItem,
115
126
  ViewsUpdateRequestDataFiltersItemsItemFilter,
116
127
  ViewsUpdateRequestDataFiltersItemsItemOperator,
128
+ ViewsUpdateRequestDataFiltersItemsItemValue,
117
129
  ViewsUpdateRequestDataOrderingItem,
118
130
  )
119
131
  from .webhooks import WebhooksUpdateRequestActionsItem
@@ -124,6 +136,7 @@ __all__ = [
124
136
  "ActionsCreateRequestFiltersItemsItem",
125
137
  "ActionsCreateRequestFiltersItemsItemFilter",
126
138
  "ActionsCreateRequestFiltersItemsItemOperator",
139
+ "ActionsCreateRequestFiltersItemsItemValue",
127
140
  "ActionsCreateRequestId",
128
141
  "ActionsCreateRequestOrderingItem",
129
142
  "ActionsCreateRequestSelectedItems",
@@ -132,16 +145,24 @@ __all__ = [
132
145
  "Annotation",
133
146
  "AnnotationFilterOptions",
134
147
  "AnnotationLastAction",
148
+ "AnnotationsDmField",
149
+ "AnnotationsDmFieldLastAction",
135
150
  "AzureBlobExportStorage",
136
151
  "AzureBlobExportStorageStatus",
137
152
  "AzureBlobImportStorage",
138
153
  "AzureBlobImportStorageStatus",
139
154
  "BadRequestError",
140
155
  "BaseTask",
156
+ "BaseTaskFileUpload",
157
+ "BaseTaskUpdatedBy",
141
158
  "BaseUser",
142
159
  "Client",
143
160
  "ConvertedFormat",
144
161
  "ConvertedFormatStatus",
162
+ "DataManagerTaskSerializer",
163
+ "DataManagerTaskSerializerAnnotatorsItem",
164
+ "DataManagerTaskSerializerDraftsItem",
165
+ "DataManagerTaskSerializerPredictionsItem",
145
166
  "Export",
146
167
  "ExportConvert",
147
168
  "ExportCreate",
@@ -181,6 +202,7 @@ __all__ = [
181
202
  "ProjectsCreateResponse",
182
203
  "ProjectsImportTasksResponse",
183
204
  "ProjectsListResponse",
205
+ "ProjectsUpdateResponse",
184
206
  "RedisExportStorage",
185
207
  "RedisExportStorageStatus",
186
208
  "RedisImportStorage",
@@ -192,6 +214,7 @@ __all__ = [
192
214
  "SerializationOption",
193
215
  "SerializationOptions",
194
216
  "Task",
217
+ "TaskAnnotatorsItem",
195
218
  "TaskFilterOptions",
196
219
  "TasksListRequestFields",
197
220
  "TasksListResponse",
@@ -205,6 +228,7 @@ __all__ = [
205
228
  "ViewsCreateRequestDataFiltersItemsItem",
206
229
  "ViewsCreateRequestDataFiltersItemsItemFilter",
207
230
  "ViewsCreateRequestDataFiltersItemsItemOperator",
231
+ "ViewsCreateRequestDataFiltersItemsItemValue",
208
232
  "ViewsCreateRequestDataOrderingItem",
209
233
  "ViewsUpdateRequestData",
210
234
  "ViewsUpdateRequestDataFilters",
@@ -212,6 +236,7 @@ __all__ = [
212
236
  "ViewsUpdateRequestDataFiltersItemsItem",
213
237
  "ViewsUpdateRequestDataFiltersItemsItemFilter",
214
238
  "ViewsUpdateRequestDataFiltersItemsItemOperator",
239
+ "ViewsUpdateRequestDataFiltersItemsItemValue",
215
240
  "ViewsUpdateRequestDataOrderingItem",
216
241
  "Webhook",
217
242
  "WebhookActionsItem",
@@ -6,6 +6,7 @@ from .types import (
6
6
  ActionsCreateRequestFiltersItemsItem,
7
7
  ActionsCreateRequestFiltersItemsItemFilter,
8
8
  ActionsCreateRequestFiltersItemsItemOperator,
9
+ ActionsCreateRequestFiltersItemsItemValue,
9
10
  ActionsCreateRequestId,
10
11
  ActionsCreateRequestOrderingItem,
11
12
  ActionsCreateRequestSelectedItems,
@@ -19,6 +20,7 @@ __all__ = [
19
20
  "ActionsCreateRequestFiltersItemsItem",
20
21
  "ActionsCreateRequestFiltersItemsItemFilter",
21
22
  "ActionsCreateRequestFiltersItemsItemOperator",
23
+ "ActionsCreateRequestFiltersItemsItemValue",
22
24
  "ActionsCreateRequestId",
23
25
  "ActionsCreateRequestOrderingItem",
24
26
  "ActionsCreateRequestSelectedItems",
@@ -55,8 +55,8 @@ class ActionsClient:
55
55
  def create(
56
56
  self,
57
57
  *,
58
- id: typing.Optional[ActionsCreateRequestId] = None,
59
- project: typing.Optional[int] = None,
58
+ id: ActionsCreateRequestId,
59
+ project: int,
60
60
  view: typing.Optional[int] = None,
61
61
  filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
62
62
  selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
@@ -64,14 +64,14 @@ class ActionsClient:
64
64
  request_options: typing.Optional[RequestOptions] = None
65
65
  ) -> None:
66
66
  """
67
- Perform a Data Manager action with the selected tasks and filters.
67
+ 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`
68
68
 
69
69
  Parameters
70
70
  ----------
71
- id : typing.Optional[ActionsCreateRequestId]
72
- Action name ID, the full list of actions can be retrieved with a GET request
71
+ id : ActionsCreateRequestId
72
+ Action name ID, see the full list of actions in the `GET api/actions` request
73
73
 
74
- project : typing.Optional[int]
74
+ project : int
75
75
  Project ID
76
76
 
77
77
  view : typing.Optional[int]
@@ -95,12 +95,36 @@ class ActionsClient:
95
95
 
96
96
  Examples
97
97
  --------
98
+ from label_studio_sdk import (
99
+ ActionsCreateRequestFilters,
100
+ ActionsCreateRequestFiltersItemsItem,
101
+ ActionsCreateRequestSelectedItemsExcluded,
102
+ )
98
103
  from label_studio_sdk.client import LabelStudio
99
104
 
100
105
  client = LabelStudio(
101
106
  api_key="YOUR_API_KEY",
102
107
  )
103
- client.actions.create()
108
+ client.actions.create(
109
+ id="retrieve_tasks_predictions",
110
+ project=1,
111
+ filters=ActionsCreateRequestFilters(
112
+ conjunction="or",
113
+ items=[
114
+ ActionsCreateRequestFiltersItemsItem(
115
+ filter="filter:tasks:id",
116
+ operator="greater",
117
+ type="Number",
118
+ value=123,
119
+ )
120
+ ],
121
+ ),
122
+ selected_items=ActionsCreateRequestSelectedItemsExcluded(
123
+ all_=True,
124
+ excluded=[124, 125, 126],
125
+ ),
126
+ ordering=["tasks:total_annotations"],
127
+ )
104
128
  """
105
129
  _response = self._client_wrapper.httpx_client.request(
106
130
  "api/dm/actions/",
@@ -159,8 +183,8 @@ class AsyncActionsClient:
159
183
  async def create(
160
184
  self,
161
185
  *,
162
- id: typing.Optional[ActionsCreateRequestId] = None,
163
- project: typing.Optional[int] = None,
186
+ id: ActionsCreateRequestId,
187
+ project: int,
164
188
  view: typing.Optional[int] = None,
165
189
  filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
166
190
  selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
@@ -168,14 +192,14 @@ class AsyncActionsClient:
168
192
  request_options: typing.Optional[RequestOptions] = None
169
193
  ) -> None:
170
194
  """
171
- Perform a Data Manager action with the selected tasks and filters.
195
+ 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`
172
196
 
173
197
  Parameters
174
198
  ----------
175
- id : typing.Optional[ActionsCreateRequestId]
176
- Action name ID, the full list of actions can be retrieved with a GET request
199
+ id : ActionsCreateRequestId
200
+ Action name ID, see the full list of actions in the `GET api/actions` request
177
201
 
178
- project : typing.Optional[int]
202
+ project : int
179
203
  Project ID
180
204
 
181
205
  view : typing.Optional[int]
@@ -199,12 +223,36 @@ class AsyncActionsClient:
199
223
 
200
224
  Examples
201
225
  --------
226
+ from label_studio_sdk import (
227
+ ActionsCreateRequestFilters,
228
+ ActionsCreateRequestFiltersItemsItem,
229
+ ActionsCreateRequestSelectedItemsExcluded,
230
+ )
202
231
  from label_studio_sdk.client import AsyncLabelStudio
203
232
 
204
233
  client = AsyncLabelStudio(
205
234
  api_key="YOUR_API_KEY",
206
235
  )
207
- await client.actions.create()
236
+ await client.actions.create(
237
+ id="retrieve_tasks_predictions",
238
+ project=1,
239
+ filters=ActionsCreateRequestFilters(
240
+ conjunction="or",
241
+ items=[
242
+ ActionsCreateRequestFiltersItemsItem(
243
+ filter="filter:tasks:id",
244
+ operator="greater",
245
+ type="Number",
246
+ value=123,
247
+ )
248
+ ],
249
+ ),
250
+ selected_items=ActionsCreateRequestSelectedItemsExcluded(
251
+ all_=True,
252
+ excluded=[124, 125, 126],
253
+ ),
254
+ ordering=["tasks:total_annotations"],
255
+ )
208
256
  """
209
257
  _response = await self._client_wrapper.httpx_client.request(
210
258
  "api/dm/actions/",
@@ -5,6 +5,7 @@ from .actions_create_request_filters_conjunction import ActionsCreateRequestFilt
5
5
  from .actions_create_request_filters_items_item import ActionsCreateRequestFiltersItemsItem
6
6
  from .actions_create_request_filters_items_item_filter import ActionsCreateRequestFiltersItemsItemFilter
7
7
  from .actions_create_request_filters_items_item_operator import ActionsCreateRequestFiltersItemsItemOperator
8
+ from .actions_create_request_filters_items_item_value import ActionsCreateRequestFiltersItemsItemValue
8
9
  from .actions_create_request_id import ActionsCreateRequestId
9
10
  from .actions_create_request_ordering_item import ActionsCreateRequestOrderingItem
10
11
  from .actions_create_request_selected_items import ActionsCreateRequestSelectedItems
@@ -17,6 +18,7 @@ __all__ = [
17
18
  "ActionsCreateRequestFiltersItemsItem",
18
19
  "ActionsCreateRequestFiltersItemsItemFilter",
19
20
  "ActionsCreateRequestFiltersItemsItemOperator",
21
+ "ActionsCreateRequestFiltersItemsItemValue",
20
22
  "ActionsCreateRequestId",
21
23
  "ActionsCreateRequestOrderingItem",
22
24
  "ActionsCreateRequestSelectedItems",
@@ -7,12 +7,13 @@ from ...core.datetime_utils import serialize_datetime
7
7
  from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
  from .actions_create_request_filters_items_item_filter import ActionsCreateRequestFiltersItemsItemFilter
9
9
  from .actions_create_request_filters_items_item_operator import ActionsCreateRequestFiltersItemsItemOperator
10
+ from .actions_create_request_filters_items_item_value import ActionsCreateRequestFiltersItemsItemValue
10
11
 
11
12
 
12
13
  class ActionsCreateRequestFiltersItemsItem(pydantic_v1.BaseModel):
13
14
  filter: ActionsCreateRequestFiltersItemsItemFilter = pydantic_v1.Field()
14
15
  """
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`. 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>
16
+ 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>
16
17
  """
17
18
 
18
19
  operator: ActionsCreateRequestFiltersItemsItemOperator = pydantic_v1.Field()
@@ -25,7 +26,7 @@ class ActionsCreateRequestFiltersItemsItem(pydantic_v1.BaseModel):
25
26
  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>
26
27
  """
27
28
 
28
- value: str = pydantic_v1.Field()
29
+ value: ActionsCreateRequestFiltersItemsItemValue = pydantic_v1.Field()
29
30
  """
30
31
  Value to filter by
31
32
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ActionsCreateRequestFiltersItemsItemValue = typing.Union[str, int, float, bool, typing.Dict[str, typing.Any]]
@@ -17,7 +17,7 @@ class BaseClientWrapper:
17
17
  headers: typing.Dict[str, str] = {
18
18
  "X-Fern-Language": "Python",
19
19
  "X-Fern-SDK-Name": "label-studio-sdk",
20
- "X-Fern-SDK-Version": "0.0.121",
20
+ "X-Fern-SDK-Version": "1.0.3",
21
21
  }
22
22
  headers["Authorization"] = f"Token {self.api_key}"
23
23
  return headers
@@ -1,8 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import typing
4
+
3
5
  from ..core.api_error import ApiError
4
6
 
5
7
 
6
8
  class BadRequestError(ApiError):
7
- def __init__(self, body: str):
9
+ def __init__(self, body: typing.Any):
8
10
  super().__init__(status_code=400, body=body)
@@ -29,7 +29,7 @@ from .control_tags import (
29
29
  )
30
30
  from .object_tags import ObjectTag
31
31
  from .label_tags import LabelTag
32
- from label_studio_sdk._legacy.objects import AnnotationValue, TaskValue, PredictionValue
32
+ from .objects import AnnotationValue, TaskValue, PredictionValue
33
33
 
34
34
 
35
35
  dir_path = os.path.dirname(os.path.realpath(__file__))
@@ -1,11 +1,10 @@
1
1
  from typing import Type, Dict, Optional, List, Tuple, Any, Union
2
- from pydantic import BaseModel, Field, confloat
2
+ from pydantic import BaseModel, Field, confloat, field_serializer
3
3
 
4
- from label_studio_sdk.label_interface.region import Region
4
+ from .region import Region
5
5
 
6
6
 
7
7
  def serialize_regions(result):
8
- """ """
9
8
  res = []
10
9
  relations = []
11
10
  for r in result:
@@ -25,19 +24,13 @@ class PredictionValue(BaseModel):
25
24
  model_version: Optional[Any] = None
26
25
  score: Optional[float] = 0.00
27
26
  result: Optional[List[Union[Dict[str, Any], Region]]]
28
- # cluster: Optional[Any] = None
29
- # neighbors: Optional[Any] = None
30
27
 
31
28
  class Config:
32
29
  allow_population_by_field_name = True
33
30
 
34
- def serialize(self):
35
- """ """
36
- return {
37
- "model_version": self.model_version,
38
- "score": self.score,
39
- "result": serialize_regions(self.result),
40
- }
31
+ @field_serializer('result')
32
+ def serialize_result(self, result):
33
+ return serialize_regions(result)
41
34
 
42
35
 
43
36
  class AnnotationValue(BaseModel):
@@ -54,16 +47,9 @@ class AnnotationValue(BaseModel):
54
47
  class Config:
55
48
  allow_population_by_field_name = True
56
49
 
57
- def serialize(self):
58
- """ """
59
- return {
60
- "was_cancelled": self.was_cancelled,
61
- "ground_truth": self.ground_truth,
62
- "lead_time": self.lead_time,
63
- "result_count": self.result_count,
64
- "completed_by": self.completed_by,
65
- "result": serialize_regions(self.result),
66
- }
50
+ @field_serializer('result')
51
+ def serialize_result(self, result):
52
+ return serialize_regions(result)
67
53
 
68
54
 
69
55
  class TaskValue(BaseModel):
@@ -1,6 +1,12 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from .types import ProjectsCreateResponse, ProjectsImportTasksResponse, ProjectsListResponse
3
+ from .types import ProjectsCreateResponse, ProjectsImportTasksResponse, ProjectsListResponse, ProjectsUpdateResponse
4
4
  from . import exports
5
5
 
6
- __all__ = ["ProjectsCreateResponse", "ProjectsImportTasksResponse", "ProjectsListResponse", "exports"]
6
+ __all__ = [
7
+ "ProjectsCreateResponse",
8
+ "ProjectsImportTasksResponse",
9
+ "ProjectsListResponse",
10
+ "ProjectsUpdateResponse",
11
+ "exports",
12
+ ]