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
|
@@ -20,10 +20,13 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from rapidata.api_client.models.ab_test_selection_a_inner import AbTestSelectionAInner
|
|
23
|
+
from rapidata.api_client.models.aggregator_type import AggregatorType
|
|
23
24
|
from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
|
|
24
25
|
from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
|
|
25
26
|
from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
|
|
26
27
|
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
28
|
+
from rapidata.api_client.models.retrieval_mode import RetrievalMode
|
|
29
|
+
from rapidata.api_client.models.sticky_state import StickyState
|
|
27
30
|
from typing import Optional, Set
|
|
28
31
|
from typing_extensions import Self
|
|
29
32
|
|
|
@@ -35,16 +38,16 @@ class CreateOrderModel(BaseModel):
|
|
|
35
38
|
order_name: StrictStr = Field(description="The name is used as an identifier for an order and can be freely chosen.", alias="orderName")
|
|
36
39
|
workflow: CreateOrderModelWorkflow
|
|
37
40
|
referee: CreateOrderModelReferee
|
|
38
|
-
aggregator: Optional[
|
|
41
|
+
aggregator: Optional[AggregatorType] = None
|
|
39
42
|
feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags are used to enable or disable certain features.", alias="featureFlags")
|
|
40
43
|
priority: Optional[StrictInt] = Field(default=None, description="The priority is used to prioritize over other orders.")
|
|
41
|
-
sticky_state: Optional[
|
|
44
|
+
sticky_state: Optional[StickyState] = Field(default=None, alias="stickyState")
|
|
42
45
|
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
46
|
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")
|
|
44
47
|
user_filters: Optional[List[AndUserFilterModelFiltersInner]] = Field(default=None, description="The user filters are used to restrict the order to only collect votes from a specific demographic.", alias="userFilters")
|
|
45
48
|
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")
|
|
46
49
|
selections: Optional[List[AbTestSelectionAInner]] = Field(default=None, description="The selections are used to determine which tasks are shown to a user.")
|
|
47
|
-
retrieval_mode: Optional[
|
|
50
|
+
retrieval_mode: Optional[RetrievalMode] = Field(default=None, alias="retrievalMode")
|
|
48
51
|
max_iterations: Optional[StrictInt] = Field(default=None, description="The maximum number of times a user is allowed to see the same rapid.", alias="maxIterations")
|
|
49
52
|
__properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "stickyState", "userScoreDimensions", "demographicKeys", "userFilters", "validationSetId", "selections", "retrievalMode", "maxIterations"]
|
|
50
53
|
|
|
@@ -55,36 +58,6 @@ class CreateOrderModel(BaseModel):
|
|
|
55
58
|
raise ValueError("must be one of enum values ('CreateOrderModel')")
|
|
56
59
|
return value
|
|
57
60
|
|
|
58
|
-
@field_validator('aggregator')
|
|
59
|
-
def aggregator_validate_enum(cls, value):
|
|
60
|
-
"""Validates the enum"""
|
|
61
|
-
if value is None:
|
|
62
|
-
return value
|
|
63
|
-
|
|
64
|
-
if value not in set(['NonCommittal', 'MajorityVote', 'SimpleMatchup', 'LocateCluster', 'Classification', 'Locate', 'BoundingBox', 'Line', 'Transcription', 'SinglePointLocate', 'FreeText', 'Scrub']):
|
|
65
|
-
raise ValueError("must be one of enum values ('NonCommittal', 'MajorityVote', 'SimpleMatchup', 'LocateCluster', 'Classification', 'Locate', 'BoundingBox', 'Line', 'Transcription', 'SinglePointLocate', 'FreeText', 'Scrub')")
|
|
66
|
-
return value
|
|
67
|
-
|
|
68
|
-
@field_validator('sticky_state')
|
|
69
|
-
def sticky_state_validate_enum(cls, value):
|
|
70
|
-
"""Validates the enum"""
|
|
71
|
-
if value is None:
|
|
72
|
-
return value
|
|
73
|
-
|
|
74
|
-
if value not in set(['None', 'Temporary', 'Permanent']):
|
|
75
|
-
raise ValueError("must be one of enum values ('None', 'Temporary', 'Permanent')")
|
|
76
|
-
return value
|
|
77
|
-
|
|
78
|
-
@field_validator('retrieval_mode')
|
|
79
|
-
def retrieval_mode_validate_enum(cls, value):
|
|
80
|
-
"""Validates the enum"""
|
|
81
|
-
if value is None:
|
|
82
|
-
return value
|
|
83
|
-
|
|
84
|
-
if value not in set(['Random', 'Shuffled', 'Sequential']):
|
|
85
|
-
raise ValueError("must be one of enum values ('Random', 'Shuffled', 'Sequential')")
|
|
86
|
-
return value
|
|
87
|
-
|
|
88
61
|
model_config = ConfigDict(
|
|
89
62
|
populate_by_name=True,
|
|
90
63
|
validate_assignment=True,
|
|
@@ -151,11 +124,6 @@ class CreateOrderModel(BaseModel):
|
|
|
151
124
|
if _item_selections:
|
|
152
125
|
_items.append(_item_selections.to_dict())
|
|
153
126
|
_dict['selections'] = _items
|
|
154
|
-
# set to None if aggregator (nullable) is None
|
|
155
|
-
# and model_fields_set contains the field
|
|
156
|
-
if self.aggregator is None and "aggregator" in self.model_fields_set:
|
|
157
|
-
_dict['aggregator'] = None
|
|
158
|
-
|
|
159
127
|
# set to None if feature_flags (nullable) is None
|
|
160
128
|
# and model_fields_set contains the field
|
|
161
129
|
if self.feature_flags is None and "feature_flags" in self.model_fields_set:
|
|
@@ -166,11 +134,6 @@ class CreateOrderModel(BaseModel):
|
|
|
166
134
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
167
135
|
_dict['priority'] = None
|
|
168
136
|
|
|
169
|
-
# set to None if sticky_state (nullable) is None
|
|
170
|
-
# and model_fields_set contains the field
|
|
171
|
-
if self.sticky_state is None and "sticky_state" in self.model_fields_set:
|
|
172
|
-
_dict['stickyState'] = None
|
|
173
|
-
|
|
174
137
|
# set to None if user_score_dimensions (nullable) is None
|
|
175
138
|
# and model_fields_set contains the field
|
|
176
139
|
if self.user_score_dimensions is None and "user_score_dimensions" in self.model_fields_set:
|
|
@@ -196,11 +159,6 @@ class CreateOrderModel(BaseModel):
|
|
|
196
159
|
if self.selections is None and "selections" in self.model_fields_set:
|
|
197
160
|
_dict['selections'] = None
|
|
198
161
|
|
|
199
|
-
# set to None if retrieval_mode (nullable) is None
|
|
200
|
-
# and model_fields_set contains the field
|
|
201
|
-
if self.retrieval_mode is None and "retrieval_mode" in self.model_fields_set:
|
|
202
|
-
_dict['retrievalMode'] = None
|
|
203
|
-
|
|
204
162
|
# set to None if max_iterations (nullable) is None
|
|
205
163
|
# and model_fields_set contains the field
|
|
206
164
|
if self.max_iterations is None and "max_iterations" in self.model_fields_set:
|
|
@@ -19,6 +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.retrieval_mode import RetrievalMode
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -28,7 +29,7 @@ class EffortCappedSelection(BaseModel):
|
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
t: StrictStr = Field(description="Discriminator value for EffortCappedSelection", alias="_t")
|
|
30
31
|
effort_budget: StrictInt = Field(alias="effortBudget")
|
|
31
|
-
retrieval_mode: Optional[
|
|
32
|
+
retrieval_mode: Optional[RetrievalMode] = Field(default=None, alias="retrievalMode")
|
|
32
33
|
max_iterations: Optional[StrictInt] = Field(default=None, alias="maxIterations")
|
|
33
34
|
__properties: ClassVar[List[str]] = ["_t", "effortBudget", "retrievalMode", "maxIterations"]
|
|
34
35
|
|
|
@@ -39,16 +40,6 @@ class EffortCappedSelection(BaseModel):
|
|
|
39
40
|
raise ValueError("must be one of enum values ('EffortCappedSelection')")
|
|
40
41
|
return value
|
|
41
42
|
|
|
42
|
-
@field_validator('retrieval_mode')
|
|
43
|
-
def retrieval_mode_validate_enum(cls, value):
|
|
44
|
-
"""Validates the enum"""
|
|
45
|
-
if value is None:
|
|
46
|
-
return value
|
|
47
|
-
|
|
48
|
-
if value not in set(['Random', 'Shuffled', 'Sequential']):
|
|
49
|
-
raise ValueError("must be one of enum values ('Random', 'Shuffled', 'Sequential')")
|
|
50
|
-
return value
|
|
51
|
-
|
|
52
43
|
model_config = ConfigDict(
|
|
53
44
|
populate_by_name=True,
|
|
54
45
|
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, StrictBool, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
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
|
|
|
@@ -31,7 +32,8 @@ class EvaluationWorkflowConfig(BaseModel):
|
|
|
31
32
|
validation_set_id: StrictStr = Field(alias="validationSetId")
|
|
32
33
|
referee: CompareWorkflowModel1Referee
|
|
33
34
|
should_accept_incorrect: StrictBool = Field(alias="shouldAcceptIncorrect")
|
|
34
|
-
|
|
35
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["_t", "validationSetId", "referee", "shouldAcceptIncorrect", "featureFlags"]
|
|
35
37
|
|
|
36
38
|
@field_validator('t')
|
|
37
39
|
def t_validate_enum(cls, value):
|
|
@@ -82,6 +84,13 @@ class EvaluationWorkflowConfig(BaseModel):
|
|
|
82
84
|
# override the default output from pydantic by calling `to_dict()` of referee
|
|
83
85
|
if self.referee:
|
|
84
86
|
_dict['referee'] = self.referee.to_dict()
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
88
|
+
_items = []
|
|
89
|
+
if self.feature_flags:
|
|
90
|
+
for _item_feature_flags in self.feature_flags:
|
|
91
|
+
if _item_feature_flags:
|
|
92
|
+
_items.append(_item_feature_flags.to_dict())
|
|
93
|
+
_dict['featureFlags'] = _items
|
|
85
94
|
return _dict
|
|
86
95
|
|
|
87
96
|
@classmethod
|
|
@@ -97,7 +106,8 @@ class EvaluationWorkflowConfig(BaseModel):
|
|
|
97
106
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'EvaluationWorkflowConfig',
|
|
98
107
|
"validationSetId": obj.get("validationSetId"),
|
|
99
108
|
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
100
|
-
"shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect")
|
|
109
|
+
"shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect"),
|
|
110
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
101
111
|
})
|
|
102
112
|
return _obj
|
|
103
113
|
|
|
@@ -18,7 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -29,7 +30,8 @@ class EvaluationWorkflowModel(BaseModel):
|
|
|
29
30
|
t: StrictStr = Field(description="Discriminator value for EvaluationWorkflow", alias="_t")
|
|
30
31
|
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
32
|
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
|
-
|
|
33
|
+
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")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["_t", "validationSetId", "shouldAcceptIncorrect", "featureFlags"]
|
|
33
35
|
|
|
34
36
|
@field_validator('t')
|
|
35
37
|
def t_validate_enum(cls, value):
|
|
@@ -77,6 +79,13 @@ class EvaluationWorkflowModel(BaseModel):
|
|
|
77
79
|
exclude=excluded_fields,
|
|
78
80
|
exclude_none=True,
|
|
79
81
|
)
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.feature_flags:
|
|
85
|
+
for _item_feature_flags in self.feature_flags:
|
|
86
|
+
if _item_feature_flags:
|
|
87
|
+
_items.append(_item_feature_flags.to_dict())
|
|
88
|
+
_dict['featureFlags'] = _items
|
|
80
89
|
return _dict
|
|
81
90
|
|
|
82
91
|
@classmethod
|
|
@@ -91,7 +100,8 @@ class EvaluationWorkflowModel(BaseModel):
|
|
|
91
100
|
_obj = cls.model_validate({
|
|
92
101
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'EvaluationWorkflow',
|
|
93
102
|
"validationSetId": obj.get("validationSetId"),
|
|
94
|
-
"shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect")
|
|
103
|
+
"shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect"),
|
|
104
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
95
105
|
})
|
|
96
106
|
return _obj
|
|
97
107
|
|
|
@@ -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.file_type import FileType
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -27,8 +28,8 @@ class FileTypeMetadata(BaseModel):
|
|
|
27
28
|
FileTypeMetadata
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
t: StrictStr = Field(description="Discriminator value for FileTypeMetadata", alias="_t")
|
|
30
|
-
file_type:
|
|
31
|
-
visibilities: Optional[StrictStr] = None
|
|
31
|
+
file_type: FileType = Field(alias="fileType")
|
|
32
|
+
visibilities: Optional[List[StrictStr]] = None
|
|
32
33
|
__properties: ClassVar[List[str]] = ["_t", "fileType", "visibilities"]
|
|
33
34
|
|
|
34
35
|
@field_validator('t')
|
|
@@ -38,11 +39,15 @@ class FileTypeMetadata(BaseModel):
|
|
|
38
39
|
raise ValueError("must be one of enum values ('FileTypeMetadata')")
|
|
39
40
|
return value
|
|
40
41
|
|
|
41
|
-
@field_validator('
|
|
42
|
-
def
|
|
42
|
+
@field_validator('visibilities')
|
|
43
|
+
def visibilities_validate_enum(cls, value):
|
|
43
44
|
"""Validates the enum"""
|
|
44
|
-
if value
|
|
45
|
-
|
|
45
|
+
if value is None:
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
for i in value:
|
|
49
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
50
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
46
51
|
return value
|
|
47
52
|
|
|
48
53
|
model_config = ConfigDict(
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.file_type import FileType
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -27,7 +28,7 @@ class FileTypeMetadataModel(BaseModel):
|
|
|
27
28
|
FileTypeMetadataModel
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
t: StrictStr = Field(description="Discriminator value for FileTypeMetadata", alias="_t")
|
|
30
|
-
file_type:
|
|
31
|
+
file_type: FileType = Field(alias="fileType")
|
|
31
32
|
__properties: ClassVar[List[str]] = ["_t", "fileType"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
@@ -37,13 +38,6 @@ class FileTypeMetadataModel(BaseModel):
|
|
|
37
38
|
raise ValueError("must be one of enum values ('FileTypeMetadata')")
|
|
38
39
|
return value
|
|
39
40
|
|
|
40
|
-
@field_validator('file_type')
|
|
41
|
-
def file_type_validate_enum(cls, value):
|
|
42
|
-
"""Validates the enum"""
|
|
43
|
-
if value not in set(['Unknown', 'Image', 'Video', 'Audio']):
|
|
44
|
-
raise ValueError("must be one of enum values ('Unknown', 'Image', 'Video', 'Audio')")
|
|
45
|
-
return value
|
|
46
|
-
|
|
47
41
|
model_config = ConfigDict(
|
|
48
42
|
populate_by_name=True,
|
|
49
43
|
validate_assignment=True,
|
|
@@ -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, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.filter_operator import FilterOperator
|
|
23
|
+
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -28,31 +30,11 @@ class Filter(BaseModel):
|
|
|
28
30
|
""" # noqa: E501
|
|
29
31
|
var_field: Optional[StrictStr] = Field(default=None, alias="field")
|
|
30
32
|
value: Optional[Any] = None
|
|
31
|
-
operator: Optional[
|
|
32
|
-
logic: Optional[
|
|
33
|
+
operator: Optional[FilterOperator] = None
|
|
34
|
+
logic: Optional[LogicOperator] = None
|
|
33
35
|
filters: Optional[List[Filter]] = None
|
|
34
36
|
__properties: ClassVar[List[str]] = ["field", "value", "operator", "logic", "filters"]
|
|
35
37
|
|
|
36
|
-
@field_validator('operator')
|
|
37
|
-
def operator_validate_enum(cls, value):
|
|
38
|
-
"""Validates the enum"""
|
|
39
|
-
if value is None:
|
|
40
|
-
return value
|
|
41
|
-
|
|
42
|
-
if value not in set(['Eq', 'Neq', 'Gt', 'Gte', 'Lt', 'Lte', 'Contains', 'StartsWith', 'EndsWith', 'In']):
|
|
43
|
-
raise ValueError("must be one of enum values ('Eq', 'Neq', 'Gt', 'Gte', 'Lt', 'Lte', 'Contains', 'StartsWith', 'EndsWith', 'In')")
|
|
44
|
-
return value
|
|
45
|
-
|
|
46
|
-
@field_validator('logic')
|
|
47
|
-
def logic_validate_enum(cls, value):
|
|
48
|
-
"""Validates the enum"""
|
|
49
|
-
if value is None:
|
|
50
|
-
return value
|
|
51
|
-
|
|
52
|
-
if value not in set(['And', 'Or', 'Not']):
|
|
53
|
-
raise ValueError("must be one of enum values ('And', 'Or', 'Not')")
|
|
54
|
-
return value
|
|
55
|
-
|
|
56
38
|
model_config = ConfigDict(
|
|
57
39
|
populate_by_name=True,
|
|
58
40
|
validate_assignment=True,
|
|
@@ -18,9 +18,10 @@ 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, Optional
|
|
23
23
|
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
24
|
+
from rapidata.api_client.models.datapoint_state import DatapointState
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
26
27
|
|
|
@@ -30,19 +31,12 @@ class GetDatapointByIdResult(BaseModel):
|
|
|
30
31
|
""" # noqa: E501
|
|
31
32
|
id: StrictStr
|
|
32
33
|
dataset_id: StrictStr = Field(alias="datasetId")
|
|
33
|
-
state:
|
|
34
|
+
state: DatapointState
|
|
34
35
|
sort_index: Optional[StrictInt] = Field(default=None, alias="sortIndex")
|
|
35
36
|
asset: DatapointAsset
|
|
36
37
|
created_at: datetime = Field(alias="createdAt")
|
|
37
38
|
__properties: ClassVar[List[str]] = ["id", "datasetId", "state", "sortIndex", "asset", "createdAt"]
|
|
38
39
|
|
|
39
|
-
@field_validator('state')
|
|
40
|
-
def state_validate_enum(cls, value):
|
|
41
|
-
"""Validates the enum"""
|
|
42
|
-
if value not in set(['Ready', 'Pending', 'Failed']):
|
|
43
|
-
raise ValueError("must be one of enum values ('Ready', 'Pending', 'Failed')")
|
|
44
|
-
return value
|
|
45
|
-
|
|
46
40
|
model_config = ConfigDict(
|
|
47
41
|
populate_by_name=True,
|
|
48
42
|
validate_assignment=True,
|
|
@@ -17,10 +17,11 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
23
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
24
|
+
from rapidata.api_client.models.rapid_state import RapidState
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
26
27
|
|
|
@@ -31,16 +32,9 @@ class GetRapidResponsesResult(BaseModel):
|
|
|
31
32
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
33
|
asset: DatapointAsset
|
|
33
34
|
responses: List[RapidResponse]
|
|
34
|
-
state:
|
|
35
|
+
state: RapidState
|
|
35
36
|
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
36
37
|
|
|
37
|
-
@field_validator('state')
|
|
38
|
-
def state_validate_enum(cls, value):
|
|
39
|
-
"""Validates the enum"""
|
|
40
|
-
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
41
|
-
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
42
|
-
return value
|
|
43
|
-
|
|
44
38
|
model_config = ConfigDict(
|
|
45
39
|
populate_by_name=True,
|
|
46
40
|
validate_assignment=True,
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.validation_set_model import ValidationSetModel
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetRecommendedValidationSetResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetRecommendedValidationSetResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
validation_sets: List[ValidationSetModel] = Field(alias="validationSets")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["validationSets"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetRecommendedValidationSetResult from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in validation_sets (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.validation_sets:
|
|
75
|
+
for _item_validation_sets in self.validation_sets:
|
|
76
|
+
if _item_validation_sets:
|
|
77
|
+
_items.append(_item_validation_sets.to_dict())
|
|
78
|
+
_dict['validationSets'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetRecommendedValidationSetResult from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"validationSets": [ValidationSetModel.from_dict(_item) for _item in obj["validationSets"]] if obj.get("validationSets") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -17,8 +17,9 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.standing_status import StandingStatus
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -30,17 +31,10 @@ class GetStandingByIdResult(BaseModel):
|
|
|
30
31
|
name: StrictStr
|
|
31
32
|
benchmark_id: StrictStr = Field(alias="benchmarkId")
|
|
32
33
|
dataset_id: StrictStr = Field(alias="datasetId")
|
|
33
|
-
status:
|
|
34
|
+
status: StandingStatus
|
|
34
35
|
is_disabled: StrictBool = Field(alias="isDisabled")
|
|
35
36
|
__properties: ClassVar[List[str]] = ["id", "name", "benchmarkId", "datasetId", "status", "isDisabled"]
|
|
36
37
|
|
|
37
|
-
@field_validator('status')
|
|
38
|
-
def status_validate_enum(cls, value):
|
|
39
|
-
"""Validates the enum"""
|
|
40
|
-
if value not in set(['Created', 'Active', 'Idle']):
|
|
41
|
-
raise ValueError("must be one of enum values ('Created', 'Active', 'Idle')")
|
|
42
|
-
return value
|
|
43
|
-
|
|
44
38
|
model_config = ConfigDict(
|
|
45
39
|
populate_by_name=True,
|
|
46
40
|
validate_assignment=True,
|
|
@@ -17,12 +17,13 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
23
23
|
from rapidata.api_client.models.get_validation_rapids_result_asset import GetValidationRapidsResultAsset
|
|
24
24
|
from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
|
|
25
25
|
from rapidata.api_client.models.get_validation_rapids_result_truth import GetValidationRapidsResultTruth
|
|
26
|
+
from rapidata.api_client.models.rapid_state import RapidState
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -40,16 +41,9 @@ class GetValidationRapidsResult(BaseModel):
|
|
|
40
41
|
invalid_validation_count: StrictInt = Field(alias="invalidValidationCount")
|
|
41
42
|
explanation: Optional[StrictStr] = None
|
|
42
43
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomCorrectProbability")
|
|
43
|
-
state:
|
|
44
|
+
state: RapidState
|
|
44
45
|
__properties: ClassVar[List[str]] = ["id", "type", "asset", "truth", "payload", "metadata", "correctValidationCount", "invalidValidationCount", "explanation", "randomCorrectProbability", "state"]
|
|
45
46
|
|
|
46
|
-
@field_validator('state')
|
|
47
|
-
def state_validate_enum(cls, value):
|
|
48
|
-
"""Validates the enum"""
|
|
49
|
-
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
50
|
-
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
51
|
-
return value
|
|
52
|
-
|
|
53
47
|
model_config = ConfigDict(
|
|
54
48
|
populate_by_name=True,
|
|
55
49
|
validate_assignment=True,
|
|
@@ -17,8 +17,9 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
+
from rapidata.api_client.models.workflow_state import WorkflowState
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -29,16 +30,9 @@ class GetWorkflowProgressResult(BaseModel):
|
|
|
29
30
|
completion_percentage: Union[StrictFloat, StrictInt] = Field(alias="completionPercentage")
|
|
30
31
|
total: StrictInt
|
|
31
32
|
completed: StrictInt
|
|
32
|
-
state:
|
|
33
|
+
state: WorkflowState
|
|
33
34
|
__properties: ClassVar[List[str]] = ["completionPercentage", "total", "completed", "state"]
|
|
34
35
|
|
|
35
|
-
@field_validator('state')
|
|
36
|
-
def state_validate_enum(cls, value):
|
|
37
|
-
"""Validates the enum"""
|
|
38
|
-
if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
|
|
39
|
-
raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
|
|
40
|
-
return value
|
|
41
|
-
|
|
42
36
|
model_config = ConfigDict(
|
|
43
37
|
populate_by_name=True,
|
|
44
38
|
validate_assignment=True,
|
|
@@ -17,11 +17,12 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
23
|
from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
|
|
24
24
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
25
|
+
from rapidata.api_client.models.rapid_state import RapidState
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -33,16 +34,9 @@ class GetWorkflowResultsResult(BaseModel):
|
|
|
33
34
|
payload: GetValidationRapidsResultPayload
|
|
34
35
|
asset: DatapointAsset
|
|
35
36
|
responses: List[RapidResponse]
|
|
36
|
-
state:
|
|
37
|
+
state: RapidState
|
|
37
38
|
__properties: ClassVar[List[str]] = ["rapidId", "payload", "asset", "responses", "state"]
|
|
38
39
|
|
|
39
|
-
@field_validator('state')
|
|
40
|
-
def state_validate_enum(cls, value):
|
|
41
|
-
"""Validates the enum"""
|
|
42
|
-
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
|
|
43
|
-
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
|
|
44
|
-
return value
|
|
45
|
-
|
|
46
40
|
model_config = ConfigDict(
|
|
47
41
|
populate_by_name=True,
|
|
48
42
|
validate_assignment=True,
|