rapidata 2.36.0__py3-none-any.whl → 2.36.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 +2 -2
- rapidata/api_client/__init__.py +3 -2
- rapidata/api_client/api/leaderboard_api.py +295 -6
- rapidata/api_client/api/validation_set_api.py +561 -313
- rapidata/api_client/models/__init__.py +3 -2
- rapidata/api_client/models/add_validation_rapid_model.py +29 -4
- rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
- rapidata/api_client/models/asset_metadata.py +9 -1
- rapidata/api_client/models/asset_type.py +40 -0
- rapidata/api_client/models/boost_query_result.py +5 -17
- rapidata/api_client/models/campaign_query_result.py +3 -9
- rapidata/api_client/models/classification_metadata.py +12 -1
- rapidata/api_client/models/compare_workflow_config.py +22 -12
- rapidata/api_client/models/compare_workflow_config_model.py +12 -2
- rapidata/api_client/models/compare_workflow_model.py +12 -2
- rapidata/api_client/models/count_metadata.py +12 -1
- rapidata/api_client/models/create_demographic_rapid_model.py +18 -3
- rapidata/api_client/models/create_order_model.py +6 -48
- rapidata/api_client/models/effort_capped_selection.py +2 -11
- rapidata/api_client/models/evaluation_workflow_config.py +13 -3
- rapidata/api_client/models/evaluation_workflow_model.py +13 -3
- rapidata/api_client/models/file_type_metadata.py +11 -6
- rapidata/api_client/models/file_type_metadata_model.py +2 -8
- rapidata/api_client/models/filter.py +5 -23
- rapidata/api_client/models/get_datapoint_by_id_result.py +3 -9
- rapidata/api_client/models/get_rapid_responses_result.py +3 -9
- rapidata/api_client/models/get_recommended_validation_set_result.py +95 -0
- rapidata/api_client/models/get_standing_by_id_result.py +3 -9
- rapidata/api_client/models/get_validation_rapids_result.py +3 -9
- rapidata/api_client/models/get_workflow_progress_result.py +3 -9
- rapidata/api_client/models/get_workflow_results_result.py +3 -9
- rapidata/api_client/models/image_dimension_metadata.py +12 -1
- rapidata/api_client/models/labeling_selection.py +2 -11
- rapidata/api_client/models/location_metadata.py +12 -1
- rapidata/api_client/models/order_model.py +3 -9
- rapidata/api_client/models/original_filename_metadata.py +12 -1
- rapidata/api_client/models/participant_by_benchmark.py +3 -9
- rapidata/api_client/models/prompt_metadata.py +12 -1
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/rapid_model.py +3 -9
- rapidata/api_client/models/report_model.py +3 -9
- rapidata/api_client/models/response_count_filter.py +2 -8
- rapidata/api_client/models/response_count_user_filter_model.py +2 -8
- rapidata/api_client/models/root_filter.py +3 -12
- rapidata/api_client/models/runs_by_leaderboard_result.py +3 -9
- rapidata/api_client/models/simple_workflow_config.py +13 -3
- rapidata/api_client/models/simple_workflow_config_model.py +11 -3
- rapidata/api_client/models/simple_workflow_model.py +13 -3
- rapidata/api_client/models/sort_criterion.py +3 -9
- rapidata/api_client/models/source_url_metadata.py +12 -1
- rapidata/api_client/models/standing_by_leaderboard.py +3 -9
- rapidata/api_client/models/streams_metadata.py +12 -1
- rapidata/api_client/models/text_metadata.py +12 -1
- rapidata/api_client/models/transcription_metadata.py +9 -1
- rapidata/api_client/models/update_leaderboard_model.py +91 -0
- rapidata/api_client/models/update_should_alert_model.py +1 -1
- rapidata/api_client/models/validation_set_model.py +42 -3
- rapidata/api_client/models/video_duration_metadata.py +12 -1
- rapidata/api_client/models/workflow_aggregation_step_model.py +3 -12
- rapidata/api_client_README.md +8 -5
- rapidata/rapidata_client/__init__.py +1 -1
- rapidata/rapidata_client/benchmark/participant/_participant.py +5 -5
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +2 -1
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +10 -2
- rapidata/rapidata_client/config/__init__.py +1 -1
- rapidata/rapidata_client/config/rapidata_config.py +31 -0
- rapidata/rapidata_client/datapoints/__init__.py +10 -2
- rapidata/rapidata_client/datapoints/{datapoint.py → _datapoint.py} +105 -17
- rapidata/rapidata_client/datapoints/assets/_media_asset.py +80 -68
- rapidata/rapidata_client/datapoints/assets/_sessions.py +3 -3
- rapidata/rapidata_client/datapoints/assets/constants.py +7 -0
- rapidata/rapidata_client/exceptions/failed_upload_exception.py +42 -13
- rapidata/rapidata_client/filter/response_count_filter.py +16 -11
- rapidata/rapidata_client/order/_rapidata_dataset.py +8 -8
- rapidata/rapidata_client/order/_rapidata_order_builder.py +87 -8
- rapidata/rapidata_client/order/rapidata_order_manager.py +18 -4
- rapidata/rapidata_client/rapidata_client.py +6 -0
- rapidata/rapidata_client/selection/__init__.py +1 -1
- rapidata/rapidata_client/selection/effort_selection.py +18 -7
- rapidata/rapidata_client/selection/labeling_selection.py +19 -7
- rapidata/rapidata_client/selection/{retrieval_modes.py → rapidata_retrieval_modes.py} +7 -4
- rapidata/rapidata_client/validation/rapidata_validation_set.py +26 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +46 -19
- rapidata/rapidata_client/validation/validation_set_manager.py +41 -4
- rapidata/rapidata_client/workflow/_base_workflow.py +27 -0
- rapidata/rapidata_client/workflow/_classify_workflow.py +25 -9
- rapidata/rapidata_client/workflow/_compare_workflow.py +11 -0
- rapidata/rapidata_client/workflow/_draw_workflow.py +15 -7
- rapidata/rapidata_client/workflow/_evaluation_workflow.py +8 -1
- rapidata/rapidata_client/workflow/_free_text_workflow.py +20 -2
- rapidata/rapidata_client/workflow/_locate_workflow.py +15 -7
- rapidata/rapidata_client/workflow/_ranking_workflow.py +39 -15
- rapidata/rapidata_client/workflow/_select_words_workflow.py +41 -7
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +17 -8
- rapidata/service/openapi_service.py +1 -1
- {rapidata-2.36.0.dist-info → rapidata-2.36.2.dist-info}/METADATA +1 -1
- {rapidata-2.36.0.dist-info → rapidata-2.36.2.dist-info}/RECORD +100 -94
- rapidata/rapidata_client/config/config.py +0 -33
- {rapidata-2.36.0.dist-info → rapidata-2.36.2.dist-info}/LICENSE +0 -0
- {rapidata-2.36.0.dist-info → rapidata-2.36.2.dist-info}/WHEEL +0 -0
|
@@ -21,7 +21,6 @@ from rapidata.api_client.models.add_validation_rapid_model import AddValidationR
|
|
|
21
21
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_result import AddValidationRapidResult
|
|
24
|
-
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
25
24
|
from rapidata.api_client.models.age_group import AgeGroup
|
|
26
25
|
from rapidata.api_client.models.age_user_filter_model import AgeUserFilterModel
|
|
27
26
|
from rapidata.api_client.models.aggregator_type import AggregatorType
|
|
@@ -183,6 +182,7 @@ from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import
|
|
|
183
182
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
184
183
|
from rapidata.api_client.models.get_public_responses_result import GetPublicResponsesResult
|
|
185
184
|
from rapidata.api_client.models.get_rapid_responses_result import GetRapidResponsesResult
|
|
185
|
+
from rapidata.api_client.models.get_recommended_validation_set_result import GetRecommendedValidationSetResult
|
|
186
186
|
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
187
187
|
from rapidata.api_client.models.get_sample_by_id_result import GetSampleByIdResult
|
|
188
188
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
@@ -228,7 +228,6 @@ from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
|
228
228
|
from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
|
|
229
229
|
from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
|
|
230
230
|
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
231
|
-
from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
|
|
232
231
|
from rapidata.api_client.models.multi_asset import MultiAsset
|
|
233
232
|
from rapidata.api_client.models.multi_asset_input import MultiAssetInput
|
|
234
233
|
from rapidata.api_client.models.multi_asset_input1 import MultiAssetInput1
|
|
@@ -285,6 +284,7 @@ from rapidata.api_client.models.preview_order_model import PreviewOrderModel
|
|
|
285
284
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
286
285
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
287
286
|
from rapidata.api_client.models.probabilistic_attach_category_referee_info import ProbabilisticAttachCategoryRefereeInfo
|
|
287
|
+
from rapidata.api_client.models.problem_details import ProblemDetails
|
|
288
288
|
from rapidata.api_client.models.prompt_asset_metadata_input import PromptAssetMetadataInput
|
|
289
289
|
from rapidata.api_client.models.prompt_asset_metadata_input_asset import PromptAssetMetadataInputAsset
|
|
290
290
|
from rapidata.api_client.models.prompt_by_benchmark_result import PromptByBenchmarkResult
|
|
@@ -378,6 +378,7 @@ from rapidata.api_client.models.unlock_order_result import UnlockOrderResult
|
|
|
378
378
|
from rapidata.api_client.models.update_benchmark_name_model import UpdateBenchmarkNameModel
|
|
379
379
|
from rapidata.api_client.models.update_dataset_name_model import UpdateDatasetNameModel
|
|
380
380
|
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
381
|
+
from rapidata.api_client.models.update_leaderboard_model import UpdateLeaderboardModel
|
|
381
382
|
from rapidata.api_client.models.update_leaderboard_name_model import UpdateLeaderboardNameModel
|
|
382
383
|
from rapidata.api_client.models.update_leaderboard_response_config_model import UpdateLeaderboardResponseConfigModel
|
|
383
384
|
from rapidata.api_client.models.update_order_name_model import UpdateOrderNameModel
|
|
@@ -22,6 +22,7 @@ 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
24
|
from rapidata.api_client.models.dataset_dataset_id_datapoints_post_request_metadata_inner import DatasetDatasetIdDatapointsPostRequestMetadataInner
|
|
25
|
+
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -30,11 +31,12 @@ class AddValidationRapidModel(BaseModel):
|
|
|
30
31
|
The model for adding a validation rapid.
|
|
31
32
|
""" # noqa: E501
|
|
32
33
|
payload: AddValidationRapidModelPayload
|
|
33
|
-
metadata: List[DatasetDatasetIdDatapointsPostRequestMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
34
|
-
truth: AddValidationRapidModelTruth
|
|
34
|
+
metadata: Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]] = Field(default=None, description="Some metadata to attach to the rapid.")
|
|
35
|
+
truth: Optional[AddValidationRapidModelTruth] = None
|
|
35
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")
|
|
36
37
|
explanation: Optional[StrictStr] = Field(default=None, description="An explanation for the users if they answer the rapid incorrectly.")
|
|
37
|
-
|
|
38
|
+
feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags to enable for the rapid.", alias="featureFlags")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["payload", "metadata", "truth", "randomCorrectProbability", "explanation", "featureFlags"]
|
|
38
40
|
|
|
39
41
|
model_config = ConfigDict(
|
|
40
42
|
populate_by_name=True,
|
|
@@ -88,6 +90,23 @@ class AddValidationRapidModel(BaseModel):
|
|
|
88
90
|
# override the default output from pydantic by calling `to_dict()` of truth
|
|
89
91
|
if self.truth:
|
|
90
92
|
_dict['truth'] = self.truth.to_dict()
|
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
94
|
+
_items = []
|
|
95
|
+
if self.feature_flags:
|
|
96
|
+
for _item_feature_flags in self.feature_flags:
|
|
97
|
+
if _item_feature_flags:
|
|
98
|
+
_items.append(_item_feature_flags.to_dict())
|
|
99
|
+
_dict['featureFlags'] = _items
|
|
100
|
+
# set to None if metadata (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
103
|
+
_dict['metadata'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if truth (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.truth is None and "truth" in self.model_fields_set:
|
|
108
|
+
_dict['truth'] = None
|
|
109
|
+
|
|
91
110
|
# set to None if random_correct_probability (nullable) is None
|
|
92
111
|
# and model_fields_set contains the field
|
|
93
112
|
if self.random_correct_probability is None and "random_correct_probability" in self.model_fields_set:
|
|
@@ -98,6 +117,11 @@ class AddValidationRapidModel(BaseModel):
|
|
|
98
117
|
if self.explanation is None and "explanation" in self.model_fields_set:
|
|
99
118
|
_dict['explanation'] = None
|
|
100
119
|
|
|
120
|
+
# set to None if feature_flags (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.feature_flags is None and "feature_flags" in self.model_fields_set:
|
|
123
|
+
_dict['featureFlags'] = None
|
|
124
|
+
|
|
101
125
|
return _dict
|
|
102
126
|
|
|
103
127
|
@classmethod
|
|
@@ -114,7 +138,8 @@ class AddValidationRapidModel(BaseModel):
|
|
|
114
138
|
"metadata": [DatasetDatasetIdDatapointsPostRequestMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
115
139
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
116
140
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
117
|
-
"explanation": obj.get("explanation")
|
|
141
|
+
"explanation": obj.get("explanation"),
|
|
142
|
+
"featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
118
143
|
})
|
|
119
144
|
return _obj
|
|
120
145
|
|
|
@@ -87,6 +87,9 @@ class AddValidationRapidModelTruth(BaseModel):
|
|
|
87
87
|
|
|
88
88
|
@field_validator('actual_instance')
|
|
89
89
|
def actual_instance_must_validate_oneof(cls, v):
|
|
90
|
+
if v is None:
|
|
91
|
+
return v
|
|
92
|
+
|
|
90
93
|
instance = AddValidationRapidModelTruth.model_construct()
|
|
91
94
|
error_messages = []
|
|
92
95
|
match = 0
|
|
@@ -164,9 +167,12 @@ class AddValidationRapidModelTruth(BaseModel):
|
|
|
164
167
|
return cls.from_json(json.dumps(obj))
|
|
165
168
|
|
|
166
169
|
@classmethod
|
|
167
|
-
def from_json(cls, json_str: str) -> Self:
|
|
170
|
+
def from_json(cls, json_str: Optional[str]) -> Self:
|
|
168
171
|
"""Returns the object represented by the json string"""
|
|
169
172
|
instance = cls.model_construct()
|
|
173
|
+
if json_str is None:
|
|
174
|
+
return instance
|
|
175
|
+
|
|
170
176
|
error_messages = []
|
|
171
177
|
match = 0
|
|
172
178
|
|
|
@@ -28,7 +28,7 @@ class AssetMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for AssetMetadata", alias="_t")
|
|
30
30
|
asset: AssetMetadataAsset
|
|
31
|
-
visibilities: StrictStr
|
|
31
|
+
visibilities: List[StrictStr]
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "asset", "visibilities"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -38,6 +38,14 @@ class AssetMetadata(BaseModel):
|
|
|
38
38
|
raise ValueError("must be one of enum values ('AssetMetadata')")
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
+
@field_validator('visibilities')
|
|
42
|
+
def visibilities_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
for i in value:
|
|
45
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
46
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
41
49
|
model_config = ConfigDict(
|
|
42
50
|
populate_by_name=True,
|
|
43
51
|
validate_assignment=True,
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AssetType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
AssetType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
NONE = 'None'
|
|
30
|
+
IMAGE = 'Image'
|
|
31
|
+
VIDEO = 'Video'
|
|
32
|
+
AUDIO = 'Audio'
|
|
33
|
+
TEXT = 'Text'
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
|
37
|
+
"""Create an instance of AssetType from a JSON string"""
|
|
38
|
+
return cls(json.loads(json_str))
|
|
39
|
+
|
|
40
|
+
|
|
@@ -17,8 +17,10 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.boost_mode import BoostMode
|
|
23
|
+
from rapidata.api_client.models.boost_status import BoostStatus
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -26,27 +28,13 @@ class BoostQueryResult(BaseModel):
|
|
|
26
28
|
"""
|
|
27
29
|
BoostQueryResult
|
|
28
30
|
""" # noqa: E501
|
|
29
|
-
status:
|
|
30
|
-
mode:
|
|
31
|
+
status: BoostStatus
|
|
32
|
+
mode: BoostMode
|
|
31
33
|
active_campaigns: List[StrictStr] = Field(alias="activeCampaigns")
|
|
32
34
|
inactive_campaigns: List[StrictStr] = Field(alias="inactiveCampaigns")
|
|
33
35
|
unknown_campaigns: List[StrictInt] = Field(alias="unknownCampaigns")
|
|
34
36
|
__properties: ClassVar[List[str]] = ["status", "mode", "activeCampaigns", "inactiveCampaigns", "unknownCampaigns"]
|
|
35
37
|
|
|
36
|
-
@field_validator('status')
|
|
37
|
-
def status_validate_enum(cls, value):
|
|
38
|
-
"""Validates the enum"""
|
|
39
|
-
if value not in set(['Active', 'Inactive', 'Partial', 'Unknown']):
|
|
40
|
-
raise ValueError("must be one of enum values ('Active', 'Inactive', 'Partial', 'Unknown')")
|
|
41
|
-
return value
|
|
42
|
-
|
|
43
|
-
@field_validator('mode')
|
|
44
|
-
def mode_validate_enum(cls, value):
|
|
45
|
-
"""Validates the enum"""
|
|
46
|
-
if value not in set(['Automatic', 'Manual']):
|
|
47
|
-
raise ValueError("must be one of enum values ('Automatic', 'Manual')")
|
|
48
|
-
return value
|
|
49
|
-
|
|
50
38
|
model_config = ConfigDict(
|
|
51
39
|
populate_by_name=True,
|
|
52
40
|
validate_assignment=True,
|
|
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from rapidata.api_client.models.campaign_status import CampaignStatus
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -30,18 +31,11 @@ class CampaignQueryResult(BaseModel):
|
|
|
30
31
|
id: StrictStr
|
|
31
32
|
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
32
33
|
name: StrictStr
|
|
33
|
-
status:
|
|
34
|
+
status: CampaignStatus
|
|
34
35
|
priority: StrictInt
|
|
35
36
|
created_at: datetime = Field(alias="createdAt")
|
|
36
37
|
__properties: ClassVar[List[str]] = ["id", "ownerMail", "name", "status", "priority", "createdAt"]
|
|
37
38
|
|
|
38
|
-
@field_validator('status')
|
|
39
|
-
def status_validate_enum(cls, value):
|
|
40
|
-
"""Validates the enum"""
|
|
41
|
-
if value not in set(['Created', 'Preview', 'Active', 'Analysis', 'Paused', 'Completed']):
|
|
42
|
-
raise ValueError("must be one of enum values ('Created', 'Preview', 'Active', 'Analysis', 'Paused', 'Completed')")
|
|
43
|
-
return value
|
|
44
|
-
|
|
45
39
|
model_config = ConfigDict(
|
|
46
40
|
populate_by_name=True,
|
|
47
41
|
validate_assignment=True,
|
|
@@ -28,7 +28,7 @@ class ClassificationMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ClassificationMetadata", alias="_t")
|
|
30
30
|
classification: StrictStr
|
|
31
|
-
visibilities: Optional[StrictStr] = None
|
|
31
|
+
visibilities: Optional[List[StrictStr]] = None
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "classification", "visibilities"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -38,6 +38,17 @@ class ClassificationMetadata(BaseModel):
|
|
|
38
38
|
raise ValueError("must be one of enum values ('ClassificationMetadata')")
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
+
@field_validator('visibilities')
|
|
42
|
+
def visibilities_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value is None:
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
for i in value:
|
|
48
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
49
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
50
|
+
return value
|
|
51
|
+
|
|
41
52
|
model_config = ConfigDict(
|
|
42
53
|
populate_by_name=True,
|
|
43
54
|
validate_assignment=True,
|
|
@@ -23,6 +23,7 @@ from rapidata.api_client.models.compare_workflow_config_metadata_value import Co
|
|
|
23
23
|
from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
|
|
24
24
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
25
25
|
from rapidata.api_client.models.elo_config import EloConfig
|
|
26
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -32,12 +33,13 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
32
33
|
""" # noqa: E501
|
|
33
34
|
t: StrictStr = Field(description="Discriminator value for CompareWorkflowConfig", alias="_t")
|
|
34
35
|
criteria: StrictStr
|
|
35
|
-
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
36
|
-
pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
37
36
|
referee: CompareWorkflowModel1Referee
|
|
38
37
|
target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
|
|
39
38
|
metadata: Dict[str, CompareWorkflowConfigMetadataValue]
|
|
40
|
-
|
|
39
|
+
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
40
|
+
pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
41
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "referee", "targetCountryCodes", "metadata", "eloConfig", "pairMakerConfig", "featureFlags"]
|
|
41
43
|
|
|
42
44
|
@field_validator('t')
|
|
43
45
|
def t_validate_enum(cls, value):
|
|
@@ -85,12 +87,6 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
85
87
|
exclude=excluded_fields,
|
|
86
88
|
exclude_none=True,
|
|
87
89
|
)
|
|
88
|
-
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
89
|
-
if self.elo_config:
|
|
90
|
-
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
91
|
-
# override the default output from pydantic by calling `to_dict()` of pair_maker_config
|
|
92
|
-
if self.pair_maker_config:
|
|
93
|
-
_dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
|
|
94
90
|
# override the default output from pydantic by calling `to_dict()` of referee
|
|
95
91
|
if self.referee:
|
|
96
92
|
_dict['referee'] = self.referee.to_dict()
|
|
@@ -101,6 +97,19 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
101
97
|
if self.metadata[_key_metadata]:
|
|
102
98
|
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
103
99
|
_dict['metadata'] = _field_dict
|
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
101
|
+
if self.elo_config:
|
|
102
|
+
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of pair_maker_config
|
|
104
|
+
if self.pair_maker_config:
|
|
105
|
+
_dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
107
|
+
_items = []
|
|
108
|
+
if self.feature_flags:
|
|
109
|
+
for _item_feature_flags in self.feature_flags:
|
|
110
|
+
if _item_feature_flags:
|
|
111
|
+
_items.append(_item_feature_flags.to_dict())
|
|
112
|
+
_dict['featureFlags'] = _items
|
|
104
113
|
return _dict
|
|
105
114
|
|
|
106
115
|
@classmethod
|
|
@@ -115,8 +124,6 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
115
124
|
_obj = cls.model_validate({
|
|
116
125
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowConfig',
|
|
117
126
|
"criteria": obj.get("criteria"),
|
|
118
|
-
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
119
|
-
"pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
120
127
|
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
121
128
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
122
129
|
"metadata": dict(
|
|
@@ -124,7 +131,10 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
124
131
|
for _k, _v in obj["metadata"].items()
|
|
125
132
|
)
|
|
126
133
|
if obj.get("metadata") is not None
|
|
127
|
-
else None
|
|
134
|
+
else None,
|
|
135
|
+
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
136
|
+
"pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
137
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
128
138
|
})
|
|
129
139
|
return _obj
|
|
130
140
|
|
|
@@ -23,6 +23,7 @@ from rapidata.api_client.models.compare_workflow_config_metadata_value import Co
|
|
|
23
23
|
from rapidata.api_client.models.compare_workflow_config_model_pair_maker_config import CompareWorkflowConfigModelPairMakerConfig
|
|
24
24
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
25
25
|
from rapidata.api_client.models.elo_config import EloConfig
|
|
26
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -37,7 +38,8 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
37
38
|
target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
|
|
38
39
|
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
39
40
|
metadata: Dict[str, CompareWorkflowConfigMetadataValue] = Field(description="The metadata is attached to every single rapid and can be used for something like the prompt.")
|
|
40
|
-
|
|
41
|
+
feature_flags: List[FeatureFlag] = Field(description="The list of feature flags that will be applied to the rapids created by this workflow.", alias="featureFlags")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "referee", "targetCountryCodes", "eloConfig", "metadata", "featureFlags"]
|
|
41
43
|
|
|
42
44
|
@field_validator('t')
|
|
43
45
|
def t_validate_enum(cls, value):
|
|
@@ -101,6 +103,13 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
101
103
|
if self.metadata[_key_metadata]:
|
|
102
104
|
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
103
105
|
_dict['metadata'] = _field_dict
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
107
|
+
_items = []
|
|
108
|
+
if self.feature_flags:
|
|
109
|
+
for _item_feature_flags in self.feature_flags:
|
|
110
|
+
if _item_feature_flags:
|
|
111
|
+
_items.append(_item_feature_flags.to_dict())
|
|
112
|
+
_dict['featureFlags'] = _items
|
|
104
113
|
return _dict
|
|
105
114
|
|
|
106
115
|
@classmethod
|
|
@@ -124,7 +133,8 @@ class CompareWorkflowConfigModel(BaseModel):
|
|
|
124
133
|
for _k, _v in obj["metadata"].items()
|
|
125
134
|
)
|
|
126
135
|
if obj.get("metadata") is not None
|
|
127
|
-
else None
|
|
136
|
+
else None,
|
|
137
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
128
138
|
})
|
|
129
139
|
return _obj
|
|
130
140
|
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from rapidata.api_client.models.compare_workflow_model_pair_maker_config import CompareWorkflowModelPairMakerConfig
|
|
23
23
|
from rapidata.api_client.models.dataset_dataset_id_datapoints_post_request_metadata_inner import DatasetDatasetIdDatapointsPostRequestMetadataInner
|
|
24
24
|
from rapidata.api_client.models.elo_config_model import EloConfigModel
|
|
25
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -34,7 +35,8 @@ class CompareWorkflowModel(BaseModel):
|
|
|
34
35
|
pair_maker_config: Optional[CompareWorkflowModelPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
35
36
|
elo_config: Optional[EloConfigModel] = Field(default=None, alias="eloConfig")
|
|
36
37
|
metadata: Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]] = Field(default=None, description="The metadata is attached to every single rapid and can be used for something like the prompt.")
|
|
37
|
-
|
|
38
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, description="The list of feature flags that will be applied to the rapids created by this workflow.", alias="featureFlags")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "eloConfig", "metadata", "featureFlags"]
|
|
38
40
|
|
|
39
41
|
@field_validator('t')
|
|
40
42
|
def t_validate_enum(cls, value):
|
|
@@ -95,6 +97,13 @@ class CompareWorkflowModel(BaseModel):
|
|
|
95
97
|
if _item_metadata:
|
|
96
98
|
_items.append(_item_metadata.to_dict())
|
|
97
99
|
_dict['metadata'] = _items
|
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
101
|
+
_items = []
|
|
102
|
+
if self.feature_flags:
|
|
103
|
+
for _item_feature_flags in self.feature_flags:
|
|
104
|
+
if _item_feature_flags:
|
|
105
|
+
_items.append(_item_feature_flags.to_dict())
|
|
106
|
+
_dict['featureFlags'] = _items
|
|
98
107
|
# set to None if metadata (nullable) is None
|
|
99
108
|
# and model_fields_set contains the field
|
|
100
109
|
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
@@ -116,7 +125,8 @@ class CompareWorkflowModel(BaseModel):
|
|
|
116
125
|
"criteria": obj.get("criteria"),
|
|
117
126
|
"pairMakerConfig": CompareWorkflowModelPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
118
127
|
"eloConfig": EloConfigModel.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
119
|
-
"metadata": [DatasetDatasetIdDatapointsPostRequestMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None
|
|
128
|
+
"metadata": [DatasetDatasetIdDatapointsPostRequestMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
129
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
120
130
|
})
|
|
121
131
|
return _obj
|
|
122
132
|
|
|
@@ -28,7 +28,7 @@ class CountMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for CountMetadata", alias="_t")
|
|
30
30
|
count: StrictInt
|
|
31
|
-
visibilities: Optional[StrictStr] = None
|
|
31
|
+
visibilities: Optional[List[StrictStr]] = None
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "count", "visibilities"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -38,6 +38,17 @@ class CountMetadata(BaseModel):
|
|
|
38
38
|
raise ValueError("must be one of enum values ('CountMetadata')")
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
+
@field_validator('visibilities')
|
|
42
|
+
def visibilities_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value is None:
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
for i in value:
|
|
48
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
49
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
50
|
+
return value
|
|
51
|
+
|
|
41
52
|
model_config = ConfigDict(
|
|
42
53
|
populate_by_name=True,
|
|
43
54
|
validate_assignment=True,
|
|
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
23
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -29,7 +30,8 @@ class CreateDemographicRapidModel(BaseModel):
|
|
|
29
30
|
""" # noqa: E501
|
|
30
31
|
key: StrictStr = Field(description="The identifier of the demographic classification.")
|
|
31
32
|
payload: ClassifyPayload
|
|
32
|
-
|
|
33
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, description="Optional feature flags to apply to the rapid.", alias="featureFlags")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["key", "payload", "featureFlags"]
|
|
33
35
|
|
|
34
36
|
model_config = ConfigDict(
|
|
35
37
|
populate_by_name=True,
|
|
@@ -73,6 +75,18 @@ class CreateDemographicRapidModel(BaseModel):
|
|
|
73
75
|
# override the default output from pydantic by calling `to_dict()` of payload
|
|
74
76
|
if self.payload:
|
|
75
77
|
_dict['payload'] = self.payload.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.feature_flags:
|
|
81
|
+
for _item_feature_flags in self.feature_flags:
|
|
82
|
+
if _item_feature_flags:
|
|
83
|
+
_items.append(_item_feature_flags.to_dict())
|
|
84
|
+
_dict['featureFlags'] = _items
|
|
85
|
+
# set to None if feature_flags (nullable) is None
|
|
86
|
+
# and model_fields_set contains the field
|
|
87
|
+
if self.feature_flags is None and "feature_flags" in self.model_fields_set:
|
|
88
|
+
_dict['featureFlags'] = None
|
|
89
|
+
|
|
76
90
|
return _dict
|
|
77
91
|
|
|
78
92
|
@classmethod
|
|
@@ -86,7 +100,8 @@ class CreateDemographicRapidModel(BaseModel):
|
|
|
86
100
|
|
|
87
101
|
_obj = cls.model_validate({
|
|
88
102
|
"key": obj.get("key"),
|
|
89
|
-
"payload": ClassifyPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None
|
|
103
|
+
"payload": ClassifyPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
104
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
90
105
|
})
|
|
91
106
|
return _obj
|
|
92
107
|
|