label-studio-sdk 1.0.8__py3-none-any.whl → 1.0.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of label-studio-sdk might be problematic. Click here for more details.

Files changed (218) hide show
  1. label_studio_sdk/__init__.py +37 -8
  2. label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +16 -4
  3. label_studio_sdk/_extensions/label_studio_tools/core/utils/json_schema.py +5 -0
  4. label_studio_sdk/_extensions/pager_ext.py +8 -0
  5. label_studio_sdk/actions/client.py +91 -40
  6. label_studio_sdk/actions/types/actions_create_request_filters.py +14 -24
  7. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +16 -26
  8. label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +3 -1
  9. label_studio_sdk/actions/types/actions_create_request_selected_items.py +1 -2
  10. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +15 -25
  11. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +15 -25
  12. label_studio_sdk/annotations/__init__.py +2 -2
  13. label_studio_sdk/annotations/client.py +278 -104
  14. label_studio_sdk/annotations/types/__init__.py +2 -1
  15. label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +34 -0
  16. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +11 -21
  17. label_studio_sdk/base_client.py +54 -27
  18. label_studio_sdk/client.py +1 -0
  19. label_studio_sdk/comments/client.py +190 -44
  20. label_studio_sdk/converter/converter.py +56 -13
  21. label_studio_sdk/converter/imports/yolo.py +1 -1
  22. label_studio_sdk/converter/utils.py +3 -2
  23. label_studio_sdk/core/__init__.py +21 -4
  24. label_studio_sdk/core/client_wrapper.py +37 -19
  25. label_studio_sdk/core/file.py +37 -8
  26. label_studio_sdk/core/http_client.py +52 -28
  27. label_studio_sdk/core/jsonable_encoder.py +33 -31
  28. label_studio_sdk/core/pagination.py +5 -4
  29. label_studio_sdk/core/pydantic_utilities.py +272 -4
  30. label_studio_sdk/core/query_encoder.py +38 -13
  31. label_studio_sdk/core/request_options.py +3 -0
  32. label_studio_sdk/core/serialization.py +272 -0
  33. label_studio_sdk/errors/__init__.py +3 -1
  34. label_studio_sdk/errors/bad_request_error.py +2 -3
  35. label_studio_sdk/errors/not_found_error.py +9 -0
  36. label_studio_sdk/errors/unauthorized_error.py +9 -0
  37. label_studio_sdk/export_storage/azure/client.py +228 -58
  38. label_studio_sdk/export_storage/azure/types/azure_create_response.py +19 -29
  39. label_studio_sdk/export_storage/azure/types/azure_update_response.py +19 -29
  40. label_studio_sdk/export_storage/client.py +48 -18
  41. label_studio_sdk/export_storage/gcs/client.py +228 -58
  42. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +19 -29
  43. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +19 -29
  44. label_studio_sdk/export_storage/local/client.py +222 -56
  45. label_studio_sdk/export_storage/local/types/local_create_response.py +17 -27
  46. label_studio_sdk/export_storage/local/types/local_update_response.py +17 -27
  47. label_studio_sdk/export_storage/redis/client.py +228 -58
  48. label_studio_sdk/export_storage/redis/types/redis_create_response.py +20 -30
  49. label_studio_sdk/export_storage/redis/types/redis_update_response.py +20 -30
  50. label_studio_sdk/export_storage/s3/client.py +228 -58
  51. label_studio_sdk/export_storage/s3/types/s3create_response.py +27 -35
  52. label_studio_sdk/export_storage/s3/types/s3update_response.py +27 -35
  53. label_studio_sdk/export_storage/s3s/client.py +187 -43
  54. label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +11 -21
  55. label_studio_sdk/files/client.py +172 -56
  56. label_studio_sdk/import_storage/azure/client.py +223 -53
  57. label_studio_sdk/import_storage/azure/types/azure_create_response.py +22 -32
  58. label_studio_sdk/import_storage/azure/types/azure_update_response.py +22 -32
  59. label_studio_sdk/import_storage/client.py +48 -18
  60. label_studio_sdk/import_storage/gcs/client.py +223 -53
  61. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +22 -32
  62. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +22 -32
  63. label_studio_sdk/import_storage/local/client.py +223 -53
  64. label_studio_sdk/import_storage/local/types/local_create_response.py +17 -27
  65. label_studio_sdk/import_storage/local/types/local_update_response.py +17 -27
  66. label_studio_sdk/import_storage/redis/client.py +223 -53
  67. label_studio_sdk/import_storage/redis/types/redis_create_response.py +20 -30
  68. label_studio_sdk/import_storage/redis/types/redis_update_response.py +20 -30
  69. label_studio_sdk/import_storage/s3/client.py +223 -53
  70. label_studio_sdk/import_storage/s3/types/s3create_response.py +31 -39
  71. label_studio_sdk/import_storage/s3/types/s3update_response.py +31 -39
  72. label_studio_sdk/import_storage/s3s/client.py +222 -52
  73. label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +11 -21
  74. label_studio_sdk/jwt_settings/__init__.py +2 -0
  75. label_studio_sdk/jwt_settings/client.py +259 -0
  76. label_studio_sdk/label_interface/control_tags.py +16 -3
  77. label_studio_sdk/label_interface/interface.py +80 -1
  78. label_studio_sdk/label_interface/object_tags.py +2 -2
  79. label_studio_sdk/ml/client.py +280 -78
  80. label_studio_sdk/ml/types/ml_create_response.py +21 -31
  81. label_studio_sdk/ml/types/ml_update_response.py +21 -31
  82. label_studio_sdk/model_providers/client.py +173 -56
  83. label_studio_sdk/predictions/client.py +247 -101
  84. label_studio_sdk/projects/__init__.py +5 -1
  85. label_studio_sdk/projects/client.py +313 -115
  86. label_studio_sdk/projects/client_ext.py +16 -0
  87. label_studio_sdk/projects/exports/__init__.py +3 -0
  88. label_studio_sdk/projects/exports/client.py +447 -296
  89. label_studio_sdk/projects/exports/client_ext.py +200 -0
  90. label_studio_sdk/projects/exports/types/__init__.py +6 -0
  91. label_studio_sdk/projects/exports/types/exports_convert_response.py +24 -0
  92. label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +44 -0
  93. label_studio_sdk/projects/pauses/__init__.py +2 -0
  94. label_studio_sdk/projects/pauses/client.py +704 -0
  95. label_studio_sdk/projects/types/projects_create_response.py +29 -34
  96. label_studio_sdk/projects/types/projects_import_tasks_response.py +19 -29
  97. label_studio_sdk/projects/types/projects_list_response.py +11 -21
  98. label_studio_sdk/projects/types/projects_update_response.py +34 -34
  99. label_studio_sdk/prompts/client.py +309 -92
  100. label_studio_sdk/prompts/indicators/client.py +67 -23
  101. label_studio_sdk/prompts/runs/client.py +95 -40
  102. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +14 -24
  103. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_response.py +11 -21
  104. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +26 -29
  105. label_studio_sdk/prompts/types/prompts_batch_predictions_response.py +11 -21
  106. label_studio_sdk/prompts/versions/client.py +277 -88
  107. label_studio_sdk/tasks/client.py +263 -90
  108. label_studio_sdk/tasks/types/tasks_list_response.py +15 -25
  109. label_studio_sdk/tokens/__init__.py +2 -0
  110. label_studio_sdk/tokens/client.py +470 -0
  111. label_studio_sdk/tokens/client_ext.py +94 -0
  112. label_studio_sdk/types/__init__.py +20 -6
  113. label_studio_sdk/types/access_token_response.py +22 -0
  114. label_studio_sdk/types/annotation.py +29 -38
  115. label_studio_sdk/types/annotation_filter_options.py +14 -24
  116. label_studio_sdk/types/annotations_dm_field.py +30 -39
  117. label_studio_sdk/types/api_token_response.py +32 -0
  118. label_studio_sdk/types/azure_blob_export_storage.py +28 -37
  119. label_studio_sdk/types/azure_blob_import_storage.py +28 -37
  120. label_studio_sdk/types/base_task.py +30 -39
  121. label_studio_sdk/types/base_task_updated_by.py +3 -1
  122. label_studio_sdk/types/base_user.py +14 -21
  123. label_studio_sdk/types/comment.py +12 -21
  124. label_studio_sdk/types/comment_created_by.py +1 -1
  125. label_studio_sdk/types/converted_format.py +12 -22
  126. label_studio_sdk/types/data_manager_task_serializer.py +31 -40
  127. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +1 -1
  128. label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +13 -22
  129. label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +15 -24
  130. label_studio_sdk/types/export.py +17 -26
  131. label_studio_sdk/types/export_format.py +25 -0
  132. label_studio_sdk/types/export_snapshot.py +45 -0
  133. label_studio_sdk/types/export_snapshot_status.py +5 -0
  134. label_studio_sdk/types/file_upload.py +11 -21
  135. label_studio_sdk/types/filter.py +16 -26
  136. label_studio_sdk/types/filter_group.py +12 -22
  137. label_studio_sdk/types/gcs_export_storage.py +28 -37
  138. label_studio_sdk/types/gcs_import_storage.py +28 -37
  139. label_studio_sdk/types/inference_run.py +14 -23
  140. label_studio_sdk/types/inference_run_cost_estimate.py +17 -27
  141. label_studio_sdk/types/inference_run_created_by.py +1 -1
  142. label_studio_sdk/types/inference_run_organization.py +1 -1
  143. label_studio_sdk/types/jwt_settings_response.py +32 -0
  144. label_studio_sdk/types/key_indicator_value.py +12 -22
  145. label_studio_sdk/types/key_indicators.py +0 -1
  146. label_studio_sdk/types/key_indicators_item.py +15 -25
  147. label_studio_sdk/types/key_indicators_item_additional_kpis_item.py +13 -23
  148. label_studio_sdk/types/key_indicators_item_extra_kpis_item.py +13 -23
  149. label_studio_sdk/types/local_files_export_storage.py +25 -34
  150. label_studio_sdk/types/local_files_import_storage.py +24 -33
  151. label_studio_sdk/types/ml_backend.py +23 -32
  152. label_studio_sdk/types/model_provider_connection.py +22 -31
  153. label_studio_sdk/types/model_provider_connection_created_by.py +1 -1
  154. label_studio_sdk/types/model_provider_connection_organization.py +1 -1
  155. label_studio_sdk/types/model_provider_connection_provider.py +3 -1
  156. label_studio_sdk/types/pause.py +34 -0
  157. label_studio_sdk/types/pause_paused_by.py +5 -0
  158. label_studio_sdk/types/prediction.py +21 -30
  159. label_studio_sdk/types/project.py +58 -55
  160. label_studio_sdk/types/project_import.py +21 -30
  161. label_studio_sdk/types/project_label_config.py +12 -22
  162. label_studio_sdk/types/prompt.py +24 -32
  163. label_studio_sdk/types/prompt_associated_projects_item.py +6 -0
  164. label_studio_sdk/types/prompt_associated_projects_item_id.py +20 -0
  165. label_studio_sdk/types/prompt_created_by.py +1 -1
  166. label_studio_sdk/types/prompt_organization.py +1 -1
  167. label_studio_sdk/types/prompt_version.py +13 -22
  168. label_studio_sdk/types/prompt_version_created_by.py +1 -1
  169. label_studio_sdk/types/prompt_version_organization.py +1 -1
  170. label_studio_sdk/types/prompt_version_provider.py +3 -1
  171. label_studio_sdk/types/redis_export_storage.py +29 -38
  172. label_studio_sdk/types/redis_import_storage.py +28 -37
  173. label_studio_sdk/types/refined_prompt_response.py +19 -29
  174. label_studio_sdk/types/s3export_storage.py +36 -43
  175. label_studio_sdk/types/s3import_storage.py +37 -44
  176. label_studio_sdk/types/s3s_export_storage.py +26 -33
  177. label_studio_sdk/types/s3s_import_storage.py +35 -42
  178. label_studio_sdk/types/serialization_option.py +12 -22
  179. label_studio_sdk/types/serialization_options.py +18 -28
  180. label_studio_sdk/types/task.py +44 -47
  181. label_studio_sdk/types/task_annotators_item.py +1 -1
  182. label_studio_sdk/types/task_comment_authors_item.py +1 -1
  183. label_studio_sdk/types/task_filter_options.py +15 -25
  184. label_studio_sdk/types/user_simple.py +11 -21
  185. label_studio_sdk/types/view.py +16 -26
  186. label_studio_sdk/types/webhook.py +19 -28
  187. label_studio_sdk/types/webhook_serializer_for_update.py +19 -28
  188. label_studio_sdk/types/workspace.py +22 -31
  189. label_studio_sdk/users/client.py +257 -63
  190. label_studio_sdk/users/types/users_get_token_response.py +12 -22
  191. label_studio_sdk/users/types/users_reset_token_response.py +12 -22
  192. label_studio_sdk/version.py +0 -1
  193. label_studio_sdk/versions/__init__.py +5 -0
  194. label_studio_sdk/versions/client.py +112 -0
  195. label_studio_sdk/versions/types/__init__.py +6 -0
  196. label_studio_sdk/versions/types/versions_get_response.py +73 -0
  197. label_studio_sdk/versions/types/versions_get_response_edition.py +5 -0
  198. label_studio_sdk/views/client.py +219 -52
  199. label_studio_sdk/views/types/views_create_request_data.py +13 -23
  200. label_studio_sdk/views/types/views_create_request_data_filters.py +14 -24
  201. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +16 -26
  202. label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +3 -1
  203. label_studio_sdk/views/types/views_update_request_data.py +13 -23
  204. label_studio_sdk/views/types/views_update_request_data_filters.py +14 -24
  205. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +16 -26
  206. label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +3 -1
  207. label_studio_sdk/webhooks/client.py +191 -61
  208. label_studio_sdk/workspaces/client.py +164 -41
  209. label_studio_sdk/workspaces/members/client.py +109 -31
  210. label_studio_sdk/workspaces/members/types/members_create_response.py +12 -22
  211. label_studio_sdk/workspaces/members/types/members_list_response_item.py +12 -22
  212. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.dist-info}/METADATA +8 -5
  213. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.dist-info}/RECORD +215 -188
  214. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.dist-info}/WHEEL +1 -1
  215. label_studio_sdk/types/export_convert.py +0 -32
  216. label_studio_sdk/types/export_create.py +0 -54
  217. label_studio_sdk/types/export_create_status.py +0 -5
  218. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.11.dist-info}/LICENSE +0 -0
@@ -1,113 +1,104 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
5
+ import pydantic
6
+ import datetime as dt
8
7
  from .azure_blob_import_storage_status import AzureBlobImportStorageStatus
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
9
 
10
10
 
11
- class AzureBlobImportStorage(pydantic_v1.BaseModel):
11
+ class AzureBlobImportStorage(UniversalBaseModel):
12
12
  id: typing.Optional[int] = None
13
13
  type: typing.Optional[str] = None
14
14
  synchronizable: typing.Optional[bool] = None
15
15
  presign: typing.Optional[bool] = None
16
- container: typing.Optional[str] = pydantic_v1.Field(default=None)
16
+ container: typing.Optional[str] = pydantic.Field(default=None)
17
17
  """
18
18
  Azure blob container
19
19
  """
20
20
 
21
- prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
21
+ prefix: typing.Optional[str] = pydantic.Field(default=None)
22
22
  """
23
23
  Azure blob prefix name
24
24
  """
25
25
 
26
- regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
26
+ regex_filter: typing.Optional[str] = pydantic.Field(default=None)
27
27
  """
28
28
  Cloud storage regex for filtering objects
29
29
  """
30
30
 
31
- use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
31
+ use_blob_urls: typing.Optional[bool] = pydantic.Field(default=None)
32
32
  """
33
33
  Interpret objects as BLOBs and generate URLs
34
34
  """
35
35
 
36
- account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
36
+ account_name: typing.Optional[str] = pydantic.Field(default=None)
37
37
  """
38
38
  Azure Blob account name
39
39
  """
40
40
 
41
- account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
41
+ account_key: typing.Optional[str] = pydantic.Field(default=None)
42
42
  """
43
43
  Azure Blob account key
44
44
  """
45
45
 
46
- last_sync: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
46
+ last_sync: typing.Optional[dt.datetime] = pydantic.Field(default=None)
47
47
  """
48
48
  Last sync finished time
49
49
  """
50
50
 
51
- last_sync_count: typing.Optional[int] = pydantic_v1.Field(default=None)
51
+ last_sync_count: typing.Optional[int] = pydantic.Field(default=None)
52
52
  """
53
53
  Count of tasks synced last time
54
54
  """
55
55
 
56
- last_sync_job: typing.Optional[str] = pydantic_v1.Field(default=None)
56
+ last_sync_job: typing.Optional[str] = pydantic.Field(default=None)
57
57
  """
58
58
  Last sync job ID
59
59
  """
60
60
 
61
61
  status: typing.Optional[AzureBlobImportStorageStatus] = None
62
- traceback: typing.Optional[str] = pydantic_v1.Field(default=None)
62
+ traceback: typing.Optional[str] = pydantic.Field(default=None)
63
63
  """
64
64
  Traceback report for the last failed sync
65
65
  """
66
66
 
67
- meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
67
+ meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
68
68
  """
69
69
  Meta and debug information about storage processes
70
70
  """
71
71
 
72
- title: typing.Optional[str] = pydantic_v1.Field(default=None)
72
+ title: typing.Optional[str] = pydantic.Field(default=None)
73
73
  """
74
74
  Cloud storage title
75
75
  """
76
76
 
77
- description: typing.Optional[str] = pydantic_v1.Field(default=None)
77
+ description: typing.Optional[str] = pydantic.Field(default=None)
78
78
  """
79
79
  Cloud storage description
80
80
  """
81
81
 
82
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
82
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
83
83
  """
84
84
  Creation time
85
85
  """
86
86
 
87
- presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
87
+ presign_ttl: typing.Optional[int] = pydantic.Field(default=None)
88
88
  """
89
89
  Presigned URLs TTL (in minutes)
90
90
  """
91
91
 
92
- project: int = pydantic_v1.Field()
92
+ project: int = pydantic.Field()
93
93
  """
94
94
  A unique integer value identifying this project.
95
95
  """
96
96
 
97
- def json(self, **kwargs: typing.Any) -> str:
98
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
99
- return super().json(**kwargs_with_defaults)
100
-
101
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
102
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
103
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
104
-
105
- return deep_union_pydantic_dicts(
106
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
107
- )
97
+ if IS_PYDANTIC_V2:
98
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
99
+ else:
108
100
 
109
- class Config:
110
- frozen = True
111
- smart_union = True
112
- extra = pydantic_v1.Extra.allow
113
- json_encoders = {dt.datetime: serialize_datetime}
101
+ class Config:
102
+ frozen = True
103
+ smart_union = True
104
+ extra = pydantic.Extra.allow
@@ -1,115 +1,106 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
- from .base_task_file_upload import BaseTaskFileUpload
5
+ import pydantic
6
+ import datetime as dt
9
7
  from .base_task_updated_by import BaseTaskUpdatedBy
8
+ from .base_task_file_upload import BaseTaskFileUpload
9
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
10
10
 
11
11
 
12
- class BaseTask(pydantic_v1.BaseModel):
12
+ class BaseTask(UniversalBaseModel):
13
13
  id: typing.Optional[int] = None
14
- data: typing.Dict[str, typing.Any] = pydantic_v1.Field()
14
+ data: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
15
15
  """
16
16
  User imported or uploaded data for a task. Data is formatted according to the project label config. You can find examples of data for your project on the Import page in the Label Studio Data Manager UI.
17
17
  """
18
18
 
19
- meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
19
+ meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
20
20
  """
21
21
  Meta is user imported (uploaded) data and can be useful as input for an ML Backend for embeddings, advanced vectors, and other info. It is passed to ML during training/predicting steps.
22
22
  """
23
23
 
24
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
24
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
25
25
  """
26
26
  Time a task was created
27
27
  """
28
28
 
29
- updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
29
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
30
30
  """
31
31
  Last time a task was updated
32
32
  """
33
33
 
34
- is_labeled: typing.Optional[bool] = pydantic_v1.Field(default=None)
34
+ is_labeled: typing.Optional[bool] = pydantic.Field(default=None)
35
35
  """
36
36
  True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
37
37
  """
38
38
 
39
- overlap: typing.Optional[int] = pydantic_v1.Field(default=None)
39
+ overlap: typing.Optional[int] = pydantic.Field(default=None)
40
40
  """
41
41
  Number of distinct annotators that processed the current task
42
42
  """
43
43
 
44
- inner_id: typing.Optional[int] = pydantic_v1.Field(default=None)
44
+ inner_id: typing.Optional[int] = pydantic.Field(default=None)
45
45
  """
46
46
  Internal task ID in the project, starts with 1
47
47
  """
48
48
 
49
- total_annotations: typing.Optional[int] = pydantic_v1.Field(default=None)
49
+ total_annotations: typing.Optional[int] = pydantic.Field(default=None)
50
50
  """
51
51
  Number of total annotations for the current task except cancelled annotations
52
52
  """
53
53
 
54
- cancelled_annotations: typing.Optional[int] = pydantic_v1.Field(default=None)
54
+ cancelled_annotations: typing.Optional[int] = pydantic.Field(default=None)
55
55
  """
56
56
  Number of total cancelled annotations for the current task
57
57
  """
58
58
 
59
- total_predictions: typing.Optional[int] = pydantic_v1.Field(default=None)
59
+ total_predictions: typing.Optional[int] = pydantic.Field(default=None)
60
60
  """
61
61
  Number of total predictions for the current task
62
62
  """
63
63
 
64
- comment_count: typing.Optional[int] = pydantic_v1.Field(default=None)
64
+ comment_count: typing.Optional[int] = pydantic.Field(default=None)
65
65
  """
66
66
  Number of comments in the task including all annotations
67
67
  """
68
68
 
69
- unresolved_comment_count: typing.Optional[int] = pydantic_v1.Field(default=None)
69
+ unresolved_comment_count: typing.Optional[int] = pydantic.Field(default=None)
70
70
  """
71
71
  Number of unresolved comments in the task including all annotations
72
72
  """
73
73
 
74
- last_comment_updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
74
+ last_comment_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
75
75
  """
76
76
  When the last comment was updated
77
77
  """
78
78
 
79
- project: typing.Optional[int] = pydantic_v1.Field(default=None)
79
+ project: typing.Optional[int] = pydantic.Field(default=None)
80
80
  """
81
81
  Project ID for this task
82
82
  """
83
83
 
84
- updated_by: typing.Optional[BaseTaskUpdatedBy] = pydantic_v1.Field(default=None)
84
+ updated_by: typing.Optional[BaseTaskUpdatedBy] = pydantic.Field(default=None)
85
85
  """
86
86
  Last annotator or reviewer who updated this task
87
87
  """
88
88
 
89
- file_upload: typing.Optional[BaseTaskFileUpload] = pydantic_v1.Field(default=None)
89
+ file_upload: typing.Optional[BaseTaskFileUpload] = pydantic.Field(default=None)
90
90
  """
91
91
  Uploaded file used as data source for this task
92
92
  """
93
93
 
94
- comment_authors: typing.Optional[typing.List[int]] = pydantic_v1.Field(default=None)
94
+ comment_authors: typing.Optional[typing.List[int]] = pydantic.Field(default=None)
95
95
  """
96
96
  Users who wrote comments
97
97
  """
98
98
 
99
- def json(self, **kwargs: typing.Any) -> str:
100
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
101
- return super().json(**kwargs_with_defaults)
102
-
103
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
104
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
105
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
106
-
107
- return deep_union_pydantic_dicts(
108
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
109
- )
99
+ if IS_PYDANTIC_V2:
100
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
101
+ else:
110
102
 
111
- class Config:
112
- frozen = True
113
- smart_union = True
114
- extra = pydantic_v1.Extra.allow
115
- json_encoders = {dt.datetime: serialize_datetime}
103
+ class Config:
104
+ frozen = True
105
+ smart_union = True
106
+ extra = pydantic.Extra.allow
@@ -2,4 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- BaseTaskUpdatedBy = typing.Union[typing.Optional[int], typing.Optional[typing.List[typing.Dict[str, typing.Any]]]]
5
+ BaseTaskUpdatedBy = typing.Union[
6
+ typing.Optional[int], typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]]
7
+ ]
@@ -1,13 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
5
+ import datetime as dt
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
8
 
9
9
 
10
- class BaseUser(pydantic_v1.BaseModel):
10
+ class BaseUser(UniversalBaseModel):
11
11
  id: typing.Optional[int] = None
12
12
  first_name: typing.Optional[str] = None
13
13
  last_name: typing.Optional[str] = None
@@ -18,25 +18,18 @@ class BaseUser(pydantic_v1.BaseModel):
18
18
  initials: typing.Optional[str] = None
19
19
  phone: typing.Optional[str] = None
20
20
  active_organization: typing.Optional[int] = None
21
- allow_newsletters: typing.Optional[bool] = pydantic_v1.Field(default=None)
21
+ allow_newsletters: typing.Optional[bool] = pydantic.Field(default=None)
22
22
  """
23
23
  Allow sending newsletters to user
24
24
  """
25
25
 
26
- def json(self, **kwargs: typing.Any) -> str:
27
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28
- return super().json(**kwargs_with_defaults)
29
-
30
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
26
+ date_joined: typing.Optional[dt.datetime] = None
33
27
 
34
- return deep_union_pydantic_dicts(
35
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
36
- )
28
+ if IS_PYDANTIC_V2:
29
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
30
+ else:
37
31
 
38
- class Config:
39
- frozen = True
40
- smart_union = True
41
- extra = pydantic_v1.Extra.allow
42
- json_encoders = {dt.datetime: serialize_datetime}
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -1,14 +1,14 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ from .comment_created_by import CommentCreatedBy
3
5
  import datetime as dt
4
6
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
- from .comment_created_by import CommentCreatedBy
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
9
 
10
10
 
11
- class Comment(pydantic_v1.BaseModel):
11
+ class Comment(UniversalBaseModel):
12
12
  id: int
13
13
  text: str
14
14
  project: int
@@ -20,20 +20,11 @@ class Comment(pydantic_v1.BaseModel):
20
20
  is_resolved: typing.Optional[bool] = None
21
21
  resolved_at: typing.Optional[dt.datetime] = None
22
22
 
23
- def json(self, **kwargs: typing.Any) -> str:
24
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
- return super().json(**kwargs_with_defaults)
26
-
27
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
-
31
- return deep_union_pydantic_dicts(
32
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33
- )
23
+ if IS_PYDANTIC_V2:
24
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
25
+ else:
34
26
 
35
- class Config:
36
- frozen = True
37
- smart_union = True
38
- extra = pydantic_v1.Extra.allow
39
- json_encoders = {dt.datetime: serialize_datetime}
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- CommentCreatedBy = typing.Union[int, typing.Dict[str, typing.Any]]
5
+ CommentCreatedBy = typing.Union[int, typing.Dict[str, typing.Optional[typing.Any]]]
@@ -1,36 +1,26 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
5
  from .converted_format_status import ConvertedFormatStatus
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
8
 
10
9
 
11
- class ConvertedFormat(pydantic_v1.BaseModel):
10
+ class ConvertedFormat(UniversalBaseModel):
12
11
  id: typing.Optional[int] = None
13
12
  status: typing.Optional[ConvertedFormatStatus] = None
14
13
  export_type: str
15
- traceback: typing.Optional[str] = pydantic_v1.Field(default=None)
14
+ traceback: typing.Optional[str] = pydantic.Field(default=None)
16
15
  """
17
16
  Traceback report in case of errors
18
17
  """
19
18
 
20
- def json(self, **kwargs: typing.Any) -> str:
21
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22
- return super().json(**kwargs_with_defaults)
23
-
24
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
27
-
28
- return deep_union_pydantic_dicts(
29
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
30
- )
19
+ if IS_PYDANTIC_V2:
20
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
+ else:
31
22
 
32
- class Config:
33
- frozen = True
34
- smart_union = True
35
- extra = pydantic_v1.Extra.allow
36
- json_encoders = {dt.datetime: serialize_datetime}
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -1,32 +1,30 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
5
+ from .data_manager_task_serializer_predictions_item import DataManagerTaskSerializerPredictionsItem
6
+ import pydantic
8
7
  from .annotations_dm_field import AnnotationsDmField
9
- from .data_manager_task_serializer_annotators_item import DataManagerTaskSerializerAnnotatorsItem
10
8
  from .data_manager_task_serializer_drafts_item import DataManagerTaskSerializerDraftsItem
11
- from .data_manager_task_serializer_predictions_item import DataManagerTaskSerializerPredictionsItem
9
+ from .data_manager_task_serializer_annotators_item import DataManagerTaskSerializerAnnotatorsItem
10
+ import datetime as dt
11
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
12
12
 
13
13
 
14
- class DataManagerTaskSerializer(pydantic_v1.BaseModel):
14
+ class DataManagerTaskSerializer(UniversalBaseModel):
15
15
  id: typing.Optional[int] = None
16
- predictions: typing.Optional[typing.List[DataManagerTaskSerializerPredictionsItem]] = pydantic_v1.Field(
17
- default=None
18
- )
16
+ predictions: typing.Optional[typing.List[DataManagerTaskSerializerPredictionsItem]] = pydantic.Field(default=None)
19
17
  """
20
18
  Predictions for this task
21
19
  """
22
20
 
23
21
  annotations: typing.Optional[typing.List[AnnotationsDmField]] = None
24
- drafts: typing.Optional[typing.List[DataManagerTaskSerializerDraftsItem]] = pydantic_v1.Field(default=None)
22
+ drafts: typing.Optional[typing.List[DataManagerTaskSerializerDraftsItem]] = pydantic.Field(default=None)
25
23
  """
26
24
  Drafts for this task
27
25
  """
28
26
 
29
- annotators: typing.Optional[typing.List[DataManagerTaskSerializerAnnotatorsItem]] = pydantic_v1.Field(default=None)
27
+ annotators: typing.Optional[typing.List[DataManagerTaskSerializerAnnotatorsItem]] = pydantic.Field(default=None)
30
28
  """
31
29
  Annotators who annotated this task
32
30
  """
@@ -45,80 +43,73 @@ class DataManagerTaskSerializer(pydantic_v1.BaseModel):
45
43
  predictions_model_versions: typing.Optional[str] = None
46
44
  avg_lead_time: typing.Optional[float] = None
47
45
  draft_exists: typing.Optional[bool] = None
48
- updated_by: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic_v1.Field(default=None)
46
+ updated_by: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
47
+ default=None
48
+ )
49
49
  """
50
50
  User IDs who updated this task
51
51
  """
52
52
 
53
- data: typing.Dict[str, typing.Any] = pydantic_v1.Field()
53
+ data: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
54
54
  """
55
55
  User imported or uploaded data for a task. Data is formatted according to the project label config. You can find examples of data for your project on the Import page in the Label Studio Data Manager UI.
56
56
  """
57
57
 
58
- meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
58
+ meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
59
59
  """
60
60
  Meta is user imported (uploaded) data and can be useful as input for an ML Backend for embeddings, advanced vectors, and other info. It is passed to ML during training/predicting steps.
61
61
  """
62
62
 
63
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
63
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
64
64
  """
65
65
  Time a task was created
66
66
  """
67
67
 
68
- updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
68
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
69
69
  """
70
70
  Last time a task was updated
71
71
  """
72
72
 
73
- is_labeled: typing.Optional[bool] = pydantic_v1.Field(default=None)
73
+ is_labeled: typing.Optional[bool] = pydantic.Field(default=None)
74
74
  """
75
75
  True if the number of annotations for this task is greater than or equal to the number of maximum_completions for the project
76
76
  """
77
77
 
78
- overlap: typing.Optional[int] = pydantic_v1.Field(default=None)
78
+ overlap: typing.Optional[int] = pydantic.Field(default=None)
79
79
  """
80
80
  Number of distinct annotators that processed the current task
81
81
  """
82
82
 
83
- comment_count: typing.Optional[int] = pydantic_v1.Field(default=None)
83
+ comment_count: typing.Optional[int] = pydantic.Field(default=None)
84
84
  """
85
85
  Number of comments in the task including all annotations
86
86
  """
87
87
 
88
- unresolved_comment_count: typing.Optional[int] = pydantic_v1.Field(default=None)
88
+ unresolved_comment_count: typing.Optional[int] = pydantic.Field(default=None)
89
89
  """
90
90
  Number of unresolved comments in the task including all annotations
91
91
  """
92
92
 
93
- last_comment_updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
93
+ last_comment_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
94
94
  """
95
95
  When the last comment was updated
96
96
  """
97
97
 
98
- project: typing.Optional[int] = pydantic_v1.Field(default=None)
98
+ project: typing.Optional[int] = pydantic.Field(default=None)
99
99
  """
100
100
  Project ID for this task
101
101
  """
102
102
 
103
- comment_authors: typing.Optional[typing.List[int]] = pydantic_v1.Field(default=None)
103
+ comment_authors: typing.Optional[typing.List[int]] = pydantic.Field(default=None)
104
104
  """
105
105
  Users who wrote comments
106
106
  """
107
107
 
108
- def json(self, **kwargs: typing.Any) -> str:
109
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
110
- return super().json(**kwargs_with_defaults)
111
-
112
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
113
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
114
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
115
-
116
- return deep_union_pydantic_dicts(
117
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
118
- )
108
+ if IS_PYDANTIC_V2:
109
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
110
+ else:
119
111
 
120
- class Config:
121
- frozen = True
122
- smart_union = True
123
- extra = pydantic_v1.Extra.allow
124
- json_encoders = {dt.datetime: serialize_datetime}
112
+ class Config:
113
+ frozen = True
114
+ smart_union = True
115
+ extra = pydantic.Extra.allow
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- DataManagerTaskSerializerAnnotatorsItem = typing.Union[int, typing.Dict[str, typing.Any]]
5
+ DataManagerTaskSerializerAnnotatorsItem = typing.Union[int, typing.Dict[str, typing.Optional[typing.Any]]]
@@ -1,31 +1,22 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
5
+ import datetime as dt
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
8
 
9
9
 
10
- class DataManagerTaskSerializerDraftsItem(pydantic_v1.BaseModel):
11
- result: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None
10
+ class DataManagerTaskSerializerDraftsItem(UniversalBaseModel):
11
+ result: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
12
12
  created_at: typing.Optional[dt.datetime] = None
13
13
  updated_at: typing.Optional[dt.datetime] = None
14
14
 
15
- def json(self, **kwargs: typing.Any) -> str:
16
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17
- return super().json(**kwargs_with_defaults)
18
-
19
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
-
23
- return deep_union_pydantic_dicts(
24
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25
- )
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
26
18
 
27
- class Config:
28
- frozen = True
29
- smart_union = True
30
- extra = pydantic_v1.Extra.allow
31
- json_encoders = {dt.datetime: serialize_datetime}
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow