rapidata 2.14.0__py3-none-any.whl → 2.15.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 +13 -0
- rapidata/api_client/api/campaign_api.py +252 -0
- rapidata/api_client/api/order_api.py +252 -0
- rapidata/api_client/api/rapid_api.py +262 -0
- rapidata/api_client/api/validation_api.py +283 -0
- rapidata/api_client/api/workflow_api.py +3 -3
- rapidata/api_client/models/__init__.py +13 -0
- rapidata/api_client/models/add_campaign_model.py +9 -2
- rapidata/api_client/models/campaign_query_result.py +2 -2
- rapidata/api_client/models/campaign_status.py +1 -0
- rapidata/api_client/models/classification_metadata.py +2 -4
- rapidata/api_client/models/compare_workflow_config.py +17 -2
- rapidata/api_client/models/compare_workflow_config_metadata_value.py +238 -0
- rapidata/api_client/models/compare_workflow_config_model.py +17 -2
- rapidata/api_client/models/compare_workflow_model.py +17 -2
- rapidata/api_client/models/count_metadata.py +1 -3
- rapidata/api_client/models/create_order_model.py +15 -1
- rapidata/api_client/models/early_stopping_referee_model.py +1 -1
- rapidata/api_client/models/evaluation_workflow_model.py +1 -1
- rapidata/api_client/models/get_rapid_responses_result.py +112 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +7 -1
- rapidata/api_client/models/image_dimension_metadata.py +1 -3
- rapidata/api_client/models/location_metadata.py +2 -4
- rapidata/api_client/models/metadata_visibilities.py +1 -0
- rapidata/api_client/models/order_model.py +2 -2
- rapidata/api_client/models/order_state.py +1 -0
- rapidata/api_client/models/original_filename_metadata.py +2 -4
- rapidata/api_client/models/prompt_metadata.py +1 -3
- rapidata/api_client/models/scrub_result.py +4 -4
- rapidata/api_client/models/source_url_metadata.py +98 -0
- rapidata/api_client/models/text_metadata.py +3 -5
- rapidata/api_client/models/transcription_metadata.py +1 -3
- rapidata/api_client/models/update_dimensions_model.py +87 -0
- rapidata/api_client_README.md +22 -4
- rapidata/rapidata_client/demographic/demographic_manager.py +35 -0
- rapidata/rapidata_client/filter/rapidata_filters.py +10 -2
- rapidata/rapidata_client/order/_rapidata_order_builder.py +7 -5
- rapidata/rapidata_client/order/rapidata_order.py +3 -5
- rapidata/rapidata_client/order/rapidata_order_manager.py +20 -20
- rapidata/rapidata_client/order/rapidata_results.py +2 -1
- rapidata/rapidata_client/rapidata_client.py +4 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +10 -9
- rapidata/rapidata_client/settings/no_shuffle.py +2 -2
- rapidata/rapidata_client/settings/rapidata_settings.py +8 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +15 -4
- rapidata/service/credential_manager.py +7 -0
- rapidata/service/openapi_service.py +6 -6
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/METADATA +1 -1
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/RECORD +51 -47
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/LICENSE +0 -0
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/WHEEL +0 -0
|
@@ -41,6 +41,7 @@ from rapidata.api_client.models.campaign_query_result_paged_result import Campai
|
|
|
41
41
|
from rapidata.api_client.models.campaign_status import CampaignStatus
|
|
42
42
|
from rapidata.api_client.models.campaign_user_filter_model import CampaignUserFilterModel
|
|
43
43
|
from rapidata.api_client.models.capped_selection import CappedSelection
|
|
44
|
+
from rapidata.api_client.models.classification_metadata import ClassificationMetadata
|
|
44
45
|
from rapidata.api_client.models.classification_metadata_filter_config import ClassificationMetadataFilterConfig
|
|
45
46
|
from rapidata.api_client.models.classification_metadata_model import ClassificationMetadataModel
|
|
46
47
|
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
@@ -54,6 +55,7 @@ from rapidata.api_client.models.compare_rapid_blueprint import CompareRapidBluep
|
|
|
54
55
|
from rapidata.api_client.models.compare_result import CompareResult
|
|
55
56
|
from rapidata.api_client.models.compare_truth import CompareTruth
|
|
56
57
|
from rapidata.api_client.models.compare_workflow_config import CompareWorkflowConfig
|
|
58
|
+
from rapidata.api_client.models.compare_workflow_config_metadata_value import CompareWorkflowConfigMetadataValue
|
|
57
59
|
from rapidata.api_client.models.compare_workflow_config_model import CompareWorkflowConfigModel
|
|
58
60
|
from rapidata.api_client.models.compare_workflow_config_model_pair_maker_config import CompareWorkflowConfigModelPairMakerConfig
|
|
59
61
|
from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
|
|
@@ -65,6 +67,7 @@ from rapidata.api_client.models.compare_workflow_model_pair_maker_config import
|
|
|
65
67
|
from rapidata.api_client.models.conditional_validation_selection import ConditionalValidationSelection
|
|
66
68
|
from rapidata.api_client.models.coordinate import Coordinate
|
|
67
69
|
from rapidata.api_client.models.count_classification_metadata_filter_config import CountClassificationMetadataFilterConfig
|
|
70
|
+
from rapidata.api_client.models.count_metadata import CountMetadata
|
|
68
71
|
from rapidata.api_client.models.count_metadata_model import CountMetadataModel
|
|
69
72
|
from rapidata.api_client.models.country_user_filter_model import CountryUserFilterModel
|
|
70
73
|
from rapidata.api_client.models.create_bridge_token_result import CreateBridgeTokenResult
|
|
@@ -133,6 +136,7 @@ from rapidata.api_client.models.get_order_by_id_result import GetOrderByIdResult
|
|
|
133
136
|
from rapidata.api_client.models.get_pipeline_by_id_result import GetPipelineByIdResult
|
|
134
137
|
from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
|
|
135
138
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
139
|
+
from rapidata.api_client.models.get_rapid_responses_result import GetRapidResponsesResult
|
|
136
140
|
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
137
141
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
138
142
|
from rapidata.api_client.models.get_simple_workflow_results_result import GetSimpleWorkflowResultsResult
|
|
@@ -143,6 +147,7 @@ from rapidata.api_client.models.get_workflow_by_id_result_workflow import GetWor
|
|
|
143
147
|
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
144
148
|
from rapidata.api_client.models.i_workflow_model_paged_result import IWorkflowModelPagedResult
|
|
145
149
|
from rapidata.api_client.models.identity_read_bridge_token_get202_response import IdentityReadBridgeTokenGet202Response
|
|
150
|
+
from rapidata.api_client.models.image_dimension_metadata import ImageDimensionMetadata
|
|
146
151
|
from rapidata.api_client.models.image_dimension_metadata_model import ImageDimensionMetadataModel
|
|
147
152
|
from rapidata.api_client.models.import_from_file_result import ImportFromFileResult
|
|
148
153
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
@@ -160,9 +165,11 @@ from rapidata.api_client.models.locate_coordinate import LocateCoordinate
|
|
|
160
165
|
from rapidata.api_client.models.locate_payload import LocatePayload
|
|
161
166
|
from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBlueprint
|
|
162
167
|
from rapidata.api_client.models.locate_result import LocateResult
|
|
168
|
+
from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
163
169
|
from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
|
|
164
170
|
from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
|
|
165
171
|
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
172
|
+
from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
|
|
166
173
|
from rapidata.api_client.models.multi_asset_model import MultiAssetModel
|
|
167
174
|
from rapidata.api_client.models.naive_referee_config import NaiveRefereeConfig
|
|
168
175
|
from rapidata.api_client.models.naive_referee_model import NaiveRefereeModel
|
|
@@ -182,6 +189,7 @@ from rapidata.api_client.models.online_pair_maker_information import OnlinePairM
|
|
|
182
189
|
from rapidata.api_client.models.order_model import OrderModel
|
|
183
190
|
from rapidata.api_client.models.order_model_paged_result import OrderModelPagedResult
|
|
184
191
|
from rapidata.api_client.models.order_state import OrderState
|
|
192
|
+
from rapidata.api_client.models.original_filename_metadata import OriginalFilenameMetadata
|
|
185
193
|
from rapidata.api_client.models.original_filename_metadata_model import OriginalFilenameMetadataModel
|
|
186
194
|
from rapidata.api_client.models.page_info import PageInfo
|
|
187
195
|
from rapidata.api_client.models.pipeline_id_workflow_put_request import PipelineIdWorkflowPutRequest
|
|
@@ -194,6 +202,7 @@ from rapidata.api_client.models.preliminary_download_result import PreliminaryDo
|
|
|
194
202
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
195
203
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
196
204
|
from rapidata.api_client.models.problem_details import ProblemDetails
|
|
205
|
+
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
197
206
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
198
207
|
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
199
208
|
from rapidata.api_client.models.public_order_model import PublicOrderModel
|
|
@@ -233,12 +242,15 @@ from rapidata.api_client.models.simple_workflow_model_blueprint import SimpleWor
|
|
|
233
242
|
from rapidata.api_client.models.skip_result import SkipResult
|
|
234
243
|
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
235
244
|
from rapidata.api_client.models.sort_direction import SortDirection
|
|
245
|
+
from rapidata.api_client.models.source_url_metadata import SourceUrlMetadata
|
|
236
246
|
from rapidata.api_client.models.source_url_metadata_model import SourceUrlMetadataModel
|
|
237
247
|
from rapidata.api_client.models.static_selection import StaticSelection
|
|
238
248
|
from rapidata.api_client.models.submit_coco_model import SubmitCocoModel
|
|
239
249
|
from rapidata.api_client.models.submit_coco_result import SubmitCocoResult
|
|
240
250
|
from rapidata.api_client.models.text_asset_model import TextAssetModel
|
|
251
|
+
from rapidata.api_client.models.text_metadata import TextMetadata
|
|
241
252
|
from rapidata.api_client.models.text_metadata_model import TextMetadataModel
|
|
253
|
+
from rapidata.api_client.models.transcription_metadata import TranscriptionMetadata
|
|
242
254
|
from rapidata.api_client.models.transcription_metadata_input import TranscriptionMetadataInput
|
|
243
255
|
from rapidata.api_client.models.transcription_metadata_model import TranscriptionMetadataModel
|
|
244
256
|
from rapidata.api_client.models.transcription_payload import TranscriptionPayload
|
|
@@ -251,6 +263,7 @@ from rapidata.api_client.models.translated_string import TranslatedString
|
|
|
251
263
|
from rapidata.api_client.models.unlock_order_result import UnlockOrderResult
|
|
252
264
|
from rapidata.api_client.models.update_access_model import UpdateAccessModel
|
|
253
265
|
from rapidata.api_client.models.update_campaign_model import UpdateCampaignModel
|
|
266
|
+
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
254
267
|
from rapidata.api_client.models.update_order_model import UpdateOrderModel
|
|
255
268
|
from rapidata.api_client.models.update_validation_rapid_model import UpdateValidationRapidModel
|
|
256
269
|
from rapidata.api_client.models.update_validation_rapid_model_truth import UpdateValidationRapidModelTruth
|
|
@@ -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
|
|
|
@@ -38,8 +38,8 @@ class CampaignQueryResult(BaseModel):
|
|
|
38
38
|
@field_validator('status')
|
|
39
39
|
def status_validate_enum(cls, value):
|
|
40
40
|
"""Validates the enum"""
|
|
41
|
-
if value not in set(['Created', 'Active', 'Paused', 'Completed']):
|
|
42
|
-
raise ValueError("must be one of enum values ('Created', 'Active', 'Paused', 'Completed')")
|
|
41
|
+
if value not in set(['Created', 'Active', 'Paused', 'Preview', 'Completed']):
|
|
42
|
+
raise ValueError("must be one of enum values ('Created', 'Active', 'Paused', 'Preview', 'Completed')")
|
|
43
43
|
return value
|
|
44
44
|
|
|
45
45
|
model_config = ConfigDict(
|
|
@@ -29,8 +29,7 @@ class ClassificationMetadata(BaseModel):
|
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ClassificationMetadata", alias="_t")
|
|
30
30
|
classification: StrictStr
|
|
31
31
|
visibilities: Optional[StrictStr] = None
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "classification", "visibilities", "identifier"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "classification", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,8 +91,7 @@ class ClassificationMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'ClassificationMetadata',
|
|
94
93
|
"classification": obj.get("classification"),
|
|
95
|
-
"visibilities": obj.get("visibilities")
|
|
96
|
-
"identifier": obj.get("identifier")
|
|
94
|
+
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
99
97
|
|
|
@@ -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, Optional
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_config_metadata_value import CompareWorkflowConfigMetadataValue
|
|
22
23
|
from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
|
|
23
24
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
24
25
|
from rapidata.api_client.models.elo_config import EloConfig
|
|
@@ -35,7 +36,8 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
35
36
|
pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
36
37
|
referee: CompareWorkflowModel1Referee
|
|
37
38
|
target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
|
|
38
|
-
|
|
39
|
+
metadata: Dict[str, CompareWorkflowConfigMetadataValue]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "eloConfig", "pairMakerConfig", "referee", "targetCountryCodes", "metadata"]
|
|
39
41
|
|
|
40
42
|
@field_validator('t')
|
|
41
43
|
def t_validate_enum(cls, value):
|
|
@@ -92,6 +94,13 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
92
94
|
# override the default output from pydantic by calling `to_dict()` of referee
|
|
93
95
|
if self.referee:
|
|
94
96
|
_dict['referee'] = self.referee.to_dict()
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
|
|
98
|
+
_field_dict = {}
|
|
99
|
+
if self.metadata:
|
|
100
|
+
for _key_metadata in self.metadata:
|
|
101
|
+
if self.metadata[_key_metadata]:
|
|
102
|
+
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
103
|
+
_dict['metadata'] = _field_dict
|
|
95
104
|
return _dict
|
|
96
105
|
|
|
97
106
|
@classmethod
|
|
@@ -109,7 +118,13 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
109
118
|
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
110
119
|
"pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
111
120
|
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
112
|
-
"targetCountryCodes": obj.get("targetCountryCodes")
|
|
121
|
+
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
122
|
+
"metadata": dict(
|
|
123
|
+
(_k, CompareWorkflowConfigMetadataValue.from_dict(_v))
|
|
124
|
+
for _k, _v in obj["metadata"].items()
|
|
125
|
+
)
|
|
126
|
+
if obj.get("metadata") is not None
|
|
127
|
+
else None
|
|
113
128
|
})
|
|
114
129
|
return _obj
|
|
115
130
|
|
|
@@ -0,0 +1,238 @@
|
|
|
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.classification_metadata import ClassificationMetadata
|
|
21
|
+
from rapidata.api_client.models.count_metadata import CountMetadata
|
|
22
|
+
from rapidata.api_client.models.image_dimension_metadata import ImageDimensionMetadata
|
|
23
|
+
from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
24
|
+
from rapidata.api_client.models.original_filename_metadata import OriginalFilenameMetadata
|
|
25
|
+
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
26
|
+
from rapidata.api_client.models.source_url_metadata import SourceUrlMetadata
|
|
27
|
+
from rapidata.api_client.models.text_metadata import TextMetadata
|
|
28
|
+
from rapidata.api_client.models.transcription_metadata import TranscriptionMetadata
|
|
29
|
+
from pydantic import StrictStr, Field
|
|
30
|
+
from typing import Union, List, Set, Optional, Dict
|
|
31
|
+
from typing_extensions import Literal, Self
|
|
32
|
+
|
|
33
|
+
COMPAREWORKFLOWCONFIGMETADATAVALUE_ONE_OF_SCHEMAS = ["ClassificationMetadata", "CountMetadata", "ImageDimensionMetadata", "LocationMetadata", "OriginalFilenameMetadata", "PromptMetadata", "SourceUrlMetadata", "TextMetadata", "TranscriptionMetadata"]
|
|
34
|
+
|
|
35
|
+
class CompareWorkflowConfigMetadataValue(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
CompareWorkflowConfigMetadataValue
|
|
38
|
+
"""
|
|
39
|
+
# data type: ClassificationMetadata
|
|
40
|
+
oneof_schema_1_validator: Optional[ClassificationMetadata] = None
|
|
41
|
+
# data type: CountMetadata
|
|
42
|
+
oneof_schema_2_validator: Optional[CountMetadata] = None
|
|
43
|
+
# data type: ImageDimensionMetadata
|
|
44
|
+
oneof_schema_3_validator: Optional[ImageDimensionMetadata] = None
|
|
45
|
+
# data type: LocationMetadata
|
|
46
|
+
oneof_schema_4_validator: Optional[LocationMetadata] = None
|
|
47
|
+
# data type: OriginalFilenameMetadata
|
|
48
|
+
oneof_schema_5_validator: Optional[OriginalFilenameMetadata] = None
|
|
49
|
+
# data type: PromptMetadata
|
|
50
|
+
oneof_schema_6_validator: Optional[PromptMetadata] = None
|
|
51
|
+
# data type: SourceUrlMetadata
|
|
52
|
+
oneof_schema_7_validator: Optional[SourceUrlMetadata] = None
|
|
53
|
+
# data type: TextMetadata
|
|
54
|
+
oneof_schema_8_validator: Optional[TextMetadata] = None
|
|
55
|
+
# data type: TranscriptionMetadata
|
|
56
|
+
oneof_schema_9_validator: Optional[TranscriptionMetadata] = None
|
|
57
|
+
actual_instance: Optional[Union[ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata]] = None
|
|
58
|
+
one_of_schemas: Set[str] = { "ClassificationMetadata", "CountMetadata", "ImageDimensionMetadata", "LocationMetadata", "OriginalFilenameMetadata", "PromptMetadata", "SourceUrlMetadata", "TextMetadata", "TranscriptionMetadata" }
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
validate_assignment=True,
|
|
62
|
+
protected_namespaces=(),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
70
|
+
if args:
|
|
71
|
+
if len(args) > 1:
|
|
72
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
73
|
+
if kwargs:
|
|
74
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
75
|
+
super().__init__(actual_instance=args[0])
|
|
76
|
+
else:
|
|
77
|
+
super().__init__(**kwargs)
|
|
78
|
+
|
|
79
|
+
@field_validator('actual_instance')
|
|
80
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
81
|
+
instance = CompareWorkflowConfigMetadataValue.model_construct()
|
|
82
|
+
error_messages = []
|
|
83
|
+
match = 0
|
|
84
|
+
# validate data type: ClassificationMetadata
|
|
85
|
+
if not isinstance(v, ClassificationMetadata):
|
|
86
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ClassificationMetadata`")
|
|
87
|
+
else:
|
|
88
|
+
match += 1
|
|
89
|
+
# validate data type: CountMetadata
|
|
90
|
+
if not isinstance(v, CountMetadata):
|
|
91
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CountMetadata`")
|
|
92
|
+
else:
|
|
93
|
+
match += 1
|
|
94
|
+
# validate data type: ImageDimensionMetadata
|
|
95
|
+
if not isinstance(v, ImageDimensionMetadata):
|
|
96
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ImageDimensionMetadata`")
|
|
97
|
+
else:
|
|
98
|
+
match += 1
|
|
99
|
+
# validate data type: LocationMetadata
|
|
100
|
+
if not isinstance(v, LocationMetadata):
|
|
101
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocationMetadata`")
|
|
102
|
+
else:
|
|
103
|
+
match += 1
|
|
104
|
+
# validate data type: OriginalFilenameMetadata
|
|
105
|
+
if not isinstance(v, OriginalFilenameMetadata):
|
|
106
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `OriginalFilenameMetadata`")
|
|
107
|
+
else:
|
|
108
|
+
match += 1
|
|
109
|
+
# validate data type: PromptMetadata
|
|
110
|
+
if not isinstance(v, PromptMetadata):
|
|
111
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PromptMetadata`")
|
|
112
|
+
else:
|
|
113
|
+
match += 1
|
|
114
|
+
# validate data type: SourceUrlMetadata
|
|
115
|
+
if not isinstance(v, SourceUrlMetadata):
|
|
116
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SourceUrlMetadata`")
|
|
117
|
+
else:
|
|
118
|
+
match += 1
|
|
119
|
+
# validate data type: TextMetadata
|
|
120
|
+
if not isinstance(v, TextMetadata):
|
|
121
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextMetadata`")
|
|
122
|
+
else:
|
|
123
|
+
match += 1
|
|
124
|
+
# validate data type: TranscriptionMetadata
|
|
125
|
+
if not isinstance(v, TranscriptionMetadata):
|
|
126
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionMetadata`")
|
|
127
|
+
else:
|
|
128
|
+
match += 1
|
|
129
|
+
if match > 1:
|
|
130
|
+
# more than 1 match
|
|
131
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowConfigMetadataValue with oneOf schemas: ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata. Details: " + ", ".join(error_messages))
|
|
132
|
+
elif match == 0:
|
|
133
|
+
# no match
|
|
134
|
+
raise ValueError("No match found when setting `actual_instance` in CompareWorkflowConfigMetadataValue with oneOf schemas: ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata. Details: " + ", ".join(error_messages))
|
|
135
|
+
else:
|
|
136
|
+
return v
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
140
|
+
return cls.from_json(json.dumps(obj))
|
|
141
|
+
|
|
142
|
+
@classmethod
|
|
143
|
+
def from_json(cls, json_str: str) -> Self:
|
|
144
|
+
"""Returns the object represented by the json string"""
|
|
145
|
+
instance = cls.model_construct()
|
|
146
|
+
error_messages = []
|
|
147
|
+
match = 0
|
|
148
|
+
|
|
149
|
+
# deserialize data into ClassificationMetadata
|
|
150
|
+
try:
|
|
151
|
+
instance.actual_instance = ClassificationMetadata.from_json(json_str)
|
|
152
|
+
match += 1
|
|
153
|
+
except (ValidationError, ValueError) as e:
|
|
154
|
+
error_messages.append(str(e))
|
|
155
|
+
# deserialize data into CountMetadata
|
|
156
|
+
try:
|
|
157
|
+
instance.actual_instance = CountMetadata.from_json(json_str)
|
|
158
|
+
match += 1
|
|
159
|
+
except (ValidationError, ValueError) as e:
|
|
160
|
+
error_messages.append(str(e))
|
|
161
|
+
# deserialize data into ImageDimensionMetadata
|
|
162
|
+
try:
|
|
163
|
+
instance.actual_instance = ImageDimensionMetadata.from_json(json_str)
|
|
164
|
+
match += 1
|
|
165
|
+
except (ValidationError, ValueError) as e:
|
|
166
|
+
error_messages.append(str(e))
|
|
167
|
+
# deserialize data into LocationMetadata
|
|
168
|
+
try:
|
|
169
|
+
instance.actual_instance = LocationMetadata.from_json(json_str)
|
|
170
|
+
match += 1
|
|
171
|
+
except (ValidationError, ValueError) as e:
|
|
172
|
+
error_messages.append(str(e))
|
|
173
|
+
# deserialize data into OriginalFilenameMetadata
|
|
174
|
+
try:
|
|
175
|
+
instance.actual_instance = OriginalFilenameMetadata.from_json(json_str)
|
|
176
|
+
match += 1
|
|
177
|
+
except (ValidationError, ValueError) as e:
|
|
178
|
+
error_messages.append(str(e))
|
|
179
|
+
# deserialize data into PromptMetadata
|
|
180
|
+
try:
|
|
181
|
+
instance.actual_instance = PromptMetadata.from_json(json_str)
|
|
182
|
+
match += 1
|
|
183
|
+
except (ValidationError, ValueError) as e:
|
|
184
|
+
error_messages.append(str(e))
|
|
185
|
+
# deserialize data into SourceUrlMetadata
|
|
186
|
+
try:
|
|
187
|
+
instance.actual_instance = SourceUrlMetadata.from_json(json_str)
|
|
188
|
+
match += 1
|
|
189
|
+
except (ValidationError, ValueError) as e:
|
|
190
|
+
error_messages.append(str(e))
|
|
191
|
+
# deserialize data into TextMetadata
|
|
192
|
+
try:
|
|
193
|
+
instance.actual_instance = TextMetadata.from_json(json_str)
|
|
194
|
+
match += 1
|
|
195
|
+
except (ValidationError, ValueError) as e:
|
|
196
|
+
error_messages.append(str(e))
|
|
197
|
+
# deserialize data into TranscriptionMetadata
|
|
198
|
+
try:
|
|
199
|
+
instance.actual_instance = TranscriptionMetadata.from_json(json_str)
|
|
200
|
+
match += 1
|
|
201
|
+
except (ValidationError, ValueError) as e:
|
|
202
|
+
error_messages.append(str(e))
|
|
203
|
+
|
|
204
|
+
if match > 1:
|
|
205
|
+
# more than 1 match
|
|
206
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowConfigMetadataValue with oneOf schemas: ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata. Details: " + ", ".join(error_messages))
|
|
207
|
+
elif match == 0:
|
|
208
|
+
# no match
|
|
209
|
+
raise ValueError("No match found when deserializing the JSON string into CompareWorkflowConfigMetadataValue with oneOf schemas: ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata. Details: " + ", ".join(error_messages))
|
|
210
|
+
else:
|
|
211
|
+
return instance
|
|
212
|
+
|
|
213
|
+
def to_json(self) -> str:
|
|
214
|
+
"""Returns the JSON representation of the actual instance"""
|
|
215
|
+
if self.actual_instance is None:
|
|
216
|
+
return "null"
|
|
217
|
+
|
|
218
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
219
|
+
return self.actual_instance.to_json()
|
|
220
|
+
else:
|
|
221
|
+
return json.dumps(self.actual_instance)
|
|
222
|
+
|
|
223
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ClassificationMetadata, CountMetadata, ImageDimensionMetadata, LocationMetadata, OriginalFilenameMetadata, PromptMetadata, SourceUrlMetadata, TextMetadata, TranscriptionMetadata]]:
|
|
224
|
+
"""Returns the dict representation of the actual instance"""
|
|
225
|
+
if self.actual_instance is None:
|
|
226
|
+
return None
|
|
227
|
+
|
|
228
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
229
|
+
return self.actual_instance.to_dict()
|
|
230
|
+
else:
|
|
231
|
+
# primitive type
|
|
232
|
+
return self.actual_instance
|
|
233
|
+
|
|
234
|
+
def to_str(self) -> str:
|
|
235
|
+
"""Returns the string representation of the actual instance"""
|
|
236
|
+
return pprint.pformat(self.model_dump())
|
|
237
|
+
|
|
238
|
+
|
|
@@ -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, Optional
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_config_metadata_value import CompareWorkflowConfigMetadataValue
|
|
22
23
|
from rapidata.api_client.models.compare_workflow_config_model_pair_maker_config import CompareWorkflowConfigModelPairMakerConfig
|
|
23
24
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
24
25
|
from rapidata.api_client.models.elo_config import EloConfig
|
|
@@ -35,7 +36,8 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
35
36
|
referee: CompareWorkflowModel1Referee
|
|
36
37
|
target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
|
|
37
38
|
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
38
|
-
|
|
39
|
+
metadata: Dict[str, CompareWorkflowConfigMetadataValue] = Field(description="The metadata is attached to every single rapid and can be used for something like the prompt.")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "referee", "targetCountryCodes", "eloConfig", "metadata"]
|
|
39
41
|
|
|
40
42
|
@field_validator('t')
|
|
41
43
|
def t_validate_enum(cls, value):
|
|
@@ -92,6 +94,13 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
92
94
|
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
93
95
|
if self.elo_config:
|
|
94
96
|
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
|
|
98
|
+
_field_dict = {}
|
|
99
|
+
if self.metadata:
|
|
100
|
+
for _key_metadata in self.metadata:
|
|
101
|
+
if self.metadata[_key_metadata]:
|
|
102
|
+
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
103
|
+
_dict['metadata'] = _field_dict
|
|
95
104
|
return _dict
|
|
96
105
|
|
|
97
106
|
@classmethod
|
|
@@ -109,7 +118,13 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
109
118
|
"pairMakerConfig": CompareWorkflowConfigModelPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
110
119
|
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
111
120
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
112
|
-
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None
|
|
121
|
+
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
122
|
+
"metadata": dict(
|
|
123
|
+
(_k, CompareWorkflowConfigMetadataValue.from_dict(_v))
|
|
124
|
+
for _k, _v in obj["metadata"].items()
|
|
125
|
+
)
|
|
126
|
+
if obj.get("metadata") is not None
|
|
127
|
+
else None
|
|
113
128
|
})
|
|
114
129
|
return _obj
|
|
115
130
|
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from rapidata.api_client.models.compare_workflow_model_pair_maker_config import CompareWorkflowModelPairMakerConfig
|
|
23
|
+
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
23
24
|
from rapidata.api_client.models.elo_config_model import EloConfigModel
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
@@ -32,7 +33,8 @@ class CompareWorkflowModel(BaseModel):
|
|
|
32
33
|
criteria: StrictStr = Field(description="The criteria that the datapoints should be compared based on. No default value.")
|
|
33
34
|
pair_maker_config: Optional[CompareWorkflowModelPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
34
35
|
elo_config: Optional[EloConfigModel] = Field(default=None, alias="eloConfig")
|
|
35
|
-
|
|
36
|
+
metadata: Optional[List[CreateDatapointFromUrlsModelMetadataInner]] = Field(default=None, description="The metadata is attached to every single rapid and can be used for something like the prompt.")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "eloConfig", "metadata"]
|
|
36
38
|
|
|
37
39
|
@field_validator('t')
|
|
38
40
|
def t_validate_enum(cls, value):
|
|
@@ -86,6 +88,18 @@ class CompareWorkflowModel(BaseModel):
|
|
|
86
88
|
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
87
89
|
if self.elo_config:
|
|
88
90
|
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.metadata:
|
|
94
|
+
for _item_metadata in self.metadata:
|
|
95
|
+
if _item_metadata:
|
|
96
|
+
_items.append(_item_metadata.to_dict())
|
|
97
|
+
_dict['metadata'] = _items
|
|
98
|
+
# set to None if metadata (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
101
|
+
_dict['metadata'] = None
|
|
102
|
+
|
|
89
103
|
return _dict
|
|
90
104
|
|
|
91
105
|
@classmethod
|
|
@@ -101,7 +115,8 @@ class CompareWorkflowModel(BaseModel):
|
|
|
101
115
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflow',
|
|
102
116
|
"criteria": obj.get("criteria"),
|
|
103
117
|
"pairMakerConfig": CompareWorkflowModelPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
104
|
-
"eloConfig": EloConfigModel.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None
|
|
118
|
+
"eloConfig": EloConfigModel.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
119
|
+
"metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None
|
|
105
120
|
})
|
|
106
121
|
return _obj
|
|
107
122
|
|
|
@@ -28,9 +28,8 @@ class CountMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for CountMetadata", alias="_t")
|
|
30
30
|
count: StrictInt
|
|
31
|
-
identifier: Optional[StrictStr] = None
|
|
32
31
|
visibilities: Optional[StrictStr] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "count", "
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "count", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class CountMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CountMetadata',
|
|
94
93
|
"count": obj.get("count"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -39,10 +39,12 @@ class CreateOrderModel(BaseModel):
|
|
|
39
39
|
feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags are used to enable or disable certain features.", alias="featureFlags")
|
|
40
40
|
priority: Optional[StrictInt] = Field(default=None, description="The priority is used to prioritize over other orders.")
|
|
41
41
|
is_sticky: Optional[StrictBool] = Field(default=None, description="Indicates if the underlying campaign should be sticky.", alias="isSticky")
|
|
42
|
+
user_score_dimensions: Optional[List[StrictStr]] = Field(default=None, description="The user score dimensions are used to determine the score of the responses from the user.", alias="userScoreDimensions")
|
|
43
|
+
demographic_keys: Optional[List[StrictStr]] = Field(default=None, description="The demographic keys are used to determine which demographics to store on the resposnes from the user.", alias="demographicKeys")
|
|
42
44
|
user_filters: List[CreateOrderModelUserFiltersInner] = Field(description="The user filters are used to restrict the order to only collect votes from a specific demographic.", alias="userFilters")
|
|
43
45
|
validation_set_id: Optional[StrictStr] = Field(default=None, description="The validation set id can be changed to point to a specific validation set. if not provided a sane default will be used.", alias="validationSetId")
|
|
44
46
|
selections: Optional[List[AbTestSelectionAInner]] = Field(default=None, description="The selections are used to determine which tasks are shown to a user.")
|
|
45
|
-
__properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "isSticky", "userFilters", "validationSetId", "selections"]
|
|
47
|
+
__properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "isSticky", "userScoreDimensions", "demographicKeys", "userFilters", "validationSetId", "selections"]
|
|
46
48
|
|
|
47
49
|
@field_validator('t')
|
|
48
50
|
def t_validate_enum(cls, value):
|
|
@@ -142,6 +144,16 @@ class CreateOrderModel(BaseModel):
|
|
|
142
144
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
143
145
|
_dict['priority'] = None
|
|
144
146
|
|
|
147
|
+
# set to None if user_score_dimensions (nullable) is None
|
|
148
|
+
# and model_fields_set contains the field
|
|
149
|
+
if self.user_score_dimensions is None and "user_score_dimensions" in self.model_fields_set:
|
|
150
|
+
_dict['userScoreDimensions'] = None
|
|
151
|
+
|
|
152
|
+
# set to None if demographic_keys (nullable) is None
|
|
153
|
+
# and model_fields_set contains the field
|
|
154
|
+
if self.demographic_keys is None and "demographic_keys" in self.model_fields_set:
|
|
155
|
+
_dict['demographicKeys'] = None
|
|
156
|
+
|
|
145
157
|
# set to None if validation_set_id (nullable) is None
|
|
146
158
|
# and model_fields_set contains the field
|
|
147
159
|
if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
|
|
@@ -172,6 +184,8 @@ class CreateOrderModel(BaseModel):
|
|
|
172
184
|
"featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
173
185
|
"priority": obj.get("priority"),
|
|
174
186
|
"isSticky": obj.get("isSticky"),
|
|
187
|
+
"userScoreDimensions": obj.get("userScoreDimensions"),
|
|
188
|
+
"demographicKeys": obj.get("demographicKeys"),
|
|
175
189
|
"userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
|
|
176
190
|
"validationSetId": obj.get("validationSetId"),
|
|
177
191
|
"selections": [AbTestSelectionAInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None
|
|
@@ -24,7 +24,7 @@ from typing_extensions import Self
|
|
|
24
24
|
|
|
25
25
|
class EarlyStoppingRefereeModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
The Early Stopping Referee can currently only be used for classification tasks and will stop once a certain
|
|
27
|
+
The Early Stopping Referee can currently only be used for classification tasks and will stop once a certain threshold is reached or the maximum number of votes is collected.
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for EarlyStoppingReferee", alias="_t")
|
|
30
30
|
max_votes: StrictInt = Field(description="The upper limit of votes that will be collected for each task.", alias="maxVotes")
|
|
@@ -27,7 +27,7 @@ class EvaluationWorkflowModel(BaseModel):
|
|
|
27
27
|
If the EvaluationWorkflow is chosen a validation set will be used as a source for all tasks. It functions similarly to the SimpleWorkflow as there is a 1:1 mapping between validation rapids and tasks.
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for EvaluationWorkflow", alias="_t")
|
|
30
|
-
validation_set_id: StrictStr = Field(description="The Validation Set
|
|
30
|
+
validation_set_id: StrictStr = Field(description="The Validation Set id is used to as a source for the tasks that will be sent to the user.", alias="validationSetId")
|
|
31
31
|
should_accept_incorrect: StrictBool = Field(description="Indicates if the user should get feedback on their answers if they answer wrong. If set to true the user will not notice that he was tested.", alias="shouldAcceptIncorrect")
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "validationSetId", "shouldAcceptIncorrect"]
|
|
33
33
|
|