rapidata 2.26.1__py3-none-any.whl → 2.27.1__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 rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +2 -2
- rapidata/api_client/__init__.py +11 -3
- rapidata/api_client/api/__init__.py +2 -1
- rapidata/api_client/api/client_api.py +0 -257
- rapidata/api_client/api/customer_rapid_api.py +1644 -0
- rapidata/api_client/api/dataset_api.py +358 -1
- rapidata/api_client/api/newsletter_api.py +11 -299
- rapidata/api_client/api/user_rapid_api.py +1385 -0
- rapidata/api_client/api/validation_set_api.py +6 -6
- rapidata/api_client/models/__init__.py +9 -2
- rapidata/api_client/models/add_campaign_model.py +5 -0
- rapidata/api_client/models/add_validation_rapid_model.py +3 -3
- rapidata/api_client/models/add_validation_rapid_model_truth.py +25 -11
- rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
- rapidata/api_client/models/asset_metadata_model.py +2 -8
- rapidata/api_client/models/compare_result.py +1 -10
- rapidata/api_client/models/compare_workflow_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
- rapidata/api_client/models/create_order_model.py +2 -4
- rapidata/api_client/models/datapoint.py +3 -3
- rapidata/api_client/models/datapoint_metadata_model.py +3 -3
- rapidata/api_client/models/datapoint_model.py +3 -3
- rapidata/api_client/models/dataset_dataset_id_datapoints_post_request_metadata_inner.py +182 -0
- rapidata/api_client/models/file_asset_model.py +1 -3
- rapidata/api_client/models/file_asset_model_metadata_value.py +1 -3
- rapidata/api_client/models/get_compare_workflow_results_result.py +3 -3
- rapidata/api_client/models/get_datapoint_by_id_result.py +3 -3
- rapidata/api_client/models/get_rapid_responses_result.py +5 -5
- rapidata/api_client/models/get_validation_rapids_result.py +12 -3
- rapidata/api_client/models/get_validation_rapids_result_truth.py +25 -11
- rapidata/api_client/models/get_workflow_results_result.py +5 -5
- rapidata/api_client/models/multi_asset_model.py +4 -4
- rapidata/api_client/models/multi_compare_truth.py +96 -0
- rapidata/api_client/models/naive_referee_info.py +96 -0
- rapidata/api_client/models/never_ending_referee_info.py +94 -0
- rapidata/api_client/models/null_asset_model.py +1 -3
- rapidata/api_client/models/probabilistic_attach_category_referee_info.py +98 -0
- rapidata/api_client/models/rapid_model.py +173 -0
- rapidata/api_client/models/rapid_model_paged_result.py +105 -0
- rapidata/api_client/models/rapid_model_referee.py +154 -0
- rapidata/api_client/models/rapid_state.py +1 -0
- rapidata/api_client/models/text_asset_model.py +1 -3
- rapidata/api_client/models/update_access_model.py +1 -1
- rapidata/api_client/models/update_validation_rapid_model.py +3 -8
- rapidata/api_client/models/update_validation_rapid_model_truth.py +26 -12
- rapidata/api_client/models/upload_files_from_s3_bucket_model.py +12 -2
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +3 -3
- rapidata/api_client_README.md +21 -13
- rapidata/rapidata_client/__init__.py +1 -1
- rapidata/rapidata_client/assets/_multi_asset.py +0 -5
- rapidata/rapidata_client/logging/__init__.py +1 -1
- rapidata/rapidata_client/logging/output_manager.py +2 -2
- rapidata/rapidata_client/order/_rapidata_dataset.py +16 -39
- rapidata/rapidata_client/order/rapidata_order.py +20 -15
- rapidata/rapidata_client/order/rapidata_order_manager.py +5 -2
- rapidata/rapidata_client/validation/rapids/rapids.py +3 -4
- rapidata/rapidata_client/validation/validation_set_manager.py +2 -2
- rapidata/rapidata_client/workflow/_ranking_workflow.py +2 -6
- rapidata/service/credential_manager.py +6 -6
- {rapidata-2.26.1.dist-info → rapidata-2.27.1.dist-info}/METADATA +1 -1
- {rapidata-2.26.1.dist-info → rapidata-2.27.1.dist-info}/RECORD +65 -55
- {rapidata-2.26.1.dist-info → rapidata-2.27.1.dist-info}/LICENSE +0 -0
- {rapidata-2.26.1.dist-info → rapidata-2.27.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
21
|
+
from rapidata.api_client.models.prompt_asset_metadata_input import PromptAssetMetadataInput
|
|
22
|
+
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
23
|
+
from rapidata.api_client.models.public_text_metadata_input import PublicTextMetadataInput
|
|
24
|
+
from rapidata.api_client.models.transcription_metadata_input import TranscriptionMetadataInput
|
|
25
|
+
from pydantic import StrictStr, Field
|
|
26
|
+
from typing import Union, List, Set, Optional, Dict
|
|
27
|
+
from typing_extensions import Literal, Self
|
|
28
|
+
|
|
29
|
+
DATASETDATASETIDDATAPOINTSPOSTREQUESTMETADATAINNER_ONE_OF_SCHEMAS = ["PrivateTextMetadataInput", "PromptAssetMetadataInput", "PromptMetadataInput", "PublicTextMetadataInput", "TranscriptionMetadataInput"]
|
|
30
|
+
|
|
31
|
+
class DatasetDatasetIdDatapointsPostRequestMetadataInner(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
DatasetDatasetIdDatapointsPostRequestMetadataInner
|
|
34
|
+
"""
|
|
35
|
+
# data type: PrivateTextMetadataInput
|
|
36
|
+
oneof_schema_1_validator: Optional[PrivateTextMetadataInput] = None
|
|
37
|
+
# data type: PromptAssetMetadataInput
|
|
38
|
+
oneof_schema_2_validator: Optional[PromptAssetMetadataInput] = None
|
|
39
|
+
# data type: PromptMetadataInput
|
|
40
|
+
oneof_schema_3_validator: Optional[PromptMetadataInput] = None
|
|
41
|
+
# data type: PublicTextMetadataInput
|
|
42
|
+
oneof_schema_4_validator: Optional[PublicTextMetadataInput] = None
|
|
43
|
+
# data type: TranscriptionMetadataInput
|
|
44
|
+
oneof_schema_5_validator: Optional[TranscriptionMetadataInput] = None
|
|
45
|
+
actual_instance: Optional[Union[PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput]] = None
|
|
46
|
+
one_of_schemas: Set[str] = { "PrivateTextMetadataInput", "PromptAssetMetadataInput", "PromptMetadataInput", "PublicTextMetadataInput", "TranscriptionMetadataInput" }
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
58
|
+
if args:
|
|
59
|
+
if len(args) > 1:
|
|
60
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
61
|
+
if kwargs:
|
|
62
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
63
|
+
super().__init__(actual_instance=args[0])
|
|
64
|
+
else:
|
|
65
|
+
super().__init__(**kwargs)
|
|
66
|
+
|
|
67
|
+
@field_validator('actual_instance')
|
|
68
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
69
|
+
instance = DatasetDatasetIdDatapointsPostRequestMetadataInner.model_construct()
|
|
70
|
+
error_messages = []
|
|
71
|
+
match = 0
|
|
72
|
+
# validate data type: PrivateTextMetadataInput
|
|
73
|
+
if not isinstance(v, PrivateTextMetadataInput):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PrivateTextMetadataInput`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
77
|
+
# validate data type: PromptAssetMetadataInput
|
|
78
|
+
if not isinstance(v, PromptAssetMetadataInput):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PromptAssetMetadataInput`")
|
|
80
|
+
else:
|
|
81
|
+
match += 1
|
|
82
|
+
# validate data type: PromptMetadataInput
|
|
83
|
+
if not isinstance(v, PromptMetadataInput):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PromptMetadataInput`")
|
|
85
|
+
else:
|
|
86
|
+
match += 1
|
|
87
|
+
# validate data type: PublicTextMetadataInput
|
|
88
|
+
if not isinstance(v, PublicTextMetadataInput):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PublicTextMetadataInput`")
|
|
90
|
+
else:
|
|
91
|
+
match += 1
|
|
92
|
+
# validate data type: TranscriptionMetadataInput
|
|
93
|
+
if not isinstance(v, TranscriptionMetadataInput):
|
|
94
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionMetadataInput`")
|
|
95
|
+
else:
|
|
96
|
+
match += 1
|
|
97
|
+
if match > 1:
|
|
98
|
+
# more than 1 match
|
|
99
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in DatasetDatasetIdDatapointsPostRequestMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
|
|
100
|
+
elif match == 0:
|
|
101
|
+
# no match
|
|
102
|
+
raise ValueError("No match found when setting `actual_instance` in DatasetDatasetIdDatapointsPostRequestMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
|
|
103
|
+
else:
|
|
104
|
+
return v
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
108
|
+
return cls.from_json(json.dumps(obj))
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_json(cls, json_str: str) -> Self:
|
|
112
|
+
"""Returns the object represented by the json string"""
|
|
113
|
+
instance = cls.model_construct()
|
|
114
|
+
error_messages = []
|
|
115
|
+
match = 0
|
|
116
|
+
|
|
117
|
+
# deserialize data into PrivateTextMetadataInput
|
|
118
|
+
try:
|
|
119
|
+
instance.actual_instance = PrivateTextMetadataInput.from_json(json_str)
|
|
120
|
+
match += 1
|
|
121
|
+
except (ValidationError, ValueError) as e:
|
|
122
|
+
error_messages.append(str(e))
|
|
123
|
+
# deserialize data into PromptAssetMetadataInput
|
|
124
|
+
try:
|
|
125
|
+
instance.actual_instance = PromptAssetMetadataInput.from_json(json_str)
|
|
126
|
+
match += 1
|
|
127
|
+
except (ValidationError, ValueError) as e:
|
|
128
|
+
error_messages.append(str(e))
|
|
129
|
+
# deserialize data into PromptMetadataInput
|
|
130
|
+
try:
|
|
131
|
+
instance.actual_instance = PromptMetadataInput.from_json(json_str)
|
|
132
|
+
match += 1
|
|
133
|
+
except (ValidationError, ValueError) as e:
|
|
134
|
+
error_messages.append(str(e))
|
|
135
|
+
# deserialize data into PublicTextMetadataInput
|
|
136
|
+
try:
|
|
137
|
+
instance.actual_instance = PublicTextMetadataInput.from_json(json_str)
|
|
138
|
+
match += 1
|
|
139
|
+
except (ValidationError, ValueError) as e:
|
|
140
|
+
error_messages.append(str(e))
|
|
141
|
+
# deserialize data into TranscriptionMetadataInput
|
|
142
|
+
try:
|
|
143
|
+
instance.actual_instance = TranscriptionMetadataInput.from_json(json_str)
|
|
144
|
+
match += 1
|
|
145
|
+
except (ValidationError, ValueError) as e:
|
|
146
|
+
error_messages.append(str(e))
|
|
147
|
+
|
|
148
|
+
if match > 1:
|
|
149
|
+
# more than 1 match
|
|
150
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into DatasetDatasetIdDatapointsPostRequestMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
|
|
151
|
+
elif match == 0:
|
|
152
|
+
# no match
|
|
153
|
+
raise ValueError("No match found when deserializing the JSON string into DatasetDatasetIdDatapointsPostRequestMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
|
|
154
|
+
else:
|
|
155
|
+
return instance
|
|
156
|
+
|
|
157
|
+
def to_json(self) -> str:
|
|
158
|
+
"""Returns the JSON representation of the actual instance"""
|
|
159
|
+
if self.actual_instance is None:
|
|
160
|
+
return "null"
|
|
161
|
+
|
|
162
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
163
|
+
return self.actual_instance.to_json()
|
|
164
|
+
else:
|
|
165
|
+
return json.dumps(self.actual_instance)
|
|
166
|
+
|
|
167
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], PrivateTextMetadataInput, PromptAssetMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput]]:
|
|
168
|
+
"""Returns the dict representation of the actual instance"""
|
|
169
|
+
if self.actual_instance is None:
|
|
170
|
+
return None
|
|
171
|
+
|
|
172
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
173
|
+
return self.actual_instance.to_dict()
|
|
174
|
+
else:
|
|
175
|
+
# primitive type
|
|
176
|
+
return self.actual_instance
|
|
177
|
+
|
|
178
|
+
def to_str(self) -> str:
|
|
179
|
+
"""Returns the string representation of the actual instance"""
|
|
180
|
+
return pprint.pformat(self.model_dump())
|
|
181
|
+
|
|
182
|
+
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -109,7 +110,4 @@ class FileAssetModel(BaseModel):
|
|
|
109
110
|
})
|
|
110
111
|
return _obj
|
|
111
112
|
|
|
112
|
-
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
113
|
-
# TODO: Rewrite to not use raise_errors
|
|
114
|
-
FileAssetModel.model_rebuild(raise_errors=False)
|
|
115
113
|
|
|
@@ -17,6 +17,7 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.asset_metadata_model import AssetMetadataModel
|
|
20
21
|
from rapidata.api_client.models.classification_metadata_model import ClassificationMetadataModel
|
|
21
22
|
from rapidata.api_client.models.count_metadata_model import CountMetadataModel
|
|
22
23
|
from rapidata.api_client.models.demographic_metadata_model import DemographicMetadataModel
|
|
@@ -276,7 +277,4 @@ class FileAssetModelMetadataValue(BaseModel):
|
|
|
276
277
|
"""Returns the string representation of the actual instance"""
|
|
277
278
|
return pprint.pformat(self.model_dump())
|
|
278
279
|
|
|
279
|
-
from rapidata.api_client.models.asset_metadata_model import AssetMetadataModel
|
|
280
|
-
# TODO: Rewrite to not use raise_errors
|
|
281
|
-
FileAssetModelMetadataValue.model_rebuild(raise_errors=False)
|
|
282
280
|
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ class GetCompareWorkflowResultsResult(BaseModel):
|
|
|
28
28
|
GetCompareWorkflowResultsResult
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
workflow_datapoint_id: StrictStr = Field(alias="workflowDatapointId")
|
|
31
|
-
asset:
|
|
31
|
+
asset: DatapointAsset
|
|
32
32
|
elo: StrictInt
|
|
33
33
|
__properties: ClassVar[List[str]] = ["workflowDatapointId", "asset", "elo"]
|
|
34
34
|
|
|
@@ -87,7 +87,7 @@ class GetCompareWorkflowResultsResult(BaseModel):
|
|
|
87
87
|
|
|
88
88
|
_obj = cls.model_validate({
|
|
89
89
|
"workflowDatapointId": obj.get("workflowDatapointId"),
|
|
90
|
-
"asset":
|
|
90
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
91
91
|
"elo": obj.get("elo")
|
|
92
92
|
})
|
|
93
93
|
return _obj
|
|
@@ -20,7 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from rapidata.api_client.models.
|
|
23
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
@@ -32,7 +32,7 @@ class GetDatapointByIdResult(BaseModel):
|
|
|
32
32
|
dataset_id: StrictStr = Field(alias="datasetId")
|
|
33
33
|
state: StrictStr
|
|
34
34
|
sort_index: Optional[StrictInt] = Field(default=None, alias="sortIndex")
|
|
35
|
-
asset:
|
|
35
|
+
asset: DatapointAsset
|
|
36
36
|
created_at: datetime = Field(alias="createdAt")
|
|
37
37
|
__properties: ClassVar[List[str]] = ["id", "datasetId", "state", "sortIndex", "asset", "createdAt"]
|
|
38
38
|
|
|
@@ -106,7 +106,7 @@ class GetDatapointByIdResult(BaseModel):
|
|
|
106
106
|
"datasetId": obj.get("datasetId"),
|
|
107
107
|
"state": obj.get("state"),
|
|
108
108
|
"sortIndex": obj.get("sortIndex"),
|
|
109
|
-
"asset":
|
|
109
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
110
110
|
"createdAt": obj.get("createdAt")
|
|
111
111
|
})
|
|
112
112
|
return _obj
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
23
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -29,7 +29,7 @@ class GetRapidResponsesResult(BaseModel):
|
|
|
29
29
|
GetRapidResponsesResult
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
-
asset:
|
|
32
|
+
asset: DatapointAsset
|
|
33
33
|
responses: List[RapidResponse]
|
|
34
34
|
state: StrictStr
|
|
35
35
|
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
@@ -37,8 +37,8 @@ class GetRapidResponsesResult(BaseModel):
|
|
|
37
37
|
@field_validator('state')
|
|
38
38
|
def state_validate_enum(cls, value):
|
|
39
39
|
"""Validates the enum"""
|
|
40
|
-
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Done', 'None']):
|
|
41
|
-
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Done', 'None')")
|
|
40
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
41
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
42
42
|
return value
|
|
43
43
|
|
|
44
44
|
model_config = ConfigDict(
|
|
@@ -103,7 +103,7 @@ class GetRapidResponsesResult(BaseModel):
|
|
|
103
103
|
|
|
104
104
|
_obj = cls.model_validate({
|
|
105
105
|
"rapidId": obj.get("rapidId"),
|
|
106
|
-
"asset":
|
|
106
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
107
107
|
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
108
108
|
"state": obj.get("state")
|
|
109
109
|
})
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
23
23
|
from rapidata.api_client.models.get_validation_rapids_result_asset import GetValidationRapidsResultAsset
|
|
@@ -40,7 +40,15 @@ class GetValidationRapidsResult(BaseModel):
|
|
|
40
40
|
invalid_validation_count: StrictInt = Field(alias="invalidValidationCount")
|
|
41
41
|
explanation: Optional[StrictStr] = None
|
|
42
42
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomCorrectProbability")
|
|
43
|
-
|
|
43
|
+
state: StrictStr
|
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "type", "asset", "truth", "payload", "metadata", "correctValidationCount", "invalidValidationCount", "explanation", "randomCorrectProbability", "state"]
|
|
45
|
+
|
|
46
|
+
@field_validator('state')
|
|
47
|
+
def state_validate_enum(cls, value):
|
|
48
|
+
"""Validates the enum"""
|
|
49
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
50
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
51
|
+
return value
|
|
44
52
|
|
|
45
53
|
model_config = ConfigDict(
|
|
46
54
|
populate_by_name=True,
|
|
@@ -143,7 +151,8 @@ class GetValidationRapidsResult(BaseModel):
|
|
|
143
151
|
"correctValidationCount": obj.get("correctValidationCount"),
|
|
144
152
|
"invalidValidationCount": obj.get("invalidValidationCount"),
|
|
145
153
|
"explanation": obj.get("explanation"),
|
|
146
|
-
"randomCorrectProbability": obj.get("randomCorrectProbability")
|
|
154
|
+
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
155
|
+
"state": obj.get("state")
|
|
147
156
|
})
|
|
148
157
|
return _obj
|
|
149
158
|
|
|
@@ -23,6 +23,7 @@ from rapidata.api_client.models.compare_truth import CompareTruth
|
|
|
23
23
|
from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
|
|
24
24
|
from rapidata.api_client.models.line_truth import LineTruth
|
|
25
25
|
from rapidata.api_client.models.locate_box_truth import LocateBoxTruth
|
|
26
|
+
from rapidata.api_client.models.multi_compare_truth import MultiCompareTruth
|
|
26
27
|
from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
|
|
27
28
|
from rapidata.api_client.models.polygon_truth import PolygonTruth
|
|
28
29
|
from rapidata.api_client.models.scrub_truth import ScrubTruth
|
|
@@ -32,7 +33,7 @@ from pydantic import StrictStr, Field
|
|
|
32
33
|
from typing import Union, List, Set, Optional, Dict
|
|
33
34
|
from typing_extensions import Literal, Self
|
|
34
35
|
|
|
35
|
-
GETVALIDATIONRAPIDSRESULTTRUTH_ONE_OF_SCHEMAS = ["AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth"]
|
|
36
|
+
GETVALIDATIONRAPIDSRESULTTRUTH_ONE_OF_SCHEMAS = ["AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "MultiCompareTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth"]
|
|
36
37
|
|
|
37
38
|
class GetValidationRapidsResultTruth(BaseModel):
|
|
38
39
|
"""
|
|
@@ -54,14 +55,16 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
54
55
|
oneof_schema_7_validator: Optional[EmptyValidationTruth] = None
|
|
55
56
|
# data type: CompareTruth
|
|
56
57
|
oneof_schema_8_validator: Optional[CompareTruth] = None
|
|
58
|
+
# data type: MultiCompareTruth
|
|
59
|
+
oneof_schema_9_validator: Optional[MultiCompareTruth] = None
|
|
57
60
|
# data type: SkipTruth
|
|
58
|
-
|
|
61
|
+
oneof_schema_10_validator: Optional[SkipTruth] = None
|
|
59
62
|
# data type: AttachCategoryTruth
|
|
60
|
-
|
|
63
|
+
oneof_schema_11_validator: Optional[AttachCategoryTruth] = None
|
|
61
64
|
# data type: BoundingBoxTruth
|
|
62
|
-
|
|
63
|
-
actual_instance: Optional[Union[AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]] = None
|
|
64
|
-
one_of_schemas: Set[str] = { "AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth" }
|
|
65
|
+
oneof_schema_12_validator: Optional[BoundingBoxTruth] = None
|
|
66
|
+
actual_instance: Optional[Union[AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]] = None
|
|
67
|
+
one_of_schemas: Set[str] = { "AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "MultiCompareTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth" }
|
|
65
68
|
|
|
66
69
|
model_config = ConfigDict(
|
|
67
70
|
validate_assignment=True,
|
|
@@ -130,6 +133,11 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
130
133
|
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareTruth`")
|
|
131
134
|
else:
|
|
132
135
|
match += 1
|
|
136
|
+
# validate data type: MultiCompareTruth
|
|
137
|
+
if not isinstance(v, MultiCompareTruth):
|
|
138
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiCompareTruth`")
|
|
139
|
+
else:
|
|
140
|
+
match += 1
|
|
133
141
|
# validate data type: SkipTruth
|
|
134
142
|
if not isinstance(v, SkipTruth):
|
|
135
143
|
error_messages.append(f"Error! Input type `{type(v)}` is not `SkipTruth`")
|
|
@@ -147,10 +155,10 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
147
155
|
match += 1
|
|
148
156
|
if match > 1:
|
|
149
157
|
# more than 1 match
|
|
150
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
158
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
151
159
|
elif match == 0:
|
|
152
160
|
# no match
|
|
153
|
-
raise ValueError("No match found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
161
|
+
raise ValueError("No match found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
154
162
|
else:
|
|
155
163
|
return v
|
|
156
164
|
|
|
@@ -216,6 +224,12 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
216
224
|
match += 1
|
|
217
225
|
except (ValidationError, ValueError) as e:
|
|
218
226
|
error_messages.append(str(e))
|
|
227
|
+
# deserialize data into MultiCompareTruth
|
|
228
|
+
try:
|
|
229
|
+
instance.actual_instance = MultiCompareTruth.from_json(json_str)
|
|
230
|
+
match += 1
|
|
231
|
+
except (ValidationError, ValueError) as e:
|
|
232
|
+
error_messages.append(str(e))
|
|
219
233
|
# deserialize data into SkipTruth
|
|
220
234
|
try:
|
|
221
235
|
instance.actual_instance = SkipTruth.from_json(json_str)
|
|
@@ -237,10 +251,10 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
237
251
|
|
|
238
252
|
if match > 1:
|
|
239
253
|
# more than 1 match
|
|
240
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
254
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
241
255
|
elif match == 0:
|
|
242
256
|
# no match
|
|
243
|
-
raise ValueError("No match found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
257
|
+
raise ValueError("No match found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
244
258
|
else:
|
|
245
259
|
return instance
|
|
246
260
|
|
|
@@ -254,7 +268,7 @@ class GetValidationRapidsResultTruth(BaseModel):
|
|
|
254
268
|
else:
|
|
255
269
|
return json.dumps(self.actual_instance)
|
|
256
270
|
|
|
257
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]]:
|
|
271
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]]:
|
|
258
272
|
"""Returns the dict representation of the actual instance"""
|
|
259
273
|
if self.actual_instance is None:
|
|
260
274
|
return None
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
23
|
from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
|
|
24
24
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
25
25
|
from typing import Optional, Set
|
|
@@ -31,7 +31,7 @@ class GetWorkflowResultsResult(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
33
33
|
payload: GetValidationRapidsResultPayload
|
|
34
|
-
asset:
|
|
34
|
+
asset: DatapointAsset
|
|
35
35
|
responses: List[RapidResponse]
|
|
36
36
|
state: StrictStr
|
|
37
37
|
__properties: ClassVar[List[str]] = ["rapidId", "payload", "asset", "responses", "state"]
|
|
@@ -39,8 +39,8 @@ class GetWorkflowResultsResult(BaseModel):
|
|
|
39
39
|
@field_validator('state')
|
|
40
40
|
def state_validate_enum(cls, value):
|
|
41
41
|
"""Validates the enum"""
|
|
42
|
-
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Done', 'None']):
|
|
43
|
-
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Done', 'None')")
|
|
42
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
43
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
44
44
|
return value
|
|
45
45
|
|
|
46
46
|
model_config = ConfigDict(
|
|
@@ -109,7 +109,7 @@ class GetWorkflowResultsResult(BaseModel):
|
|
|
109
109
|
_obj = cls.model_validate({
|
|
110
110
|
"rapidId": obj.get("rapidId"),
|
|
111
111
|
"payload": GetValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
112
|
-
"asset":
|
|
112
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
113
113
|
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
114
114
|
"state": obj.get("state")
|
|
115
115
|
})
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -27,7 +28,7 @@ class MultiAssetModel(BaseModel):
|
|
|
27
28
|
MultiAssetModel
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
t: StrictStr = Field(description="Discriminator value for MultiAsset", alias="_t")
|
|
30
|
-
assets: List[
|
|
31
|
+
assets: List[DatapointAsset]
|
|
31
32
|
metadata: Dict[str, FileAssetModelMetadataValue]
|
|
32
33
|
identifier: StrictStr
|
|
33
34
|
__properties: ClassVar[List[str]] = ["_t", "assets", "metadata", "identifier"]
|
|
@@ -105,7 +106,7 @@ class MultiAssetModel(BaseModel):
|
|
|
105
106
|
|
|
106
107
|
_obj = cls.model_validate({
|
|
107
108
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiAsset',
|
|
108
|
-
"assets": [
|
|
109
|
+
"assets": [DatapointAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None,
|
|
109
110
|
"metadata": dict(
|
|
110
111
|
(_k, FileAssetModelMetadataValue.from_dict(_v))
|
|
111
112
|
for _k, _v in obj["metadata"].items()
|
|
@@ -116,8 +117,7 @@ class MultiAssetModel(BaseModel):
|
|
|
116
117
|
})
|
|
117
118
|
return _obj
|
|
118
119
|
|
|
119
|
-
from rapidata.api_client.models.
|
|
120
|
-
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
120
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
121
121
|
# TODO: Rewrite to not use raise_errors
|
|
122
122
|
MultiAssetModel.model_rebuild(raise_errors=False)
|
|
123
123
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class MultiCompareTruth(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
MultiCompareTruth
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for MultiCompareTruth", alias="_t")
|
|
30
|
+
correct_combinations: List[List[StrictStr]] = Field(alias="correctCombinations")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "correctCombinations"]
|
|
32
|
+
|
|
33
|
+
@field_validator('t')
|
|
34
|
+
def t_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in set(['MultiCompareTruth']):
|
|
37
|
+
raise ValueError("must be one of enum values ('MultiCompareTruth')")
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of MultiCompareTruth from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of MultiCompareTruth from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiCompareTruth',
|
|
92
|
+
"correctCombinations": obj.get("correctCombinations")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|