rapidata 2.14.1__py3-none-any.whl → 2.16.0__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/api_client/__init__.py +18 -7
- rapidata/api_client/api/__init__.py +2 -1
- rapidata/api_client/api/campaign_api.py +868 -92
- rapidata/api_client/api/client_api.py +292 -20
- rapidata/api_client/api/coco_api.py +594 -8
- rapidata/api_client/api/compare_workflow_api.py +23 -23
- rapidata/api_client/api/datapoint_api.py +548 -26
- rapidata/api_client/api/dataset_api.py +2198 -186
- rapidata/api_client/api/feedback_api.py +306 -0
- rapidata/api_client/api/identity_api.py +1143 -78
- rapidata/api_client/api/newsletter_api.py +299 -11
- rapidata/api_client/api/order_api.py +5570 -516
- rapidata/api_client/api/pipeline_api.py +263 -524
- rapidata/api_client/api/rapid_api.py +1930 -254
- rapidata/api_client/api/simple_workflow_api.py +23 -23
- rapidata/api_client/api/validation_api.py +283 -0
- rapidata/api_client/api/validation_set_api.py +5259 -0
- rapidata/api_client/api/workflow_api.py +929 -134
- rapidata/api_client/models/__init__.py +16 -6
- rapidata/api_client/models/ab_test_selection_a_inner.py +24 -10
- rapidata/api_client/models/add_campaign_model.py +9 -2
- rapidata/api_client/models/add_user_response_result.py +106 -0
- rapidata/api_client/models/add_user_response_result_validation_truth.py +258 -0
- rapidata/api_client/models/add_validation_rapid_model.py +3 -3
- rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
- rapidata/api_client/models/are_rapids_active_result.py +87 -0
- rapidata/api_client/models/campaign_query_result.py +2 -2
- rapidata/api_client/models/campaign_status.py +1 -0
- rapidata/api_client/models/compare_workflow_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_files_model.py +102 -0
- rapidata/api_client/models/create_datapoint_from_files_model_metadata_inner.py +168 -0
- rapidata/api_client/models/create_datapoint_from_text_sources_model.py +109 -0
- rapidata/api_client/models/create_datapoint_from_urls_model.py +4 -4
- rapidata/api_client/models/create_datapoints_from_s3_bucket_model.py +124 -0
- rapidata/api_client/models/create_order_model.py +15 -1
- rapidata/api_client/models/create_rapid_result.py +87 -0
- rapidata/api_client/models/create_validation_set_model.py +87 -0
- rapidata/api_client/models/datapoint_metadata_model.py +3 -3
- rapidata/api_client/models/evaluation_workflow_model.py +1 -1
- rapidata/api_client/models/get_validation_rapids_query.py +123 -0
- rapidata/api_client/models/get_validation_rapids_query_paged_result.py +105 -0
- rapidata/api_client/models/order_model.py +2 -2
- rapidata/api_client/models/order_state.py +1 -0
- rapidata/api_client/models/pipeline_id_workflow_artifact_id_put_request.py +140 -0
- rapidata/api_client/models/query_validation_rapids_result.py +3 -3
- rapidata/api_client/models/rapid_issue.py +4 -0
- rapidata/api_client/models/report_model.py +4 -4
- rapidata/api_client/models/shuffling_selection.py +106 -0
- rapidata/api_client/models/update_dataset_name_model.py +87 -0
- rapidata/api_client/models/update_dimensions_model.py +87 -0
- rapidata/api_client/models/update_order_name_model.py +87 -0
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +3 -3
- rapidata/api_client/models/user_score_user_filter_model.py +9 -2
- rapidata/api_client_README.md +154 -84
- rapidata/rapidata_client/demographic/demographic_manager.py +36 -1
- rapidata/rapidata_client/filter/user_score_filter.py +4 -1
- rapidata/rapidata_client/order/_rapidata_dataset.py +10 -11
- rapidata/rapidata_client/order/_rapidata_order_builder.py +3 -1
- rapidata/rapidata_client/order/rapidata_order.py +8 -10
- rapidata/rapidata_client/order/rapidata_order_manager.py +11 -2
- rapidata/rapidata_client/order/rapidata_results.py +1 -1
- rapidata/rapidata_client/validation/rapidata_validation_set.py +11 -0
- rapidata/rapidata_client/validation/rapids/rapids.py +3 -5
- rapidata/rapidata_client/validation/validation_set_manager.py +36 -21
- rapidata/rapidata_client/workflow/_ranking_workflow.py +2 -2
- {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/METADATA +1 -1
- {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/RECORD +69 -51
- {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/LICENSE +0 -0
- {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/WHEEL +0 -0
|
@@ -18,6 +18,8 @@ from rapidata.api_client.models.ab_test_selection import AbTestSelection
|
|
|
18
18
|
from rapidata.api_client.models.ab_test_selection_a_inner import AbTestSelectionAInner
|
|
19
19
|
from rapidata.api_client.models.add_campaign_artifact_result import AddCampaignArtifactResult
|
|
20
20
|
from rapidata.api_client.models.add_campaign_model import AddCampaignModel
|
|
21
|
+
from rapidata.api_client.models.add_user_response_result import AddUserResponseResult
|
|
22
|
+
from rapidata.api_client.models.add_user_response_result_validation_truth import AddUserResponseResultValidationTruth
|
|
21
23
|
from rapidata.api_client.models.add_validation_rapid_model import AddValidationRapidModel
|
|
22
24
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
25
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
@@ -26,6 +28,7 @@ from rapidata.api_client.models.add_validation_text_rapid_model import AddValida
|
|
|
26
28
|
from rapidata.api_client.models.age_group import AgeGroup
|
|
27
29
|
from rapidata.api_client.models.age_user_filter_model import AgeUserFilterModel
|
|
28
30
|
from rapidata.api_client.models.aggregator_type import AggregatorType
|
|
31
|
+
from rapidata.api_client.models.are_rapids_active_result import AreRapidsActiveResult
|
|
29
32
|
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
30
33
|
from rapidata.api_client.models.attach_category_result import AttachCategoryResult
|
|
31
34
|
from rapidata.api_client.models.attach_category_truth import AttachCategoryTruth
|
|
@@ -76,9 +79,12 @@ from rapidata.api_client.models.create_client_result import CreateClientResult
|
|
|
76
79
|
from rapidata.api_client.models.create_complex_order_model import CreateComplexOrderModel
|
|
77
80
|
from rapidata.api_client.models.create_complex_order_model_pipeline import CreateComplexOrderModelPipeline
|
|
78
81
|
from rapidata.api_client.models.create_complex_order_result import CreateComplexOrderResult
|
|
82
|
+
from rapidata.api_client.models.create_datapoint_from_files_model import CreateDatapointFromFilesModel
|
|
83
|
+
from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
|
|
84
|
+
from rapidata.api_client.models.create_datapoint_from_text_sources_model import CreateDatapointFromTextSourcesModel
|
|
79
85
|
from rapidata.api_client.models.create_datapoint_from_urls_model import CreateDatapointFromUrlsModel
|
|
80
|
-
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
81
86
|
from rapidata.api_client.models.create_datapoint_result import CreateDatapointResult
|
|
87
|
+
from rapidata.api_client.models.create_datapoints_from_s3_bucket_model import CreateDatapointsFromS3BucketModel
|
|
82
88
|
from rapidata.api_client.models.create_dataset_artifact_model import CreateDatasetArtifactModel
|
|
83
89
|
from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
|
|
84
90
|
from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
|
|
@@ -88,10 +94,12 @@ from rapidata.api_client.models.create_order_model_referee import CreateOrderMod
|
|
|
88
94
|
from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
|
|
89
95
|
from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
|
|
90
96
|
from rapidata.api_client.models.create_order_result import CreateOrderResult
|
|
97
|
+
from rapidata.api_client.models.create_rapid_result import CreateRapidResult
|
|
91
98
|
from rapidata.api_client.models.create_simple_pipeline_model import CreateSimplePipelineModel
|
|
92
99
|
from rapidata.api_client.models.create_simple_pipeline_model_artifacts_inner import CreateSimplePipelineModelArtifactsInner
|
|
93
100
|
from rapidata.api_client.models.create_simple_pipeline_model_pipeline_steps_inner import CreateSimplePipelineModelPipelineStepsInner
|
|
94
101
|
from rapidata.api_client.models.create_unsupported_order_model import CreateUnsupportedOrderModel
|
|
102
|
+
from rapidata.api_client.models.create_validation_set_model import CreateValidationSetModel
|
|
95
103
|
from rapidata.api_client.models.custom_user_filter_model import CustomUserFilterModel
|
|
96
104
|
from rapidata.api_client.models.datapoint import Datapoint
|
|
97
105
|
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
@@ -141,12 +149,13 @@ from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
|
141
149
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
142
150
|
from rapidata.api_client.models.get_simple_workflow_results_result import GetSimpleWorkflowResultsResult
|
|
143
151
|
from rapidata.api_client.models.get_simple_workflow_results_result_paged_result import GetSimpleWorkflowResultsResultPagedResult
|
|
152
|
+
from rapidata.api_client.models.get_validation_rapids_query import GetValidationRapidsQuery
|
|
153
|
+
from rapidata.api_client.models.get_validation_rapids_query_paged_result import GetValidationRapidsQueryPagedResult
|
|
144
154
|
from rapidata.api_client.models.get_validation_set_by_id_result import GetValidationSetByIdResult
|
|
145
155
|
from rapidata.api_client.models.get_workflow_by_id_result import GetWorkflowByIdResult
|
|
146
156
|
from rapidata.api_client.models.get_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
|
|
147
157
|
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
148
158
|
from rapidata.api_client.models.i_workflow_model_paged_result import IWorkflowModelPagedResult
|
|
149
|
-
from rapidata.api_client.models.identity_read_bridge_token_get202_response import IdentityReadBridgeTokenGet202Response
|
|
150
159
|
from rapidata.api_client.models.image_dimension_metadata import ImageDimensionMetadata
|
|
151
160
|
from rapidata.api_client.models.image_dimension_metadata_model import ImageDimensionMetadataModel
|
|
152
161
|
from rapidata.api_client.models.import_from_file_result import ImportFromFileResult
|
|
@@ -192,7 +201,7 @@ from rapidata.api_client.models.order_state import OrderState
|
|
|
192
201
|
from rapidata.api_client.models.original_filename_metadata import OriginalFilenameMetadata
|
|
193
202
|
from rapidata.api_client.models.original_filename_metadata_model import OriginalFilenameMetadataModel
|
|
194
203
|
from rapidata.api_client.models.page_info import PageInfo
|
|
195
|
-
from rapidata.api_client.models.
|
|
204
|
+
from rapidata.api_client.models.pipeline_id_workflow_artifact_id_put_request import PipelineIdWorkflowArtifactIdPutRequest
|
|
196
205
|
from rapidata.api_client.models.polygon_payload import PolygonPayload
|
|
197
206
|
from rapidata.api_client.models.polygon_rapid_blueprint import PolygonRapidBlueprint
|
|
198
207
|
from rapidata.api_client.models.polygon_result import PolygonResult
|
|
@@ -201,7 +210,6 @@ from rapidata.api_client.models.preliminary_download_model import PreliminaryDow
|
|
|
201
210
|
from rapidata.api_client.models.preliminary_download_result import PreliminaryDownloadResult
|
|
202
211
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
203
212
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
204
|
-
from rapidata.api_client.models.problem_details import ProblemDetails
|
|
205
213
|
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
206
214
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
207
215
|
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
@@ -212,7 +220,6 @@ from rapidata.api_client.models.query_validation_rapids_result import QueryValid
|
|
|
212
220
|
from rapidata.api_client.models.query_validation_rapids_result_asset import QueryValidationRapidsResultAsset
|
|
213
221
|
from rapidata.api_client.models.query_validation_rapids_result_paged_result import QueryValidationRapidsResultPagedResult
|
|
214
222
|
from rapidata.api_client.models.query_validation_rapids_result_payload import QueryValidationRapidsResultPayload
|
|
215
|
-
from rapidata.api_client.models.query_validation_rapids_result_truth import QueryValidationRapidsResultTruth
|
|
216
223
|
from rapidata.api_client.models.query_workflows_model import QueryWorkflowsModel
|
|
217
224
|
from rapidata.api_client.models.rapid_issue import RapidIssue
|
|
218
225
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
@@ -233,6 +240,7 @@ from rapidata.api_client.models.scrub_result import ScrubResult
|
|
|
233
240
|
from rapidata.api_client.models.scrub_truth import ScrubTruth
|
|
234
241
|
from rapidata.api_client.models.send_completion_mail_step_model import SendCompletionMailStepModel
|
|
235
242
|
from rapidata.api_client.models.shape import Shape
|
|
243
|
+
from rapidata.api_client.models.shuffling_selection import ShufflingSelection
|
|
236
244
|
from rapidata.api_client.models.simple_workflow_config import SimpleWorkflowConfig
|
|
237
245
|
from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
|
|
238
246
|
from rapidata.api_client.models.simple_workflow_config_model_blueprint import SimpleWorkflowConfigModelBlueprint
|
|
@@ -263,7 +271,9 @@ from rapidata.api_client.models.translated_string import TranslatedString
|
|
|
263
271
|
from rapidata.api_client.models.unlock_order_result import UnlockOrderResult
|
|
264
272
|
from rapidata.api_client.models.update_access_model import UpdateAccessModel
|
|
265
273
|
from rapidata.api_client.models.update_campaign_model import UpdateCampaignModel
|
|
266
|
-
from rapidata.api_client.models.
|
|
274
|
+
from rapidata.api_client.models.update_dataset_name_model import UpdateDatasetNameModel
|
|
275
|
+
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
276
|
+
from rapidata.api_client.models.update_order_name_model import UpdateOrderNameModel
|
|
267
277
|
from rapidata.api_client.models.update_validation_rapid_model import UpdateValidationRapidModel
|
|
268
278
|
from rapidata.api_client.models.update_validation_rapid_model_truth import UpdateValidationRapidModelTruth
|
|
269
279
|
from rapidata.api_client.models.upload_coco_result import UploadCocoResult
|
|
@@ -26,7 +26,7 @@ from pydantic import StrictStr, Field
|
|
|
26
26
|
from typing import Union, List, Set, Optional, Dict
|
|
27
27
|
from typing_extensions import Literal, Self
|
|
28
28
|
|
|
29
|
-
ABTESTSELECTIONAINNER_ONE_OF_SCHEMAS = ["AbTestSelection", "CappedSelection", "ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection"]
|
|
29
|
+
ABTESTSELECTIONAINNER_ONE_OF_SCHEMAS = ["AbTestSelection", "CappedSelection", "ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "ShufflingSelection", "StaticSelection", "ValidationSelection"]
|
|
30
30
|
|
|
31
31
|
class AbTestSelectionAInner(BaseModel):
|
|
32
32
|
"""
|
|
@@ -42,12 +42,14 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
42
42
|
oneof_schema_4_validator: Optional[DemographicSelection] = None
|
|
43
43
|
# data type: LabelingSelection
|
|
44
44
|
oneof_schema_5_validator: Optional[LabelingSelection] = None
|
|
45
|
+
# data type: ShufflingSelection
|
|
46
|
+
oneof_schema_6_validator: Optional[ShufflingSelection] = None
|
|
45
47
|
# data type: StaticSelection
|
|
46
|
-
|
|
48
|
+
oneof_schema_7_validator: Optional[StaticSelection] = None
|
|
47
49
|
# data type: ValidationSelection
|
|
48
|
-
|
|
49
|
-
actual_instance: Optional[Union[AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]] = None
|
|
50
|
-
one_of_schemas: Set[str] = { "AbTestSelection", "CappedSelection", "ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection" }
|
|
50
|
+
oneof_schema_8_validator: Optional[ValidationSelection] = None
|
|
51
|
+
actual_instance: Optional[Union[AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection]] = None
|
|
52
|
+
one_of_schemas: Set[str] = { "AbTestSelection", "CappedSelection", "ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "ShufflingSelection", "StaticSelection", "ValidationSelection" }
|
|
51
53
|
|
|
52
54
|
model_config = ConfigDict(
|
|
53
55
|
validate_assignment=True,
|
|
@@ -98,6 +100,11 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
98
100
|
error_messages.append(f"Error! Input type `{type(v)}` is not `LabelingSelection`")
|
|
99
101
|
else:
|
|
100
102
|
match += 1
|
|
103
|
+
# validate data type: ShufflingSelection
|
|
104
|
+
if not isinstance(v, ShufflingSelection):
|
|
105
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ShufflingSelection`")
|
|
106
|
+
else:
|
|
107
|
+
match += 1
|
|
101
108
|
# validate data type: StaticSelection
|
|
102
109
|
if not isinstance(v, StaticSelection):
|
|
103
110
|
error_messages.append(f"Error! Input type `{type(v)}` is not `StaticSelection`")
|
|
@@ -110,10 +117,10 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
110
117
|
match += 1
|
|
111
118
|
if match > 1:
|
|
112
119
|
# more than 1 match
|
|
113
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
120
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
114
121
|
elif match == 0:
|
|
115
122
|
# no match
|
|
116
|
-
raise ValueError("No match found when setting `actual_instance` in AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
123
|
+
raise ValueError("No match found when setting `actual_instance` in AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
117
124
|
else:
|
|
118
125
|
return v
|
|
119
126
|
|
|
@@ -158,6 +165,12 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
158
165
|
match += 1
|
|
159
166
|
except (ValidationError, ValueError) as e:
|
|
160
167
|
error_messages.append(str(e))
|
|
168
|
+
# deserialize data into ShufflingSelection
|
|
169
|
+
try:
|
|
170
|
+
instance.actual_instance = ShufflingSelection.from_json(json_str)
|
|
171
|
+
match += 1
|
|
172
|
+
except (ValidationError, ValueError) as e:
|
|
173
|
+
error_messages.append(str(e))
|
|
161
174
|
# deserialize data into StaticSelection
|
|
162
175
|
try:
|
|
163
176
|
instance.actual_instance = StaticSelection.from_json(json_str)
|
|
@@ -173,10 +186,10 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
173
186
|
|
|
174
187
|
if match > 1:
|
|
175
188
|
# more than 1 match
|
|
176
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
189
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
177
190
|
elif match == 0:
|
|
178
191
|
# no match
|
|
179
|
-
raise ValueError("No match found when deserializing the JSON string into AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
192
|
+
raise ValueError("No match found when deserializing the JSON string into AbTestSelectionAInner with oneOf schemas: AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
180
193
|
else:
|
|
181
194
|
return instance
|
|
182
195
|
|
|
@@ -190,7 +203,7 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
190
203
|
else:
|
|
191
204
|
return json.dumps(self.actual_instance)
|
|
192
205
|
|
|
193
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]]:
|
|
206
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AbTestSelection, CappedSelection, ConditionalValidationSelection, DemographicSelection, LabelingSelection, ShufflingSelection, StaticSelection, ValidationSelection]]:
|
|
194
207
|
"""Returns the dict representation of the actual instance"""
|
|
195
208
|
if self.actual_instance is None:
|
|
196
209
|
return None
|
|
@@ -207,6 +220,7 @@ class AbTestSelectionAInner(BaseModel):
|
|
|
207
220
|
|
|
208
221
|
from rapidata.api_client.models.ab_test_selection import AbTestSelection
|
|
209
222
|
from rapidata.api_client.models.capped_selection import CappedSelection
|
|
223
|
+
from rapidata.api_client.models.shuffling_selection import ShufflingSelection
|
|
210
224
|
# TODO: Rewrite to not use raise_errors
|
|
211
225
|
AbTestSelectionAInner.model_rebuild(raise_errors=False)
|
|
212
226
|
|
|
@@ -38,7 +38,8 @@ class AddCampaignModel(BaseModel):
|
|
|
38
38
|
feature_flags: List[FeatureFlag] = Field(description="The feature flags that should be applied to the campaign.", alias="featureFlags")
|
|
39
39
|
priority: StrictInt = Field(description="The priority of the campaign.")
|
|
40
40
|
is_sticky: Optional[StrictBool] = Field(default=None, description="Indicates if the campaign is sticky.", alias="isSticky")
|
|
41
|
-
|
|
41
|
+
is_preview_enabled: Optional[StrictBool] = Field(default=None, description="A flag to indicate whether the campaign should be put into preview mode after creation. This way the campaign will not start automatically and the user will have to manually start it.", alias="isPreviewEnabled")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["_t", "artifactId", "campaignName", "userFilters", "validationSetId", "selections", "featureFlags", "priority", "isSticky", "isPreviewEnabled"]
|
|
42
43
|
|
|
43
44
|
@field_validator('t')
|
|
44
45
|
def t_validate_enum(cls, value):
|
|
@@ -122,6 +123,11 @@ class AddCampaignModel(BaseModel):
|
|
|
122
123
|
if self.selections is None and "selections" in self.model_fields_set:
|
|
123
124
|
_dict['selections'] = None
|
|
124
125
|
|
|
126
|
+
# set to None if is_preview_enabled (nullable) is None
|
|
127
|
+
# and model_fields_set contains the field
|
|
128
|
+
if self.is_preview_enabled is None and "is_preview_enabled" in self.model_fields_set:
|
|
129
|
+
_dict['isPreviewEnabled'] = None
|
|
130
|
+
|
|
125
131
|
return _dict
|
|
126
132
|
|
|
127
133
|
@classmethod
|
|
@@ -142,7 +148,8 @@ class AddCampaignModel(BaseModel):
|
|
|
142
148
|
"selections": [AbTestSelectionAInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None,
|
|
143
149
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
144
150
|
"priority": obj.get("priority"),
|
|
145
|
-
"isSticky": obj.get("isSticky")
|
|
151
|
+
"isSticky": obj.get("isSticky"),
|
|
152
|
+
"isPreviewEnabled": obj.get("isPreviewEnabled")
|
|
146
153
|
})
|
|
147
154
|
return _obj
|
|
148
155
|
|
|
@@ -0,0 +1,106 @@
|
|
|
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, StrictBool, StrictFloat, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from rapidata.api_client.models.add_user_response_result_validation_truth import AddUserResponseResultValidationTruth
|
|
23
|
+
from rapidata.api_client.models.translated_string import TranslatedString
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class AddUserResponseResult(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
AddUserResponseResult
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
is_accepted: StrictBool = Field(alias="isAccepted")
|
|
32
|
+
validation_truth: Optional[AddUserResponseResultValidationTruth] = Field(default=None, alias="validationTruth")
|
|
33
|
+
explanation: Optional[TranslatedString] = None
|
|
34
|
+
user_score: Union[StrictFloat, StrictInt] = Field(alias="userScore")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["isAccepted", "validationTruth", "explanation", "userScore"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of AddUserResponseResult from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of validation_truth
|
|
77
|
+
if self.validation_truth:
|
|
78
|
+
_dict['validationTruth'] = self.validation_truth.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of explanation
|
|
80
|
+
if self.explanation:
|
|
81
|
+
_dict['explanation'] = self.explanation.to_dict()
|
|
82
|
+
# set to None if validation_truth (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.validation_truth is None and "validation_truth" in self.model_fields_set:
|
|
85
|
+
_dict['validationTruth'] = None
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of AddUserResponseResult from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"isAccepted": obj.get("isAccepted"),
|
|
100
|
+
"validationTruth": AddUserResponseResultValidationTruth.from_dict(obj["validationTruth"]) if obj.get("validationTruth") is not None else None,
|
|
101
|
+
"explanation": TranslatedString.from_dict(obj["explanation"]) if obj.get("explanation") is not None else None,
|
|
102
|
+
"userScore": obj.get("userScore")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,258 @@
|
|
|
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.attach_category_truth import AttachCategoryTruth
|
|
21
|
+
from rapidata.api_client.models.bounding_box_truth import BoundingBoxTruth
|
|
22
|
+
from rapidata.api_client.models.compare_truth import CompareTruth
|
|
23
|
+
from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
|
|
24
|
+
from rapidata.api_client.models.line_truth import LineTruth
|
|
25
|
+
from rapidata.api_client.models.locate_box_truth import LocateBoxTruth
|
|
26
|
+
from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
|
|
27
|
+
from rapidata.api_client.models.polygon_truth import PolygonTruth
|
|
28
|
+
from rapidata.api_client.models.scrub_truth import ScrubTruth
|
|
29
|
+
from rapidata.api_client.models.transcription_truth import TranscriptionTruth
|
|
30
|
+
from pydantic import StrictStr, Field
|
|
31
|
+
from typing import Union, List, Set, Optional, Dict
|
|
32
|
+
from typing_extensions import Literal, Self
|
|
33
|
+
|
|
34
|
+
ADDUSERRESPONSERESULTVALIDATIONTRUTH_ONE_OF_SCHEMAS = ["AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "TranscriptionTruth"]
|
|
35
|
+
|
|
36
|
+
class AddUserResponseResultValidationTruth(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
AddUserResponseResultValidationTruth
|
|
39
|
+
"""
|
|
40
|
+
# data type: TranscriptionTruth
|
|
41
|
+
oneof_schema_1_validator: Optional[TranscriptionTruth] = None
|
|
42
|
+
# data type: ScrubTruth
|
|
43
|
+
oneof_schema_2_validator: Optional[ScrubTruth] = None
|
|
44
|
+
# data type: PolygonTruth
|
|
45
|
+
oneof_schema_3_validator: Optional[PolygonTruth] = None
|
|
46
|
+
# data type: NamedEntityTruth
|
|
47
|
+
oneof_schema_4_validator: Optional[NamedEntityTruth] = None
|
|
48
|
+
# data type: LocateBoxTruth
|
|
49
|
+
oneof_schema_5_validator: Optional[LocateBoxTruth] = None
|
|
50
|
+
# data type: LineTruth
|
|
51
|
+
oneof_schema_6_validator: Optional[LineTruth] = None
|
|
52
|
+
# data type: EmptyValidationTruth
|
|
53
|
+
oneof_schema_7_validator: Optional[EmptyValidationTruth] = None
|
|
54
|
+
# data type: CompareTruth
|
|
55
|
+
oneof_schema_8_validator: Optional[CompareTruth] = None
|
|
56
|
+
# data type: AttachCategoryTruth
|
|
57
|
+
oneof_schema_9_validator: Optional[AttachCategoryTruth] = None
|
|
58
|
+
# data type: BoundingBoxTruth
|
|
59
|
+
oneof_schema_10_validator: Optional[BoundingBoxTruth] = None
|
|
60
|
+
actual_instance: Optional[Union[AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth]] = None
|
|
61
|
+
one_of_schemas: Set[str] = { "AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "TranscriptionTruth" }
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
validate_assignment=True,
|
|
65
|
+
protected_namespaces=(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
73
|
+
if args:
|
|
74
|
+
if len(args) > 1:
|
|
75
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
76
|
+
if kwargs:
|
|
77
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
78
|
+
super().__init__(actual_instance=args[0])
|
|
79
|
+
else:
|
|
80
|
+
super().__init__(**kwargs)
|
|
81
|
+
|
|
82
|
+
@field_validator('actual_instance')
|
|
83
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
84
|
+
if v is None:
|
|
85
|
+
return v
|
|
86
|
+
|
|
87
|
+
instance = AddUserResponseResultValidationTruth.model_construct()
|
|
88
|
+
error_messages = []
|
|
89
|
+
match = 0
|
|
90
|
+
# validate data type: TranscriptionTruth
|
|
91
|
+
if not isinstance(v, TranscriptionTruth):
|
|
92
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionTruth`")
|
|
93
|
+
else:
|
|
94
|
+
match += 1
|
|
95
|
+
# validate data type: ScrubTruth
|
|
96
|
+
if not isinstance(v, ScrubTruth):
|
|
97
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubTruth`")
|
|
98
|
+
else:
|
|
99
|
+
match += 1
|
|
100
|
+
# validate data type: PolygonTruth
|
|
101
|
+
if not isinstance(v, PolygonTruth):
|
|
102
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonTruth`")
|
|
103
|
+
else:
|
|
104
|
+
match += 1
|
|
105
|
+
# validate data type: NamedEntityTruth
|
|
106
|
+
if not isinstance(v, NamedEntityTruth):
|
|
107
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityTruth`")
|
|
108
|
+
else:
|
|
109
|
+
match += 1
|
|
110
|
+
# validate data type: LocateBoxTruth
|
|
111
|
+
if not isinstance(v, LocateBoxTruth):
|
|
112
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocateBoxTruth`")
|
|
113
|
+
else:
|
|
114
|
+
match += 1
|
|
115
|
+
# validate data type: LineTruth
|
|
116
|
+
if not isinstance(v, LineTruth):
|
|
117
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LineTruth`")
|
|
118
|
+
else:
|
|
119
|
+
match += 1
|
|
120
|
+
# validate data type: EmptyValidationTruth
|
|
121
|
+
if not isinstance(v, EmptyValidationTruth):
|
|
122
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `EmptyValidationTruth`")
|
|
123
|
+
else:
|
|
124
|
+
match += 1
|
|
125
|
+
# validate data type: CompareTruth
|
|
126
|
+
if not isinstance(v, CompareTruth):
|
|
127
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareTruth`")
|
|
128
|
+
else:
|
|
129
|
+
match += 1
|
|
130
|
+
# validate data type: AttachCategoryTruth
|
|
131
|
+
if not isinstance(v, AttachCategoryTruth):
|
|
132
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryTruth`")
|
|
133
|
+
else:
|
|
134
|
+
match += 1
|
|
135
|
+
# validate data type: BoundingBoxTruth
|
|
136
|
+
if not isinstance(v, BoundingBoxTruth):
|
|
137
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxTruth`")
|
|
138
|
+
else:
|
|
139
|
+
match += 1
|
|
140
|
+
if match > 1:
|
|
141
|
+
# more than 1 match
|
|
142
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in AddUserResponseResultValidationTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
143
|
+
elif match == 0:
|
|
144
|
+
# no match
|
|
145
|
+
raise ValueError("No match found when setting `actual_instance` in AddUserResponseResultValidationTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
146
|
+
else:
|
|
147
|
+
return v
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
151
|
+
return cls.from_json(json.dumps(obj))
|
|
152
|
+
|
|
153
|
+
@classmethod
|
|
154
|
+
def from_json(cls, json_str: Optional[str]) -> Self:
|
|
155
|
+
"""Returns the object represented by the json string"""
|
|
156
|
+
instance = cls.model_construct()
|
|
157
|
+
if json_str is None:
|
|
158
|
+
return instance
|
|
159
|
+
|
|
160
|
+
error_messages = []
|
|
161
|
+
match = 0
|
|
162
|
+
|
|
163
|
+
# deserialize data into TranscriptionTruth
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = TranscriptionTruth.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
169
|
+
# deserialize data into ScrubTruth
|
|
170
|
+
try:
|
|
171
|
+
instance.actual_instance = ScrubTruth.from_json(json_str)
|
|
172
|
+
match += 1
|
|
173
|
+
except (ValidationError, ValueError) as e:
|
|
174
|
+
error_messages.append(str(e))
|
|
175
|
+
# deserialize data into PolygonTruth
|
|
176
|
+
try:
|
|
177
|
+
instance.actual_instance = PolygonTruth.from_json(json_str)
|
|
178
|
+
match += 1
|
|
179
|
+
except (ValidationError, ValueError) as e:
|
|
180
|
+
error_messages.append(str(e))
|
|
181
|
+
# deserialize data into NamedEntityTruth
|
|
182
|
+
try:
|
|
183
|
+
instance.actual_instance = NamedEntityTruth.from_json(json_str)
|
|
184
|
+
match += 1
|
|
185
|
+
except (ValidationError, ValueError) as e:
|
|
186
|
+
error_messages.append(str(e))
|
|
187
|
+
# deserialize data into LocateBoxTruth
|
|
188
|
+
try:
|
|
189
|
+
instance.actual_instance = LocateBoxTruth.from_json(json_str)
|
|
190
|
+
match += 1
|
|
191
|
+
except (ValidationError, ValueError) as e:
|
|
192
|
+
error_messages.append(str(e))
|
|
193
|
+
# deserialize data into LineTruth
|
|
194
|
+
try:
|
|
195
|
+
instance.actual_instance = LineTruth.from_json(json_str)
|
|
196
|
+
match += 1
|
|
197
|
+
except (ValidationError, ValueError) as e:
|
|
198
|
+
error_messages.append(str(e))
|
|
199
|
+
# deserialize data into EmptyValidationTruth
|
|
200
|
+
try:
|
|
201
|
+
instance.actual_instance = EmptyValidationTruth.from_json(json_str)
|
|
202
|
+
match += 1
|
|
203
|
+
except (ValidationError, ValueError) as e:
|
|
204
|
+
error_messages.append(str(e))
|
|
205
|
+
# deserialize data into CompareTruth
|
|
206
|
+
try:
|
|
207
|
+
instance.actual_instance = CompareTruth.from_json(json_str)
|
|
208
|
+
match += 1
|
|
209
|
+
except (ValidationError, ValueError) as e:
|
|
210
|
+
error_messages.append(str(e))
|
|
211
|
+
# deserialize data into AttachCategoryTruth
|
|
212
|
+
try:
|
|
213
|
+
instance.actual_instance = AttachCategoryTruth.from_json(json_str)
|
|
214
|
+
match += 1
|
|
215
|
+
except (ValidationError, ValueError) as e:
|
|
216
|
+
error_messages.append(str(e))
|
|
217
|
+
# deserialize data into BoundingBoxTruth
|
|
218
|
+
try:
|
|
219
|
+
instance.actual_instance = BoundingBoxTruth.from_json(json_str)
|
|
220
|
+
match += 1
|
|
221
|
+
except (ValidationError, ValueError) as e:
|
|
222
|
+
error_messages.append(str(e))
|
|
223
|
+
|
|
224
|
+
if match > 1:
|
|
225
|
+
# more than 1 match
|
|
226
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into AddUserResponseResultValidationTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
227
|
+
elif match == 0:
|
|
228
|
+
# no match
|
|
229
|
+
raise ValueError("No match found when deserializing the JSON string into AddUserResponseResultValidationTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
230
|
+
else:
|
|
231
|
+
return instance
|
|
232
|
+
|
|
233
|
+
def to_json(self) -> str:
|
|
234
|
+
"""Returns the JSON representation of the actual instance"""
|
|
235
|
+
if self.actual_instance is None:
|
|
236
|
+
return "null"
|
|
237
|
+
|
|
238
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
239
|
+
return self.actual_instance.to_json()
|
|
240
|
+
else:
|
|
241
|
+
return json.dumps(self.actual_instance)
|
|
242
|
+
|
|
243
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth]]:
|
|
244
|
+
"""Returns the dict representation of the actual instance"""
|
|
245
|
+
if self.actual_instance is None:
|
|
246
|
+
return None
|
|
247
|
+
|
|
248
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
249
|
+
return self.actual_instance.to_dict()
|
|
250
|
+
else:
|
|
251
|
+
# primitive type
|
|
252
|
+
return self.actual_instance
|
|
253
|
+
|
|
254
|
+
def to_str(self) -> str:
|
|
255
|
+
"""Returns the string representation of the actual instance"""
|
|
256
|
+
return pprint.pformat(self.model_dump())
|
|
257
|
+
|
|
258
|
+
|
|
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
24
|
-
from rapidata.api_client.models.
|
|
24
|
+
from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ class AddValidationRapidModel(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
validation_set_id: StrictStr = Field(description="The ID of the validation set to add the rapid to.", alias="validationSetId")
|
|
33
33
|
payload: AddValidationRapidModelPayload
|
|
34
|
-
metadata: List[
|
|
34
|
+
metadata: List[CreateDatapointFromFilesModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
35
|
truth: AddValidationRapidModelTruth
|
|
36
36
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
37
37
|
explanation: Optional[StrictStr] = Field(default=None, description="An explanation for the users if they answer the rapid incorrectly.")
|
|
@@ -113,7 +113,7 @@ class AddValidationRapidModel(BaseModel):
|
|
|
113
113
|
_obj = cls.model_validate({
|
|
114
114
|
"validationSetId": obj.get("validationSetId"),
|
|
115
115
|
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
116
|
-
"metadata": [
|
|
116
|
+
"metadata": [CreateDatapointFromFilesModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
117
117
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
118
118
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
119
119
|
"explanation": obj.get("explanation")
|
|
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
24
|
-
from rapidata.api_client.models.
|
|
24
|
+
from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
validation_set_id: StrictStr = Field(description="The ID of the validation set to add the rapid to.", alias="validationSetId")
|
|
33
33
|
payload: AddValidationRapidModelPayload
|
|
34
|
-
metadata: List[
|
|
34
|
+
metadata: List[CreateDatapointFromFilesModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
35
|
truth: AddValidationRapidModelTruth
|
|
36
36
|
texts: List[StrictStr] = Field(description="The texts to use for the rapid.")
|
|
37
37
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
@@ -114,7 +114,7 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
114
114
|
_obj = cls.model_validate({
|
|
115
115
|
"validationSetId": obj.get("validationSetId"),
|
|
116
116
|
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
117
|
-
"metadata": [
|
|
117
|
+
"metadata": [CreateDatapointFromFilesModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
118
118
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
119
119
|
"texts": obj.get("texts"),
|
|
120
120
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|