label-studio-sdk 1.0.8__py3-none-any.whl → 1.0.10__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 (200) hide show
  1. label_studio_sdk/__init__.py +20 -7
  2. label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +16 -4
  3. label_studio_sdk/_extensions/pager_ext.py +8 -0
  4. label_studio_sdk/actions/client.py +91 -40
  5. label_studio_sdk/actions/types/actions_create_request_filters.py +14 -24
  6. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +16 -26
  7. label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +3 -1
  8. label_studio_sdk/actions/types/actions_create_request_selected_items.py +1 -2
  9. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +15 -25
  10. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +15 -25
  11. label_studio_sdk/annotations/__init__.py +2 -2
  12. label_studio_sdk/annotations/client.py +278 -104
  13. label_studio_sdk/annotations/types/__init__.py +2 -1
  14. label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +34 -0
  15. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +11 -21
  16. label_studio_sdk/base_client.py +46 -27
  17. label_studio_sdk/client.py +1 -0
  18. label_studio_sdk/comments/client.py +190 -44
  19. label_studio_sdk/converter/converter.py +56 -13
  20. label_studio_sdk/converter/imports/yolo.py +1 -1
  21. label_studio_sdk/converter/utils.py +3 -2
  22. label_studio_sdk/core/__init__.py +21 -4
  23. label_studio_sdk/core/client_wrapper.py +9 -10
  24. label_studio_sdk/core/file.py +37 -8
  25. label_studio_sdk/core/http_client.py +52 -28
  26. label_studio_sdk/core/jsonable_encoder.py +33 -31
  27. label_studio_sdk/core/pagination.py +5 -4
  28. label_studio_sdk/core/pydantic_utilities.py +272 -4
  29. label_studio_sdk/core/query_encoder.py +38 -13
  30. label_studio_sdk/core/request_options.py +3 -0
  31. label_studio_sdk/core/serialization.py +272 -0
  32. label_studio_sdk/errors/bad_request_error.py +2 -3
  33. label_studio_sdk/export_storage/azure/client.py +228 -58
  34. label_studio_sdk/export_storage/azure/types/azure_create_response.py +19 -29
  35. label_studio_sdk/export_storage/azure/types/azure_update_response.py +19 -29
  36. label_studio_sdk/export_storage/client.py +48 -18
  37. label_studio_sdk/export_storage/gcs/client.py +228 -58
  38. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +19 -29
  39. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +19 -29
  40. label_studio_sdk/export_storage/local/client.py +222 -56
  41. label_studio_sdk/export_storage/local/types/local_create_response.py +17 -27
  42. label_studio_sdk/export_storage/local/types/local_update_response.py +17 -27
  43. label_studio_sdk/export_storage/redis/client.py +228 -58
  44. label_studio_sdk/export_storage/redis/types/redis_create_response.py +20 -30
  45. label_studio_sdk/export_storage/redis/types/redis_update_response.py +20 -30
  46. label_studio_sdk/export_storage/s3/client.py +228 -58
  47. label_studio_sdk/export_storage/s3/types/s3create_response.py +27 -35
  48. label_studio_sdk/export_storage/s3/types/s3update_response.py +27 -35
  49. label_studio_sdk/export_storage/s3s/client.py +187 -43
  50. label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +11 -21
  51. label_studio_sdk/files/client.py +172 -56
  52. label_studio_sdk/import_storage/azure/client.py +223 -53
  53. label_studio_sdk/import_storage/azure/types/azure_create_response.py +22 -32
  54. label_studio_sdk/import_storage/azure/types/azure_update_response.py +22 -32
  55. label_studio_sdk/import_storage/client.py +48 -18
  56. label_studio_sdk/import_storage/gcs/client.py +223 -53
  57. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +22 -32
  58. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +22 -32
  59. label_studio_sdk/import_storage/local/client.py +223 -53
  60. label_studio_sdk/import_storage/local/types/local_create_response.py +17 -27
  61. label_studio_sdk/import_storage/local/types/local_update_response.py +17 -27
  62. label_studio_sdk/import_storage/redis/client.py +223 -53
  63. label_studio_sdk/import_storage/redis/types/redis_create_response.py +20 -30
  64. label_studio_sdk/import_storage/redis/types/redis_update_response.py +20 -30
  65. label_studio_sdk/import_storage/s3/client.py +223 -53
  66. label_studio_sdk/import_storage/s3/types/s3create_response.py +31 -39
  67. label_studio_sdk/import_storage/s3/types/s3update_response.py +31 -39
  68. label_studio_sdk/import_storage/s3s/client.py +222 -52
  69. label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +11 -21
  70. label_studio_sdk/label_interface/control_tags.py +1 -1
  71. label_studio_sdk/ml/client.py +280 -78
  72. label_studio_sdk/ml/types/ml_create_response.py +21 -31
  73. label_studio_sdk/ml/types/ml_update_response.py +21 -31
  74. label_studio_sdk/model_providers/client.py +173 -56
  75. label_studio_sdk/predictions/client.py +247 -101
  76. label_studio_sdk/projects/__init__.py +3 -0
  77. label_studio_sdk/projects/client.py +309 -115
  78. label_studio_sdk/projects/client_ext.py +16 -0
  79. label_studio_sdk/projects/exports/__init__.py +3 -0
  80. label_studio_sdk/projects/exports/client.py +447 -296
  81. label_studio_sdk/projects/exports/client_ext.py +134 -0
  82. label_studio_sdk/projects/exports/types/__init__.py +6 -0
  83. label_studio_sdk/projects/exports/types/exports_convert_response.py +24 -0
  84. label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +44 -0
  85. label_studio_sdk/projects/types/projects_create_response.py +29 -34
  86. label_studio_sdk/projects/types/projects_import_tasks_response.py +19 -29
  87. label_studio_sdk/projects/types/projects_list_response.py +11 -21
  88. label_studio_sdk/projects/types/projects_update_response.py +24 -34
  89. label_studio_sdk/prompts/client.py +309 -92
  90. label_studio_sdk/prompts/indicators/client.py +67 -23
  91. label_studio_sdk/prompts/runs/client.py +95 -40
  92. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +14 -24
  93. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_response.py +11 -21
  94. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +26 -29
  95. label_studio_sdk/prompts/types/prompts_batch_predictions_response.py +11 -21
  96. label_studio_sdk/prompts/versions/client.py +277 -88
  97. label_studio_sdk/tasks/client.py +263 -90
  98. label_studio_sdk/tasks/types/tasks_list_response.py +15 -25
  99. label_studio_sdk/types/__init__.py +10 -6
  100. label_studio_sdk/types/annotation.py +29 -38
  101. label_studio_sdk/types/annotation_filter_options.py +14 -24
  102. label_studio_sdk/types/annotations_dm_field.py +30 -39
  103. label_studio_sdk/types/azure_blob_export_storage.py +28 -37
  104. label_studio_sdk/types/azure_blob_import_storage.py +28 -37
  105. label_studio_sdk/types/base_task.py +30 -39
  106. label_studio_sdk/types/base_task_updated_by.py +3 -1
  107. label_studio_sdk/types/base_user.py +14 -21
  108. label_studio_sdk/types/comment.py +12 -21
  109. label_studio_sdk/types/comment_created_by.py +1 -1
  110. label_studio_sdk/types/converted_format.py +12 -22
  111. label_studio_sdk/types/data_manager_task_serializer.py +31 -40
  112. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +1 -1
  113. label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +13 -22
  114. label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +15 -24
  115. label_studio_sdk/types/export.py +17 -26
  116. label_studio_sdk/types/export_format.py +25 -0
  117. label_studio_sdk/types/export_snapshot.py +45 -0
  118. label_studio_sdk/types/export_snapshot_status.py +5 -0
  119. label_studio_sdk/types/file_upload.py +11 -21
  120. label_studio_sdk/types/filter.py +16 -26
  121. label_studio_sdk/types/filter_group.py +12 -22
  122. label_studio_sdk/types/gcs_export_storage.py +28 -37
  123. label_studio_sdk/types/gcs_import_storage.py +28 -37
  124. label_studio_sdk/types/inference_run.py +14 -23
  125. label_studio_sdk/types/inference_run_cost_estimate.py +17 -27
  126. label_studio_sdk/types/inference_run_created_by.py +1 -1
  127. label_studio_sdk/types/inference_run_organization.py +1 -1
  128. label_studio_sdk/types/key_indicator_value.py +12 -22
  129. label_studio_sdk/types/key_indicators.py +0 -1
  130. label_studio_sdk/types/key_indicators_item.py +15 -25
  131. label_studio_sdk/types/key_indicators_item_additional_kpis_item.py +13 -23
  132. label_studio_sdk/types/key_indicators_item_extra_kpis_item.py +13 -23
  133. label_studio_sdk/types/local_files_export_storage.py +25 -34
  134. label_studio_sdk/types/local_files_import_storage.py +24 -33
  135. label_studio_sdk/types/ml_backend.py +23 -32
  136. label_studio_sdk/types/model_provider_connection.py +22 -31
  137. label_studio_sdk/types/model_provider_connection_created_by.py +1 -1
  138. label_studio_sdk/types/model_provider_connection_organization.py +1 -1
  139. label_studio_sdk/types/model_provider_connection_provider.py +3 -1
  140. label_studio_sdk/types/prediction.py +21 -30
  141. label_studio_sdk/types/project.py +48 -55
  142. label_studio_sdk/types/project_import.py +21 -30
  143. label_studio_sdk/types/project_label_config.py +12 -22
  144. label_studio_sdk/types/prompt.py +24 -32
  145. label_studio_sdk/types/prompt_associated_projects_item.py +6 -0
  146. label_studio_sdk/types/prompt_associated_projects_item_id.py +20 -0
  147. label_studio_sdk/types/prompt_created_by.py +1 -1
  148. label_studio_sdk/types/prompt_organization.py +1 -1
  149. label_studio_sdk/types/prompt_version.py +13 -22
  150. label_studio_sdk/types/prompt_version_created_by.py +1 -1
  151. label_studio_sdk/types/prompt_version_organization.py +1 -1
  152. label_studio_sdk/types/prompt_version_provider.py +3 -1
  153. label_studio_sdk/types/redis_export_storage.py +29 -38
  154. label_studio_sdk/types/redis_import_storage.py +28 -37
  155. label_studio_sdk/types/refined_prompt_response.py +19 -29
  156. label_studio_sdk/types/s3export_storage.py +36 -43
  157. label_studio_sdk/types/s3import_storage.py +37 -44
  158. label_studio_sdk/types/s3s_export_storage.py +26 -33
  159. label_studio_sdk/types/s3s_import_storage.py +35 -42
  160. label_studio_sdk/types/serialization_option.py +12 -22
  161. label_studio_sdk/types/serialization_options.py +18 -28
  162. label_studio_sdk/types/task.py +44 -47
  163. label_studio_sdk/types/task_annotators_item.py +1 -1
  164. label_studio_sdk/types/task_comment_authors_item.py +1 -1
  165. label_studio_sdk/types/task_filter_options.py +15 -25
  166. label_studio_sdk/types/user_simple.py +11 -21
  167. label_studio_sdk/types/view.py +16 -26
  168. label_studio_sdk/types/webhook.py +19 -28
  169. label_studio_sdk/types/webhook_serializer_for_update.py +19 -28
  170. label_studio_sdk/types/workspace.py +22 -31
  171. label_studio_sdk/users/client.py +257 -63
  172. label_studio_sdk/users/types/users_get_token_response.py +12 -22
  173. label_studio_sdk/users/types/users_reset_token_response.py +12 -22
  174. label_studio_sdk/version.py +0 -1
  175. label_studio_sdk/versions/__init__.py +5 -0
  176. label_studio_sdk/versions/client.py +112 -0
  177. label_studio_sdk/versions/types/__init__.py +6 -0
  178. label_studio_sdk/versions/types/versions_get_response.py +73 -0
  179. label_studio_sdk/versions/types/versions_get_response_edition.py +5 -0
  180. label_studio_sdk/views/client.py +219 -52
  181. label_studio_sdk/views/types/views_create_request_data.py +13 -23
  182. label_studio_sdk/views/types/views_create_request_data_filters.py +14 -24
  183. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +16 -26
  184. label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +3 -1
  185. label_studio_sdk/views/types/views_update_request_data.py +13 -23
  186. label_studio_sdk/views/types/views_update_request_data_filters.py +14 -24
  187. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +16 -26
  188. label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +3 -1
  189. label_studio_sdk/webhooks/client.py +191 -61
  190. label_studio_sdk/workspaces/client.py +164 -41
  191. label_studio_sdk/workspaces/members/client.py +109 -31
  192. label_studio_sdk/workspaces/members/types/members_create_response.py +12 -22
  193. label_studio_sdk/workspaces/members/types/members_list_response_item.py +12 -22
  194. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.10.dist-info}/METADATA +7 -5
  195. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.10.dist-info}/RECORD +197 -184
  196. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.10.dist-info}/WHEEL +1 -1
  197. label_studio_sdk/types/export_convert.py +0 -32
  198. label_studio_sdk/types/export_create.py +0 -54
  199. label_studio_sdk/types/export_create_status.py +0 -5
  200. {label_studio_sdk-1.0.8.dist-info → label_studio_sdk-1.0.10.dist-info}/LICENSE +0 -0
@@ -1,48 +1,38 @@
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 ...types.task import Task
6
+ import pydantic
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
9
8
 
10
9
 
11
- class TasksListResponse(pydantic_v1.BaseModel):
12
- tasks: typing.Optional[typing.List[Task]] = pydantic_v1.Field(default=None)
10
+ class TasksListResponse(UniversalBaseModel):
11
+ tasks: typing.Optional[typing.List[Task]] = pydantic.Field(default=None)
13
12
  """
14
13
  List of tasks, each task contains predictions and annotations if `fields` query parameter is set to `all`
15
14
  """
16
15
 
17
- total: typing.Optional[int] = pydantic_v1.Field(default=None)
16
+ total: typing.Optional[int] = pydantic.Field(default=None)
18
17
  """
19
18
  Total number of tasks
20
19
  """
21
20
 
22
- total_annotations: typing.Optional[int] = pydantic_v1.Field(default=None)
21
+ total_annotations: typing.Optional[int] = pydantic.Field(default=None)
23
22
  """
24
23
  Total number of annotations
25
24
  """
26
25
 
27
- total_predictions: typing.Optional[int] = pydantic_v1.Field(default=None)
26
+ total_predictions: typing.Optional[int] = pydantic.Field(default=None)
28
27
  """
29
28
  Total number of predictions
30
29
  """
31
30
 
32
- def json(self, **kwargs: typing.Any) -> str:
33
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
34
- return super().json(**kwargs_with_defaults)
35
-
36
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
37
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
38
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
39
-
40
- return deep_union_pydantic_dicts(
41
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
42
- )
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
43
34
 
44
- class Config:
45
- frozen = True
46
- smart_union = True
47
- extra = pydantic_v1.Extra.allow
48
- json_encoders = {dt.datetime: serialize_datetime}
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow
@@ -22,9 +22,9 @@ from .data_manager_task_serializer_annotators_item import DataManagerTaskSeriali
22
22
  from .data_manager_task_serializer_drafts_item import DataManagerTaskSerializerDraftsItem
23
23
  from .data_manager_task_serializer_predictions_item import DataManagerTaskSerializerPredictionsItem
24
24
  from .export import Export
25
- from .export_convert import ExportConvert
26
- from .export_create import ExportCreate
27
- from .export_create_status import ExportCreateStatus
25
+ from .export_format import ExportFormat
26
+ from .export_snapshot import ExportSnapshot
27
+ from .export_snapshot_status import ExportSnapshotStatus
28
28
  from .export_status import ExportStatus
29
29
  from .file_upload import FileUpload
30
30
  from .filter import Filter
@@ -65,6 +65,8 @@ from .project_label_config import ProjectLabelConfig
65
65
  from .project_sampling import ProjectSampling
66
66
  from .project_skip_queue import ProjectSkipQueue
67
67
  from .prompt import Prompt
68
+ from .prompt_associated_projects_item import PromptAssociatedProjectsItem
69
+ from .prompt_associated_projects_item_id import PromptAssociatedProjectsItemId
68
70
  from .prompt_created_by import PromptCreatedBy
69
71
  from .prompt_organization import PromptOrganization
70
72
  from .prompt_version import PromptVersion
@@ -121,9 +123,9 @@ __all__ = [
121
123
  "DataManagerTaskSerializerDraftsItem",
122
124
  "DataManagerTaskSerializerPredictionsItem",
123
125
  "Export",
124
- "ExportConvert",
125
- "ExportCreate",
126
- "ExportCreateStatus",
126
+ "ExportFormat",
127
+ "ExportSnapshot",
128
+ "ExportSnapshotStatus",
127
129
  "ExportStatus",
128
130
  "FileUpload",
129
131
  "Filter",
@@ -164,6 +166,8 @@ __all__ = [
164
166
  "ProjectSampling",
165
167
  "ProjectSkipQueue",
166
168
  "Prompt",
169
+ "PromptAssociatedProjectsItem",
170
+ "PromptAssociatedProjectsItemId",
167
171
  "PromptCreatedBy",
168
172
  "PromptOrganization",
169
173
  "PromptVersion",
@@ -1,116 +1,107 @@
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 .annotation_last_action import AnnotationLastAction
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
9
 
10
10
 
11
- class Annotation(pydantic_v1.BaseModel):
11
+ class Annotation(UniversalBaseModel):
12
12
  id: typing.Optional[int] = None
13
- result: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic_v1.Field(default=None)
13
+ result: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
14
14
  """
15
15
  List of annotation results for the task
16
16
  """
17
17
 
18
- created_username: typing.Optional[str] = pydantic_v1.Field(default=None)
18
+ created_username: typing.Optional[str] = pydantic.Field(default=None)
19
19
  """
20
20
  Username string
21
21
  """
22
22
 
23
- created_ago: typing.Optional[str] = pydantic_v1.Field(default=None)
23
+ created_ago: typing.Optional[str] = pydantic.Field(default=None)
24
24
  """
25
25
  Time delta from creation time
26
26
  """
27
27
 
28
28
  completed_by: typing.Optional[int] = None
29
29
  unique_id: typing.Optional[str] = None
30
- was_cancelled: typing.Optional[bool] = pydantic_v1.Field(default=None)
30
+ was_cancelled: typing.Optional[bool] = pydantic.Field(default=None)
31
31
  """
32
32
  User skipped the task
33
33
  """
34
34
 
35
- ground_truth: typing.Optional[bool] = pydantic_v1.Field(default=None)
35
+ ground_truth: typing.Optional[bool] = pydantic.Field(default=None)
36
36
  """
37
37
  This annotation is a Ground Truth (ground_truth)
38
38
  """
39
39
 
40
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
40
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
41
41
  """
42
42
  Creation time
43
43
  """
44
44
 
45
- updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
45
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
46
46
  """
47
47
  Last updated time
48
48
  """
49
49
 
50
- draft_created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
50
+ draft_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
51
51
  """
52
52
  Draft creation time
53
53
  """
54
54
 
55
- lead_time: typing.Optional[float] = pydantic_v1.Field(default=None)
55
+ lead_time: typing.Optional[float] = pydantic.Field(default=None)
56
56
  """
57
57
  How much time it took to annotate the task
58
58
  """
59
59
 
60
- import_id: typing.Optional[int] = pydantic_v1.Field(default=None)
60
+ import_id: typing.Optional[int] = pydantic.Field(default=None)
61
61
  """
62
62
  Original annotation ID that was at the import step or NULL if this annotation wasn't imported
63
63
  """
64
64
 
65
- last_action: typing.Optional[AnnotationLastAction] = pydantic_v1.Field(default=None)
65
+ last_action: typing.Optional[AnnotationLastAction] = pydantic.Field(default=None)
66
66
  """
67
67
  Action which was performed in the last annotation history item
68
68
  """
69
69
 
70
- task: typing.Optional[int] = pydantic_v1.Field(default=None)
70
+ task: typing.Optional[int] = pydantic.Field(default=None)
71
71
  """
72
72
  Corresponding task for this annotation
73
73
  """
74
74
 
75
- project: typing.Optional[int] = pydantic_v1.Field(default=None)
75
+ project: typing.Optional[int] = pydantic.Field(default=None)
76
76
  """
77
77
  Project ID for this annotation
78
78
  """
79
79
 
80
- updated_by: typing.Optional[int] = pydantic_v1.Field(default=None)
80
+ updated_by: typing.Optional[int] = pydantic.Field(default=None)
81
81
  """
82
82
  Last user who updated this annotation
83
83
  """
84
84
 
85
- parent_prediction: typing.Optional[int] = pydantic_v1.Field(default=None)
85
+ parent_prediction: typing.Optional[int] = pydantic.Field(default=None)
86
86
  """
87
87
  Points to the prediction from which this annotation was created
88
88
  """
89
89
 
90
- parent_annotation: typing.Optional[int] = pydantic_v1.Field(default=None)
90
+ parent_annotation: typing.Optional[int] = pydantic.Field(default=None)
91
91
  """
92
92
  Points to the parent annotation from which this annotation was created
93
93
  """
94
94
 
95
- last_created_by: typing.Optional[int] = pydantic_v1.Field(default=None)
95
+ last_created_by: typing.Optional[int] = pydantic.Field(default=None)
96
96
  """
97
97
  User who created the last annotation history item
98
98
  """
99
99
 
100
- def json(self, **kwargs: typing.Any) -> str:
101
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
102
- return super().json(**kwargs_with_defaults)
103
-
104
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
105
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
106
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
107
-
108
- return deep_union_pydantic_dicts(
109
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
110
- )
100
+ if IS_PYDANTIC_V2:
101
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
102
+ else:
111
103
 
112
- class Config:
113
- frozen = True
114
- smart_union = True
115
- extra = pydantic_v1.Extra.allow
116
- json_encoders = {dt.datetime: serialize_datetime}
104
+ class Config:
105
+ frozen = True
106
+ smart_union = True
107
+ extra = pydantic.Extra.allow
@@ -1,42 +1,32 @@
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
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
5
7
 
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
-
10
- class AnnotationFilterOptions(pydantic_v1.BaseModel):
11
- usual: typing.Optional[bool] = pydantic_v1.Field(default=None)
9
+ class AnnotationFilterOptions(UniversalBaseModel):
10
+ usual: typing.Optional[bool] = pydantic.Field(default=None)
12
11
  """
13
12
  Include not skipped and not ground truth annotations
14
13
  """
15
14
 
16
- ground_truth: typing.Optional[bool] = pydantic_v1.Field(default=None)
15
+ ground_truth: typing.Optional[bool] = pydantic.Field(default=None)
17
16
  """
18
17
  Include ground truth annotations
19
18
  """
20
19
 
21
- skipped: typing.Optional[bool] = pydantic_v1.Field(default=None)
20
+ skipped: typing.Optional[bool] = pydantic.Field(default=None)
22
21
  """
23
22
  Include skipped annotations
24
23
  """
25
24
 
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}
33
-
34
- return deep_union_pydantic_dicts(
35
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
36
- )
25
+ if IS_PYDANTIC_V2:
26
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
+ else:
37
28
 
38
- class Config:
39
- frozen = True
40
- smart_union = True
41
- extra = pydantic_v1.Extra.allow
42
- json_encoders = {dt.datetime: serialize_datetime}
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow
@@ -1,120 +1,111 @@
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 .annotations_dm_field_last_action import AnnotationsDmFieldLastAction
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
9
 
10
10
 
11
- class AnnotationsDmField(pydantic_v1.BaseModel):
11
+ class AnnotationsDmField(UniversalBaseModel):
12
12
  id: typing.Optional[int] = None
13
- result: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic_v1.Field(default=None)
13
+ result: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
14
14
  """
15
15
  List of annotation results for the task
16
16
  """
17
17
 
18
- created_username: typing.Optional[str] = pydantic_v1.Field(default=None)
18
+ created_username: typing.Optional[str] = pydantic.Field(default=None)
19
19
  """
20
20
  Username string
21
21
  """
22
22
 
23
- created_ago: typing.Optional[str] = pydantic_v1.Field(default=None)
23
+ created_ago: typing.Optional[str] = pydantic.Field(default=None)
24
24
  """
25
25
  Time delta from creation time
26
26
  """
27
27
 
28
- completed_by: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
28
+ completed_by: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
29
29
  """
30
30
  User details who completed this annotation.
31
31
  """
32
32
 
33
33
  unique_id: typing.Optional[str] = None
34
- was_cancelled: typing.Optional[bool] = pydantic_v1.Field(default=None)
34
+ was_cancelled: typing.Optional[bool] = pydantic.Field(default=None)
35
35
  """
36
36
  User skipped the task
37
37
  """
38
38
 
39
- ground_truth: typing.Optional[bool] = pydantic_v1.Field(default=None)
39
+ ground_truth: typing.Optional[bool] = pydantic.Field(default=None)
40
40
  """
41
41
  This annotation is a Ground Truth (ground_truth)
42
42
  """
43
43
 
44
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
44
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
45
45
  """
46
46
  Creation time
47
47
  """
48
48
 
49
- updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
49
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
50
50
  """
51
51
  Last updated time
52
52
  """
53
53
 
54
- draft_created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
54
+ draft_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
55
55
  """
56
56
  Draft creation time
57
57
  """
58
58
 
59
- lead_time: typing.Optional[float] = pydantic_v1.Field(default=None)
59
+ lead_time: typing.Optional[float] = pydantic.Field(default=None)
60
60
  """
61
61
  How much time it took to annotate the task
62
62
  """
63
63
 
64
- import_id: typing.Optional[int] = pydantic_v1.Field(default=None)
64
+ import_id: typing.Optional[int] = pydantic.Field(default=None)
65
65
  """
66
66
  Original annotation ID that was at the import step or NULL if this annotation wasn't imported
67
67
  """
68
68
 
69
- last_action: typing.Optional[AnnotationsDmFieldLastAction] = pydantic_v1.Field(default=None)
69
+ last_action: typing.Optional[AnnotationsDmFieldLastAction] = pydantic.Field(default=None)
70
70
  """
71
71
  Action which was performed in the last annotation history item
72
72
  """
73
73
 
74
- task: typing.Optional[int] = pydantic_v1.Field(default=None)
74
+ task: typing.Optional[int] = pydantic.Field(default=None)
75
75
  """
76
76
  Corresponding task for this annotation
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 annotation
82
82
  """
83
83
 
84
- updated_by: typing.Optional[int] = pydantic_v1.Field(default=None)
84
+ updated_by: typing.Optional[int] = pydantic.Field(default=None)
85
85
  """
86
86
  Last user who updated this annotation
87
87
  """
88
88
 
89
- parent_prediction: typing.Optional[int] = pydantic_v1.Field(default=None)
89
+ parent_prediction: typing.Optional[int] = pydantic.Field(default=None)
90
90
  """
91
91
  Points to the prediction from which this annotation was created
92
92
  """
93
93
 
94
- parent_annotation: typing.Optional[int] = pydantic_v1.Field(default=None)
94
+ parent_annotation: typing.Optional[int] = pydantic.Field(default=None)
95
95
  """
96
96
  Points to the parent annotation from which this annotation was created
97
97
  """
98
98
 
99
- last_created_by: typing.Optional[int] = pydantic_v1.Field(default=None)
99
+ last_created_by: typing.Optional[int] = pydantic.Field(default=None)
100
100
  """
101
101
  User who created the last annotation history item
102
102
  """
103
103
 
104
- def json(self, **kwargs: typing.Any) -> str:
105
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
106
- return super().json(**kwargs_with_defaults)
107
-
108
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
109
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
110
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
111
-
112
- return deep_union_pydantic_dicts(
113
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
114
- )
104
+ if IS_PYDANTIC_V2:
105
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
106
+ else:
115
107
 
116
- class Config:
117
- frozen = True
118
- smart_union = True
119
- extra = pydantic_v1.Extra.allow
120
- json_encoders = {dt.datetime: serialize_datetime}
108
+ class Config:
109
+ frozen = True
110
+ smart_union = True
111
+ extra = pydantic.Extra.allow
@@ -1,112 +1,103 @@
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_export_storage_status import AzureBlobExportStorageStatus
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
9
 
10
10
 
11
- class AzureBlobExportStorage(pydantic_v1.BaseModel):
11
+ class AzureBlobExportStorage(UniversalBaseModel):
12
12
  id: typing.Optional[int] = None
13
13
  type: typing.Optional[str] = None
14
14
  synchronizable: typing.Optional[bool] = None
15
- container: typing.Optional[str] = pydantic_v1.Field(default=None)
15
+ container: typing.Optional[str] = pydantic.Field(default=None)
16
16
  """
17
17
  Azure blob container
18
18
  """
19
19
 
20
- prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
20
+ prefix: typing.Optional[str] = pydantic.Field(default=None)
21
21
  """
22
22
  Azure blob prefix name
23
23
  """
24
24
 
25
- regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
25
+ regex_filter: typing.Optional[str] = pydantic.Field(default=None)
26
26
  """
27
27
  Cloud storage regex for filtering objects
28
28
  """
29
29
 
30
- use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
30
+ use_blob_urls: typing.Optional[bool] = pydantic.Field(default=None)
31
31
  """
32
32
  Interpret objects as BLOBs and generate URLs
33
33
  """
34
34
 
35
- account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
35
+ account_name: typing.Optional[str] = pydantic.Field(default=None)
36
36
  """
37
37
  Azure Blob account name
38
38
  """
39
39
 
40
- account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
40
+ account_key: typing.Optional[str] = pydantic.Field(default=None)
41
41
  """
42
42
  Azure Blob account key
43
43
  """
44
44
 
45
- last_sync: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
45
+ last_sync: typing.Optional[dt.datetime] = pydantic.Field(default=None)
46
46
  """
47
47
  Last sync finished time
48
48
  """
49
49
 
50
- last_sync_count: typing.Optional[int] = pydantic_v1.Field(default=None)
50
+ last_sync_count: typing.Optional[int] = pydantic.Field(default=None)
51
51
  """
52
52
  Count of tasks synced last time
53
53
  """
54
54
 
55
- last_sync_job: typing.Optional[str] = pydantic_v1.Field(default=None)
55
+ last_sync_job: typing.Optional[str] = pydantic.Field(default=None)
56
56
  """
57
57
  Last sync job ID
58
58
  """
59
59
 
60
60
  status: typing.Optional[AzureBlobExportStorageStatus] = None
61
- traceback: typing.Optional[str] = pydantic_v1.Field(default=None)
61
+ traceback: typing.Optional[str] = pydantic.Field(default=None)
62
62
  """
63
63
  Traceback report for the last failed sync
64
64
  """
65
65
 
66
- meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
66
+ meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
67
67
  """
68
68
  Meta and debug information about storage processes
69
69
  """
70
70
 
71
- title: typing.Optional[str] = pydantic_v1.Field(default=None)
71
+ title: typing.Optional[str] = pydantic.Field(default=None)
72
72
  """
73
73
  Cloud storage title
74
74
  """
75
75
 
76
- description: typing.Optional[str] = pydantic_v1.Field(default=None)
76
+ description: typing.Optional[str] = pydantic.Field(default=None)
77
77
  """
78
78
  Cloud storage description
79
79
  """
80
80
 
81
- created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
81
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
82
82
  """
83
83
  Creation time
84
84
  """
85
85
 
86
- can_delete_objects: typing.Optional[bool] = pydantic_v1.Field(default=None)
86
+ can_delete_objects: typing.Optional[bool] = pydantic.Field(default=None)
87
87
  """
88
88
  Deletion from storage enabled
89
89
  """
90
90
 
91
- project: int = pydantic_v1.Field()
91
+ project: int = pydantic.Field()
92
92
  """
93
93
  A unique integer value identifying this project.
94
94
  """
95
95
 
96
- def json(self, **kwargs: typing.Any) -> str:
97
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
98
- return super().json(**kwargs_with_defaults)
99
-
100
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
101
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
102
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
103
-
104
- return deep_union_pydantic_dicts(
105
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
106
- )
96
+ if IS_PYDANTIC_V2:
97
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
98
+ else:
107
99
 
108
- class Config:
109
- frozen = True
110
- smart_union = True
111
- extra = pydantic_v1.Extra.allow
112
- json_encoders = {dt.datetime: serialize_datetime}
100
+ class Config:
101
+ frozen = True
102
+ smart_union = True
103
+ extra = pydantic.Extra.allow