rapidata 1.2.0__py3-none-any.whl → 1.2.2__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 +4 -0
- rapidata/api_client/__init__.py +25 -5
- rapidata/api_client/api/dataset_api.py +388 -388
- rapidata/api_client/api/workflow_api.py +18 -1064
- rapidata/api_client/models/__init__.py +25 -5
- rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
- rapidata/api_client/models/classification_metadata_model.py +98 -0
- rapidata/api_client/models/compare_workflow_config.py +3 -3
- rapidata/api_client/models/compare_workflow_config_model.py +3 -3
- rapidata/api_client/models/compare_workflow_model1.py +4 -18
- rapidata/api_client/models/compare_workflow_model1_referee.py +154 -0
- rapidata/api_client/models/completed_rapid_model.py +3 -3
- rapidata/api_client/models/completed_rapid_model_asset.py +170 -0
- rapidata/api_client/models/count_metadata_model.py +98 -0
- rapidata/api_client/models/demographic_metadata_model.py +100 -0
- rapidata/api_client/models/file_asset_model.py +3 -3
- rapidata/api_client/models/file_asset_model1.py +108 -0
- rapidata/api_client/models/file_asset_model1_metadata_inner.py +252 -0
- rapidata/api_client/models/file_asset_model2.py +108 -0
- rapidata/api_client/models/file_asset_model_metadata_inner.py +252 -0
- rapidata/api_client/models/image_dimension_metadata_model.py +100 -0
- rapidata/api_client/models/in_progress_rapid_model.py +3 -3
- rapidata/api_client/models/location_metadata_model.py +100 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/multi_asset_model1.py +118 -0
- rapidata/api_client/models/multi_asset_model1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_model2.py +118 -0
- rapidata/api_client/models/not_started_rapid_model.py +3 -3
- rapidata/api_client/models/null_asset_model.py +3 -3
- rapidata/api_client/models/null_asset_model1.py +106 -0
- rapidata/api_client/models/null_asset_model2.py +106 -0
- rapidata/api_client/models/original_filename_metadata_model.py +98 -0
- rapidata/api_client/models/prompt_metadata_model.py +98 -0
- rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
- rapidata/api_client/models/ranked_datapoint_model.py +3 -3
- rapidata/api_client/models/simple_workflow_config.py +6 -6
- rapidata/api_client/models/simple_workflow_config_model.py +3 -3
- rapidata/api_client/models/simple_workflow_model1.py +7 -21
- rapidata/api_client/models/simple_workflow_model1_blueprint.py +238 -0
- rapidata/api_client/models/text_asset_model.py +3 -3
- rapidata/api_client/models/text_asset_model1.py +108 -0
- rapidata/api_client/models/text_asset_model2.py +108 -0
- rapidata/api_client/models/text_metadata_model.py +98 -0
- rapidata/api_client/models/transcription_metadata_model.py +98 -0
- rapidata/api_client/models/translated_prompt_metadata_model.py +102 -0
- rapidata/api_client/models/translated_string.py +93 -0
- rapidata/api_client_README.md +26 -10
- rapidata/rapidata_client/__init__.py +10 -0
- rapidata/rapidata_client/assets/media_asset.py +1 -1
- rapidata/rapidata_client/assets/multi_asset.py +12 -3
- rapidata/rapidata_client/dataset/rapidata_dataset.py +43 -9
- rapidata/rapidata_client/dataset/rapidata_validation_set.py +26 -6
- rapidata/rapidata_client/dataset/validation_set_builder.py +1 -1
- rapidata/rapidata_client/filter/__init__.py +7 -0
- rapidata/rapidata_client/filter/age_filter.py +16 -0
- rapidata/rapidata_client/filter/base_filter.py +9 -0
- rapidata/rapidata_client/filter/campaign_filter.py +17 -0
- rapidata/rapidata_client/filter/country_filter.py +16 -0
- rapidata/rapidata_client/filter/gender_filter.py +16 -0
- rapidata/rapidata_client/filter/language_filter.py +18 -0
- rapidata/rapidata_client/filter/user_score_filter.py +19 -0
- rapidata/rapidata_client/order/rapidata_order_builder.py +141 -44
- rapidata/rapidata_client/selection/demographic_selection.py +3 -2
- {rapidata-1.2.0.dist-info → rapidata-1.2.2.dist-info}/METADATA +1 -1
- {rapidata-1.2.0.dist-info → rapidata-1.2.2.dist-info}/RECORD +67 -34
- {rapidata-1.2.0.dist-info → rapidata-1.2.2.dist-info}/LICENSE +0 -0
- {rapidata-1.2.0.dist-info → rapidata-1.2.2.dist-info}/WHEEL +0 -0
|
@@ -44,6 +44,7 @@ from rapidata.api_client.models.capped_selection import CappedSelection
|
|
|
44
44
|
from rapidata.api_client.models.capped_selection_selections_inner import CappedSelectionSelectionsInner
|
|
45
45
|
from rapidata.api_client.models.classification_metadata import ClassificationMetadata
|
|
46
46
|
from rapidata.api_client.models.classification_metadata_filter_config import ClassificationMetadataFilterConfig
|
|
47
|
+
from rapidata.api_client.models.classification_metadata_model import ClassificationMetadataModel
|
|
47
48
|
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
48
49
|
from rapidata.api_client.models.clone_dataset_model import CloneDatasetModel
|
|
49
50
|
from rapidata.api_client.models.clone_order_model import CloneOrderModel
|
|
@@ -54,15 +55,17 @@ from rapidata.api_client.models.compare_result import CompareResult
|
|
|
54
55
|
from rapidata.api_client.models.compare_truth import CompareTruth
|
|
55
56
|
from rapidata.api_client.models.compare_workflow_config import CompareWorkflowConfig
|
|
56
57
|
from rapidata.api_client.models.compare_workflow_config_model import CompareWorkflowConfigModel
|
|
57
|
-
from rapidata.api_client.models.compare_workflow_config_referee import CompareWorkflowConfigReferee
|
|
58
58
|
from rapidata.api_client.models.compare_workflow_get_result_overview_get200_response import CompareWorkflowGetResultOverviewGet200Response
|
|
59
59
|
from rapidata.api_client.models.compare_workflow_model import CompareWorkflowModel
|
|
60
60
|
from rapidata.api_client.models.compare_workflow_model1 import CompareWorkflowModel1
|
|
61
|
+
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
61
62
|
from rapidata.api_client.models.completed_rapid_model import CompletedRapidModel
|
|
63
|
+
from rapidata.api_client.models.completed_rapid_model_asset import CompletedRapidModelAsset
|
|
62
64
|
from rapidata.api_client.models.conditional_validation_selection import ConditionalValidationSelection
|
|
63
65
|
from rapidata.api_client.models.coordinate import Coordinate
|
|
64
66
|
from rapidata.api_client.models.count_classification_metadata_filter_config import CountClassificationMetadataFilterConfig
|
|
65
67
|
from rapidata.api_client.models.count_metadata import CountMetadata
|
|
68
|
+
from rapidata.api_client.models.count_metadata_model import CountMetadataModel
|
|
66
69
|
from rapidata.api_client.models.country_user_filter_model import CountryUserFilterModel
|
|
67
70
|
from rapidata.api_client.models.create_client_model import CreateClientModel
|
|
68
71
|
from rapidata.api_client.models.create_complex_order_model import CreateComplexOrderModel
|
|
@@ -72,9 +75,6 @@ from rapidata.api_client.models.create_dataset_artifact_model import CreateDatas
|
|
|
72
75
|
from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
|
|
73
76
|
from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
|
|
74
77
|
from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
|
|
75
|
-
from rapidata.api_client.models.create_independent_workflow_model import CreateIndependentWorkflowModel
|
|
76
|
-
from rapidata.api_client.models.create_independent_workflow_model_workflow_config import CreateIndependentWorkflowModelWorkflowConfig
|
|
77
|
-
from rapidata.api_client.models.create_independent_workflow_result import CreateIndependentWorkflowResult
|
|
78
78
|
from rapidata.api_client.models.create_order_model import CreateOrderModel
|
|
79
79
|
from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
|
|
80
80
|
from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
|
|
@@ -95,6 +95,7 @@ from rapidata.api_client.models.datapoint_model import DatapointModel
|
|
|
95
95
|
from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
|
|
96
96
|
from rapidata.api_client.models.dataset_artifact_model import DatasetArtifactModel
|
|
97
97
|
from rapidata.api_client.models.dataset_evaluation_step_model import DatasetEvaluationStepModel
|
|
98
|
+
from rapidata.api_client.models.demographic_metadata_model import DemographicMetadataModel
|
|
98
99
|
from rapidata.api_client.models.demographic_selection import DemographicSelection
|
|
99
100
|
from rapidata.api_client.models.early_stopping_referee_model import EarlyStoppingRefereeModel
|
|
100
101
|
from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
|
|
@@ -106,6 +107,10 @@ from rapidata.api_client.models.file_artifact_model import FileArtifactModel
|
|
|
106
107
|
from rapidata.api_client.models.file_asset import FileAsset
|
|
107
108
|
from rapidata.api_client.models.file_asset_metadata_inner import FileAssetMetadataInner
|
|
108
109
|
from rapidata.api_client.models.file_asset_model import FileAssetModel
|
|
110
|
+
from rapidata.api_client.models.file_asset_model1 import FileAssetModel1
|
|
111
|
+
from rapidata.api_client.models.file_asset_model1_metadata_inner import FileAssetModel1MetadataInner
|
|
112
|
+
from rapidata.api_client.models.file_asset_model2 import FileAssetModel2
|
|
113
|
+
from rapidata.api_client.models.file_asset_model_metadata_inner import FileAssetModelMetadataInner
|
|
109
114
|
from rapidata.api_client.models.filter import Filter
|
|
110
115
|
from rapidata.api_client.models.filter_operator import FilterOperator
|
|
111
116
|
from rapidata.api_client.models.free_text_payload import FreeTextPayload
|
|
@@ -131,6 +136,7 @@ from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowP
|
|
|
131
136
|
from rapidata.api_client.models.get_workflow_result_overview_result import GetWorkflowResultOverviewResult
|
|
132
137
|
from rapidata.api_client.models.i_workflow_model_paged_result import IWorkflowModelPagedResult
|
|
133
138
|
from rapidata.api_client.models.image_dimension_metadata import ImageDimensionMetadata
|
|
139
|
+
from rapidata.api_client.models.image_dimension_metadata_model import ImageDimensionMetadataModel
|
|
134
140
|
from rapidata.api_client.models.import_from_file_result import ImportFromFileResult
|
|
135
141
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
136
142
|
from rapidata.api_client.models.in_progress_rapid_model import InProgressRapidModel
|
|
@@ -153,11 +159,15 @@ from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBluepri
|
|
|
153
159
|
from rapidata.api_client.models.locate_result import LocateResult
|
|
154
160
|
from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
155
161
|
from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
|
|
162
|
+
from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
|
|
156
163
|
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
157
164
|
from rapidata.api_client.models.login_model import LoginModel
|
|
158
165
|
from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
|
|
159
166
|
from rapidata.api_client.models.multi_asset import MultiAsset
|
|
160
167
|
from rapidata.api_client.models.multi_asset_model import MultiAssetModel
|
|
168
|
+
from rapidata.api_client.models.multi_asset_model1 import MultiAssetModel1
|
|
169
|
+
from rapidata.api_client.models.multi_asset_model1_assets_inner import MultiAssetModel1AssetsInner
|
|
170
|
+
from rapidata.api_client.models.multi_asset_model2 import MultiAssetModel2
|
|
161
171
|
from rapidata.api_client.models.naive_referee_config import NaiveRefereeConfig
|
|
162
172
|
from rapidata.api_client.models.naive_referee_model import NaiveRefereeModel
|
|
163
173
|
from rapidata.api_client.models.named_classification import NamedClassification
|
|
@@ -170,10 +180,13 @@ from rapidata.api_client.models.newsletter_model import NewsletterModel
|
|
|
170
180
|
from rapidata.api_client.models.not_started_rapid_model import NotStartedRapidModel
|
|
171
181
|
from rapidata.api_client.models.null_asset import NullAsset
|
|
172
182
|
from rapidata.api_client.models.null_asset_model import NullAssetModel
|
|
183
|
+
from rapidata.api_client.models.null_asset_model1 import NullAssetModel1
|
|
184
|
+
from rapidata.api_client.models.null_asset_model2 import NullAssetModel2
|
|
173
185
|
from rapidata.api_client.models.order_model import OrderModel
|
|
174
186
|
from rapidata.api_client.models.order_query_get200_response import OrderQueryGet200Response
|
|
175
187
|
from rapidata.api_client.models.order_state import OrderState
|
|
176
188
|
from rapidata.api_client.models.original_filename_metadata import OriginalFilenameMetadata
|
|
189
|
+
from rapidata.api_client.models.original_filename_metadata_model import OriginalFilenameMetadataModel
|
|
177
190
|
from rapidata.api_client.models.page_info import PageInfo
|
|
178
191
|
from rapidata.api_client.models.polygon_payload import PolygonPayload
|
|
179
192
|
from rapidata.api_client.models.polygon_rapid_blueprint import PolygonRapidBlueprint
|
|
@@ -183,6 +196,7 @@ from rapidata.api_client.models.private_text_metadata_input import PrivateTextMe
|
|
|
183
196
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
184
197
|
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
185
198
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
199
|
+
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
186
200
|
from rapidata.api_client.models.public_text_metadata_input import PublicTextMetadataInput
|
|
187
201
|
from rapidata.api_client.models.query_campaigns_model import QueryCampaignsModel
|
|
188
202
|
from rapidata.api_client.models.query_model import QueryModel
|
|
@@ -204,12 +218,12 @@ from rapidata.api_client.models.shape import Shape
|
|
|
204
218
|
from rapidata.api_client.models.signup_customer_model import SignupCustomerModel
|
|
205
219
|
from rapidata.api_client.models.signup_shadow_customer_model import SignupShadowCustomerModel
|
|
206
220
|
from rapidata.api_client.models.simple_workflow_config import SimpleWorkflowConfig
|
|
207
|
-
from rapidata.api_client.models.simple_workflow_config_blueprint import SimpleWorkflowConfigBlueprint
|
|
208
221
|
from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
|
|
209
222
|
from rapidata.api_client.models.simple_workflow_config_model_blueprint import SimpleWorkflowConfigModelBlueprint
|
|
210
223
|
from rapidata.api_client.models.simple_workflow_get_result_overview_get200_response import SimpleWorkflowGetResultOverviewGet200Response
|
|
211
224
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
212
225
|
from rapidata.api_client.models.simple_workflow_model1 import SimpleWorkflowModel1
|
|
226
|
+
from rapidata.api_client.models.simple_workflow_model1_blueprint import SimpleWorkflowModel1Blueprint
|
|
213
227
|
from rapidata.api_client.models.simple_workflow_model_blueprint import SimpleWorkflowModelBlueprint
|
|
214
228
|
from rapidata.api_client.models.skip_result import SkipResult
|
|
215
229
|
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
@@ -219,14 +233,20 @@ from rapidata.api_client.models.submit_coco_model import SubmitCocoModel
|
|
|
219
233
|
from rapidata.api_client.models.submit_coco_result import SubmitCocoResult
|
|
220
234
|
from rapidata.api_client.models.text_asset import TextAsset
|
|
221
235
|
from rapidata.api_client.models.text_asset_model import TextAssetModel
|
|
236
|
+
from rapidata.api_client.models.text_asset_model1 import TextAssetModel1
|
|
237
|
+
from rapidata.api_client.models.text_asset_model2 import TextAssetModel2
|
|
222
238
|
from rapidata.api_client.models.text_metadata import TextMetadata
|
|
239
|
+
from rapidata.api_client.models.text_metadata_model import TextMetadataModel
|
|
223
240
|
from rapidata.api_client.models.transcription_metadata import TranscriptionMetadata
|
|
224
241
|
from rapidata.api_client.models.transcription_metadata_input import TranscriptionMetadataInput
|
|
242
|
+
from rapidata.api_client.models.transcription_metadata_model import TranscriptionMetadataModel
|
|
225
243
|
from rapidata.api_client.models.transcription_payload import TranscriptionPayload
|
|
226
244
|
from rapidata.api_client.models.transcription_rapid_blueprint import TranscriptionRapidBlueprint
|
|
227
245
|
from rapidata.api_client.models.transcription_result import TranscriptionResult
|
|
228
246
|
from rapidata.api_client.models.transcription_truth import TranscriptionTruth
|
|
229
247
|
from rapidata.api_client.models.transcription_word import TranscriptionWord
|
|
248
|
+
from rapidata.api_client.models.translated_prompt_metadata_model import TranslatedPromptMetadataModel
|
|
249
|
+
from rapidata.api_client.models.translated_string import TranslatedString
|
|
230
250
|
from rapidata.api_client.models.unlock_order_result import UnlockOrderResult
|
|
231
251
|
from rapidata.api_client.models.update_access_model import UpdateAccessModel
|
|
232
252
|
from rapidata.api_client.models.update_order_model import UpdateOrderModel
|
|
@@ -33,9 +33,9 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
33
33
|
payload: AddValidationRapidModelPayload
|
|
34
34
|
metadata: List[DatapointMetadataModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
35
|
truth: AddValidationRapidModelTruth
|
|
36
|
-
|
|
36
|
+
texts: List[StrictStr]
|
|
37
37
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
38
|
-
__properties: ClassVar[List[str]] = ["validationSetId", "payload", "metadata", "truth", "
|
|
38
|
+
__properties: ClassVar[List[str]] = ["validationSetId", "payload", "metadata", "truth", "texts", "randomCorrectProbability"]
|
|
39
39
|
|
|
40
40
|
model_config = ConfigDict(
|
|
41
41
|
populate_by_name=True,
|
|
@@ -110,7 +110,7 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
110
110
|
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
111
111
|
"metadata": [DatapointMetadataModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
112
112
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
113
|
-
"
|
|
113
|
+
"texts": obj.get("texts"),
|
|
114
114
|
"randomCorrectProbability": obj.get("randomCorrectProbability")
|
|
115
115
|
})
|
|
116
116
|
return _obj
|
|
@@ -0,0 +1,98 @@
|
|
|
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 ClassificationMetadataModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ClassificationMetadataModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for ClassificationMetadata", alias="_t")
|
|
30
|
+
classification: StrictStr
|
|
31
|
+
identifier: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "classification", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['ClassificationMetadata']):
|
|
38
|
+
raise ValueError("must be one of enum values ('ClassificationMetadata')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of ClassificationMetadataModel from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ClassificationMetadataModel from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'ClassificationMetadata',
|
|
93
|
+
"classification": obj.get("classification"),
|
|
94
|
+
"identifier": obj.get("identifier")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
23
23
|
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -35,7 +35,7 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
35
35
|
match_size: Optional[StrictInt] = Field(default=None, alias="matchSize")
|
|
36
36
|
scaling_factor: Optional[StrictInt] = Field(default=None, alias="scalingFactor")
|
|
37
37
|
matches_until_completed: Optional[StrictInt] = Field(default=None, alias="matchesUntilCompleted")
|
|
38
|
-
referee:
|
|
38
|
+
referee: CompareWorkflowModel1Referee
|
|
39
39
|
target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
|
|
40
40
|
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
41
41
|
priority: Optional[StrictStr] = None
|
|
@@ -122,7 +122,7 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
122
122
|
"matchSize": obj.get("matchSize"),
|
|
123
123
|
"scalingFactor": obj.get("scalingFactor"),
|
|
124
124
|
"matchesUntilCompleted": obj.get("matchesUntilCompleted"),
|
|
125
|
-
"referee":
|
|
125
|
+
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
126
126
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
127
127
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
128
128
|
"priority": obj.get("priority"),
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
23
23
|
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -35,7 +35,7 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
35
35
|
match_size: Optional[StrictInt] = Field(default=None, description="The number of datapoints to match against each other in each match.", alias="matchSize")
|
|
36
36
|
scaling_factor: Optional[StrictInt] = Field(default=None, description="Scaling factor to use in the ELO calculation. Adjusts the sensitivity of the Elo rating system to differences in player ratings. It affects how much the rating changes based on the expected outcome versus the actual outcome.", alias="scalingFactor")
|
|
37
37
|
matches_until_completed: Optional[StrictInt] = Field(default=None, description="The number of matches to run before each datapoint is considered \"completed\".", alias="matchesUntilCompleted")
|
|
38
|
-
referee:
|
|
38
|
+
referee: CompareWorkflowModel1Referee
|
|
39
39
|
target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
|
|
40
40
|
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
41
41
|
priority: Optional[StrictStr] = None
|
|
@@ -127,7 +127,7 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
127
127
|
"matchSize": obj.get("matchSize"),
|
|
128
128
|
"scalingFactor": obj.get("scalingFactor"),
|
|
129
129
|
"matchesUntilCompleted": obj.get("matchesUntilCompleted"),
|
|
130
|
-
"referee":
|
|
130
|
+
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
131
131
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
132
132
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
133
133
|
"priority": obj.get("priority"),
|
|
@@ -19,8 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.
|
|
23
|
-
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -31,11 +30,8 @@ class CompareWorkflowModel1(BaseModel):
|
|
|
31
30
|
t: StrictStr = Field(description="Discriminator value for CompareWorkflowModel", alias="_t")
|
|
32
31
|
id: StrictStr
|
|
33
32
|
dataset_id: Optional[StrictStr] = Field(alias="datasetId")
|
|
34
|
-
|
|
35
|
-
feature_flags: List[FeatureFlag] = Field(alias="featureFlags")
|
|
36
|
-
referee: CompareWorkflowConfigReferee
|
|
33
|
+
referee: CompareWorkflowModel1Referee
|
|
37
34
|
state: StrictStr
|
|
38
|
-
priority: StrictStr
|
|
39
35
|
criteria: StrictStr
|
|
40
36
|
name: StrictStr
|
|
41
37
|
owner_mail: Optional[StrictStr] = Field(alias="ownerMail")
|
|
@@ -44,7 +40,7 @@ class CompareWorkflowModel1(BaseModel):
|
|
|
44
40
|
match_size: StrictInt = Field(alias="matchSize")
|
|
45
41
|
scaling_factor: StrictInt = Field(alias="scalingFactor")
|
|
46
42
|
matches_until_completed: StrictInt = Field(alias="matchesUntilCompleted")
|
|
47
|
-
__properties: ClassVar[List[str]] = ["_t", "id", "datasetId", "
|
|
43
|
+
__properties: ClassVar[List[str]] = ["_t", "id", "datasetId", "referee", "state", "criteria", "name", "ownerMail", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted"]
|
|
48
44
|
|
|
49
45
|
@field_validator('t')
|
|
50
46
|
def t_validate_enum(cls, value):
|
|
@@ -92,13 +88,6 @@ class CompareWorkflowModel1(BaseModel):
|
|
|
92
88
|
exclude=excluded_fields,
|
|
93
89
|
exclude_none=True,
|
|
94
90
|
)
|
|
95
|
-
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
96
|
-
_items = []
|
|
97
|
-
if self.feature_flags:
|
|
98
|
-
for _item_feature_flags in self.feature_flags:
|
|
99
|
-
if _item_feature_flags:
|
|
100
|
-
_items.append(_item_feature_flags.to_dict())
|
|
101
|
-
_dict['featureFlags'] = _items
|
|
102
91
|
# override the default output from pydantic by calling `to_dict()` of referee
|
|
103
92
|
if self.referee:
|
|
104
93
|
_dict['referee'] = self.referee.to_dict()
|
|
@@ -127,11 +116,8 @@ class CompareWorkflowModel1(BaseModel):
|
|
|
127
116
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowModel',
|
|
128
117
|
"id": obj.get("id"),
|
|
129
118
|
"datasetId": obj.get("datasetId"),
|
|
130
|
-
"
|
|
131
|
-
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
132
|
-
"referee": CompareWorkflowConfigReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
119
|
+
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
133
120
|
"state": obj.get("state"),
|
|
134
|
-
"priority": obj.get("priority"),
|
|
135
121
|
"criteria": obj.get("criteria"),
|
|
136
122
|
"name": obj.get("name"),
|
|
137
123
|
"ownerMail": obj.get("ownerMail"),
|
|
@@ -0,0 +1,154 @@
|
|
|
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.naive_referee_config import NaiveRefereeConfig
|
|
21
|
+
from rapidata.api_client.models.never_ending_referee_config import NeverEndingRefereeConfig
|
|
22
|
+
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
COMPAREWORKFLOWMODEL1REFEREE_ONE_OF_SCHEMAS = ["NaiveRefereeConfig", "NeverEndingRefereeConfig", "ProbabilisticAttachCategoryRefereeConfig"]
|
|
28
|
+
|
|
29
|
+
class CompareWorkflowModel1Referee(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
CompareWorkflowModel1Referee
|
|
32
|
+
"""
|
|
33
|
+
# data type: NaiveRefereeConfig
|
|
34
|
+
oneof_schema_1_validator: Optional[NaiveRefereeConfig] = None
|
|
35
|
+
# data type: NeverEndingRefereeConfig
|
|
36
|
+
oneof_schema_2_validator: Optional[NeverEndingRefereeConfig] = None
|
|
37
|
+
# data type: ProbabilisticAttachCategoryRefereeConfig
|
|
38
|
+
oneof_schema_3_validator: Optional[ProbabilisticAttachCategoryRefereeConfig] = None
|
|
39
|
+
actual_instance: Optional[Union[NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig]] = None
|
|
40
|
+
one_of_schemas: Set[str] = { "NaiveRefereeConfig", "NeverEndingRefereeConfig", "ProbabilisticAttachCategoryRefereeConfig" }
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
52
|
+
if args:
|
|
53
|
+
if len(args) > 1:
|
|
54
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
55
|
+
if kwargs:
|
|
56
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
57
|
+
super().__init__(actual_instance=args[0])
|
|
58
|
+
else:
|
|
59
|
+
super().__init__(**kwargs)
|
|
60
|
+
|
|
61
|
+
@field_validator('actual_instance')
|
|
62
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
63
|
+
instance = CompareWorkflowModel1Referee.model_construct()
|
|
64
|
+
error_messages = []
|
|
65
|
+
match = 0
|
|
66
|
+
# validate data type: NaiveRefereeConfig
|
|
67
|
+
if not isinstance(v, NaiveRefereeConfig):
|
|
68
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NaiveRefereeConfig`")
|
|
69
|
+
else:
|
|
70
|
+
match += 1
|
|
71
|
+
# validate data type: NeverEndingRefereeConfig
|
|
72
|
+
if not isinstance(v, NeverEndingRefereeConfig):
|
|
73
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NeverEndingRefereeConfig`")
|
|
74
|
+
else:
|
|
75
|
+
match += 1
|
|
76
|
+
# validate data type: ProbabilisticAttachCategoryRefereeConfig
|
|
77
|
+
if not isinstance(v, ProbabilisticAttachCategoryRefereeConfig):
|
|
78
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ProbabilisticAttachCategoryRefereeConfig`")
|
|
79
|
+
else:
|
|
80
|
+
match += 1
|
|
81
|
+
if match > 1:
|
|
82
|
+
# more than 1 match
|
|
83
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowModel1Referee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
84
|
+
elif match == 0:
|
|
85
|
+
# no match
|
|
86
|
+
raise ValueError("No match found when setting `actual_instance` in CompareWorkflowModel1Referee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
87
|
+
else:
|
|
88
|
+
return v
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
92
|
+
return cls.from_json(json.dumps(obj))
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> Self:
|
|
96
|
+
"""Returns the object represented by the json string"""
|
|
97
|
+
instance = cls.model_construct()
|
|
98
|
+
error_messages = []
|
|
99
|
+
match = 0
|
|
100
|
+
|
|
101
|
+
# deserialize data into NaiveRefereeConfig
|
|
102
|
+
try:
|
|
103
|
+
instance.actual_instance = NaiveRefereeConfig.from_json(json_str)
|
|
104
|
+
match += 1
|
|
105
|
+
except (ValidationError, ValueError) as e:
|
|
106
|
+
error_messages.append(str(e))
|
|
107
|
+
# deserialize data into NeverEndingRefereeConfig
|
|
108
|
+
try:
|
|
109
|
+
instance.actual_instance = NeverEndingRefereeConfig.from_json(json_str)
|
|
110
|
+
match += 1
|
|
111
|
+
except (ValidationError, ValueError) as e:
|
|
112
|
+
error_messages.append(str(e))
|
|
113
|
+
# deserialize data into ProbabilisticAttachCategoryRefereeConfig
|
|
114
|
+
try:
|
|
115
|
+
instance.actual_instance = ProbabilisticAttachCategoryRefereeConfig.from_json(json_str)
|
|
116
|
+
match += 1
|
|
117
|
+
except (ValidationError, ValueError) as e:
|
|
118
|
+
error_messages.append(str(e))
|
|
119
|
+
|
|
120
|
+
if match > 1:
|
|
121
|
+
# more than 1 match
|
|
122
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowModel1Referee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
123
|
+
elif match == 0:
|
|
124
|
+
# no match
|
|
125
|
+
raise ValueError("No match found when deserializing the JSON string into CompareWorkflowModel1Referee with oneOf schemas: NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig. Details: " + ", ".join(error_messages))
|
|
126
|
+
else:
|
|
127
|
+
return instance
|
|
128
|
+
|
|
129
|
+
def to_json(self) -> str:
|
|
130
|
+
"""Returns the JSON representation of the actual instance"""
|
|
131
|
+
if self.actual_instance is None:
|
|
132
|
+
return "null"
|
|
133
|
+
|
|
134
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
135
|
+
return self.actual_instance.to_json()
|
|
136
|
+
else:
|
|
137
|
+
return json.dumps(self.actual_instance)
|
|
138
|
+
|
|
139
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], NaiveRefereeConfig, NeverEndingRefereeConfig, ProbabilisticAttachCategoryRefereeConfig]]:
|
|
140
|
+
"""Returns the dict representation of the actual instance"""
|
|
141
|
+
if self.actual_instance is None:
|
|
142
|
+
return None
|
|
143
|
+
|
|
144
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
145
|
+
return self.actual_instance.to_dict()
|
|
146
|
+
else:
|
|
147
|
+
# primitive type
|
|
148
|
+
return self.actual_instance
|
|
149
|
+
|
|
150
|
+
def to_str(self) -> str:
|
|
151
|
+
"""Returns the string representation of the actual instance"""
|
|
152
|
+
return pprint.pformat(self.model_dump())
|
|
153
|
+
|
|
154
|
+
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.completed_rapid_model_asset import CompletedRapidModelAsset
|
|
23
23
|
from rapidata.api_client.models.rapid_answer import RapidAnswer
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -29,7 +29,7 @@ class CompletedRapidModel(BaseModel):
|
|
|
29
29
|
CompletedRapidModel
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
-
asset:
|
|
32
|
+
asset: CompletedRapidModelAsset
|
|
33
33
|
answers: List[RapidAnswer]
|
|
34
34
|
__properties: ClassVar[List[str]] = ["rapidId", "asset", "answers"]
|
|
35
35
|
|
|
@@ -95,7 +95,7 @@ class CompletedRapidModel(BaseModel):
|
|
|
95
95
|
|
|
96
96
|
_obj = cls.model_validate({
|
|
97
97
|
"rapidId": obj.get("rapidId"),
|
|
98
|
-
"asset":
|
|
98
|
+
"asset": CompletedRapidModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
99
99
|
"answers": [RapidAnswer.from_dict(_item) for _item in obj["answers"]] if obj.get("answers") is not None else None
|
|
100
100
|
})
|
|
101
101
|
return _obj
|