rapidata 2.41.0__py3-none-any.whl → 2.41.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 +1 -1
- rapidata/api_client/__init__.py +4 -2
- rapidata/api_client/api/dataset_api.py +544 -0
- rapidata/api_client/api/order_api.py +1 -3
- rapidata/api_client/models/__init__.py +4 -2
- rapidata/api_client/models/compare_workflow_config.py +3 -3
- rapidata/api_client/models/compare_workflow_config_model.py +3 -3
- rapidata/api_client/models/compare_workflow_model.py +4 -4
- rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +1 -1
- rapidata/api_client/models/create_order_model_referee.py +12 -12
- rapidata/api_client/models/create_order_model_workflow.py +15 -15
- rapidata/api_client/models/early_stopping_referee_model.py +3 -3
- rapidata/api_client/models/elo_config_model.py +4 -4
- rapidata/api_client/models/evaluation_workflow_model.py +4 -4
- rapidata/api_client/models/existing_asset_input.py +100 -0
- rapidata/api_client/models/file_asset.py +3 -3
- rapidata/api_client/models/file_asset_metadata_value.py +296 -0
- rapidata/api_client/models/multi_asset.py +3 -3
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input3_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input_assets_inner.py +40 -12
- rapidata/api_client/models/naive_referee_model.py +2 -2
- rapidata/api_client/models/null_asset.py +3 -3
- rapidata/api_client/models/online_pair_maker_config_model.py +3 -3
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +40 -12
- rapidata/api_client/models/reference_asset_input.py +100 -0
- rapidata/api_client/models/simple_workflow_model.py +5 -5
- rapidata/api_client/models/submit_prompt_model_prompt_asset.py +40 -12
- rapidata/api_client/models/text_asset.py +3 -3
- rapidata/api_client/models/upload_asset_result.py +102 -0
- rapidata/api_client_README.md +6 -2
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +5 -18
- rapidata/rapidata_client/demographic/demographic_manager.py +6 -0
- rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +6 -0
- rapidata/rapidata_client/rapidata_client.py +6 -0
- rapidata/rapidata_client/selection/ab_test_selection.py +6 -0
- rapidata/rapidata_client/selection/capped_selection.py +6 -0
- rapidata/rapidata_client/selection/conditional_validation_selection.py +6 -0
- rapidata/rapidata_client/selection/demographic_selection.py +6 -0
- rapidata/rapidata_client/selection/effort_selection.py +6 -0
- rapidata/rapidata_client/selection/labeling_selection.py +6 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +6 -0
- rapidata/rapidata_client/selection/shuffling_selection.py +6 -0
- rapidata/rapidata_client/selection/static_selection.py +6 -0
- rapidata/rapidata_client/selection/validation_selection.py +6 -0
- rapidata/rapidata_client/settings/rapidata_settings.py +6 -0
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +6 -0
- rapidata/rapidata_client/validation/validation_set_manager.py +7 -1
- rapidata/rapidata_client/workflow/_classify_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_compare_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_draw_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_free_text_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_locate_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_select_words_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +4 -3
- rapidata/service/openapi_service.py +1 -3
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/METADATA +4 -2
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/RECORD +61 -57
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/WHEEL +1 -1
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info/licenses}/LICENSE +0 -0
|
@@ -17,29 +17,35 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.existing_asset_input import ExistingAssetInput
|
|
20
21
|
from rapidata.api_client.models.file_asset_input import FileAssetInput
|
|
22
|
+
from rapidata.api_client.models.reference_asset_input import ReferenceAssetInput
|
|
21
23
|
from rapidata.api_client.models.text_asset_input import TextAssetInput
|
|
22
24
|
from rapidata.api_client.models.url_asset_input import UrlAssetInput
|
|
23
25
|
from pydantic import StrictStr, Field
|
|
24
26
|
from typing import Union, List, Set, Optional, Dict
|
|
25
27
|
from typing_extensions import Literal, Self
|
|
26
28
|
|
|
27
|
-
MULTIASSETINPUTASSETSINNER_ONE_OF_SCHEMAS = ["FileAssetInput", "MultiAssetInput", "TextAssetInput", "UrlAssetInput"]
|
|
29
|
+
MULTIASSETINPUTASSETSINNER_ONE_OF_SCHEMAS = ["ExistingAssetInput", "FileAssetInput", "MultiAssetInput", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput"]
|
|
28
30
|
|
|
29
31
|
class MultiAssetInputAssetsInner(BaseModel):
|
|
30
32
|
"""
|
|
31
33
|
MultiAssetInputAssetsInner
|
|
32
34
|
"""
|
|
35
|
+
# data type: ExistingAssetInput
|
|
36
|
+
oneof_schema_1_validator: Optional[ExistingAssetInput] = None
|
|
33
37
|
# data type: FileAssetInput
|
|
34
|
-
|
|
38
|
+
oneof_schema_2_validator: Optional[FileAssetInput] = None
|
|
35
39
|
# data type: MultiAssetInput
|
|
36
|
-
|
|
40
|
+
oneof_schema_3_validator: Optional[MultiAssetInput] = None
|
|
41
|
+
# data type: ReferenceAssetInput
|
|
42
|
+
oneof_schema_4_validator: Optional[ReferenceAssetInput] = None
|
|
37
43
|
# data type: TextAssetInput
|
|
38
|
-
|
|
44
|
+
oneof_schema_5_validator: Optional[TextAssetInput] = None
|
|
39
45
|
# data type: UrlAssetInput
|
|
40
|
-
|
|
41
|
-
actual_instance: Optional[Union[FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput]] = None
|
|
42
|
-
one_of_schemas: Set[str] = { "FileAssetInput", "MultiAssetInput", "TextAssetInput", "UrlAssetInput" }
|
|
46
|
+
oneof_schema_6_validator: Optional[UrlAssetInput] = None
|
|
47
|
+
actual_instance: Optional[Union[ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput]] = None
|
|
48
|
+
one_of_schemas: Set[str] = { "ExistingAssetInput", "FileAssetInput", "MultiAssetInput", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput" }
|
|
43
49
|
|
|
44
50
|
model_config = ConfigDict(
|
|
45
51
|
validate_assignment=True,
|
|
@@ -65,6 +71,11 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
65
71
|
instance = MultiAssetInputAssetsInner.model_construct()
|
|
66
72
|
error_messages = []
|
|
67
73
|
match = 0
|
|
74
|
+
# validate data type: ExistingAssetInput
|
|
75
|
+
if not isinstance(v, ExistingAssetInput):
|
|
76
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ExistingAssetInput`")
|
|
77
|
+
else:
|
|
78
|
+
match += 1
|
|
68
79
|
# validate data type: FileAssetInput
|
|
69
80
|
if not isinstance(v, FileAssetInput):
|
|
70
81
|
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput`")
|
|
@@ -75,6 +86,11 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
75
86
|
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput`")
|
|
76
87
|
else:
|
|
77
88
|
match += 1
|
|
89
|
+
# validate data type: ReferenceAssetInput
|
|
90
|
+
if not isinstance(v, ReferenceAssetInput):
|
|
91
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ReferenceAssetInput`")
|
|
92
|
+
else:
|
|
93
|
+
match += 1
|
|
78
94
|
# validate data type: TextAssetInput
|
|
79
95
|
if not isinstance(v, TextAssetInput):
|
|
80
96
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
|
|
@@ -87,10 +103,10 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
87
103
|
match += 1
|
|
88
104
|
if match > 1:
|
|
89
105
|
# more than 1 match
|
|
90
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in MultiAssetInputAssetsInner with oneOf schemas: FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
106
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in MultiAssetInputAssetsInner with oneOf schemas: ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
91
107
|
elif match == 0:
|
|
92
108
|
# no match
|
|
93
|
-
raise ValueError("No match found when setting `actual_instance` in MultiAssetInputAssetsInner with oneOf schemas: FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
109
|
+
raise ValueError("No match found when setting `actual_instance` in MultiAssetInputAssetsInner with oneOf schemas: ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
94
110
|
else:
|
|
95
111
|
return v
|
|
96
112
|
|
|
@@ -105,6 +121,12 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
105
121
|
error_messages = []
|
|
106
122
|
match = 0
|
|
107
123
|
|
|
124
|
+
# deserialize data into ExistingAssetInput
|
|
125
|
+
try:
|
|
126
|
+
instance.actual_instance = ExistingAssetInput.from_json(json_str)
|
|
127
|
+
match += 1
|
|
128
|
+
except (ValidationError, ValueError) as e:
|
|
129
|
+
error_messages.append(str(e))
|
|
108
130
|
# deserialize data into FileAssetInput
|
|
109
131
|
try:
|
|
110
132
|
instance.actual_instance = FileAssetInput.from_json(json_str)
|
|
@@ -117,6 +139,12 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
117
139
|
match += 1
|
|
118
140
|
except (ValidationError, ValueError) as e:
|
|
119
141
|
error_messages.append(str(e))
|
|
142
|
+
# deserialize data into ReferenceAssetInput
|
|
143
|
+
try:
|
|
144
|
+
instance.actual_instance = ReferenceAssetInput.from_json(json_str)
|
|
145
|
+
match += 1
|
|
146
|
+
except (ValidationError, ValueError) as e:
|
|
147
|
+
error_messages.append(str(e))
|
|
120
148
|
# deserialize data into TextAssetInput
|
|
121
149
|
try:
|
|
122
150
|
instance.actual_instance = TextAssetInput.from_json(json_str)
|
|
@@ -132,10 +160,10 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
132
160
|
|
|
133
161
|
if match > 1:
|
|
134
162
|
# more than 1 match
|
|
135
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into MultiAssetInputAssetsInner with oneOf schemas: FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
163
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into MultiAssetInputAssetsInner with oneOf schemas: ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
136
164
|
elif match == 0:
|
|
137
165
|
# no match
|
|
138
|
-
raise ValueError("No match found when deserializing the JSON string into MultiAssetInputAssetsInner with oneOf schemas: FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
166
|
+
raise ValueError("No match found when deserializing the JSON string into MultiAssetInputAssetsInner with oneOf schemas: ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
139
167
|
else:
|
|
140
168
|
return instance
|
|
141
169
|
|
|
@@ -149,7 +177,7 @@ class MultiAssetInputAssetsInner(BaseModel):
|
|
|
149
177
|
else:
|
|
150
178
|
return json.dumps(self.actual_instance)
|
|
151
179
|
|
|
152
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput]]:
|
|
180
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ExistingAssetInput, FileAssetInput, MultiAssetInput, ReferenceAssetInput, TextAssetInput, UrlAssetInput]]:
|
|
153
181
|
"""Returns the dict representation of the actual instance"""
|
|
154
182
|
if self.actual_instance is None:
|
|
155
183
|
return None
|
|
@@ -24,10 +24,10 @@ from typing_extensions import Self
|
|
|
24
24
|
|
|
25
25
|
class NaiveRefereeModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
NaiveRefereeModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for NaiveReferee", alias="_t")
|
|
30
|
-
total_votes: StrictInt = Field(
|
|
30
|
+
total_votes: StrictInt = Field(alias="totalVotes")
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "totalVotes"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -27,7 +27,7 @@ class NullAsset(BaseModel):
|
|
|
27
27
|
NullAsset
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for NullAsset", alias="_t")
|
|
30
|
-
metadata: Optional[Dict[str,
|
|
30
|
+
metadata: Optional[Dict[str, FileAssetMetadataValue]] = None
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "metadata"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -97,7 +97,7 @@ class NullAsset(BaseModel):
|
|
|
97
97
|
_obj = cls.model_validate({
|
|
98
98
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'NullAsset',
|
|
99
99
|
"metadata": dict(
|
|
100
|
-
(_k,
|
|
100
|
+
(_k, FileAssetMetadataValue.from_dict(_v))
|
|
101
101
|
for _k, _v in obj["metadata"].items()
|
|
102
102
|
)
|
|
103
103
|
if obj.get("metadata") is not None
|
|
@@ -105,7 +105,7 @@ class NullAsset(BaseModel):
|
|
|
105
105
|
})
|
|
106
106
|
return _obj
|
|
107
107
|
|
|
108
|
-
from rapidata.api_client.models.
|
|
108
|
+
from rapidata.api_client.models.file_asset_metadata_value import FileAssetMetadataValue
|
|
109
109
|
# TODO: Rewrite to not use raise_errors
|
|
110
110
|
NullAsset.model_rebuild(raise_errors=False)
|
|
111
111
|
|
|
@@ -24,11 +24,11 @@ from typing_extensions import Self
|
|
|
24
24
|
|
|
25
25
|
class OnlinePairMakerConfigModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
OnlinePairMakerConfigModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for OnlinePairMaker", alias="_t")
|
|
30
|
-
random_matches_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None,
|
|
31
|
-
total_comparison_budget: Optional[StrictInt] = Field(default=None,
|
|
30
|
+
random_matches_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomMatchesRatio")
|
|
31
|
+
total_comparison_budget: Optional[StrictInt] = Field(default=None, alias="totalComparisonBudget")
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "randomMatchesRatio", "totalComparisonBudget"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -17,29 +17,35 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.existing_asset_input import ExistingAssetInput
|
|
20
21
|
from rapidata.api_client.models.file_asset_input2 import FileAssetInput2
|
|
22
|
+
from rapidata.api_client.models.reference_asset_input import ReferenceAssetInput
|
|
21
23
|
from rapidata.api_client.models.text_asset_input import TextAssetInput
|
|
22
24
|
from rapidata.api_client.models.url_asset_input import UrlAssetInput
|
|
23
25
|
from pydantic import StrictStr, Field
|
|
24
26
|
from typing import Union, List, Set, Optional, Dict
|
|
25
27
|
from typing_extensions import Literal, Self
|
|
26
28
|
|
|
27
|
-
PROMPTASSETMETADATAINPUTASSET_ONE_OF_SCHEMAS = ["FileAssetInput2", "MultiAssetInput2", "TextAssetInput", "UrlAssetInput"]
|
|
29
|
+
PROMPTASSETMETADATAINPUTASSET_ONE_OF_SCHEMAS = ["ExistingAssetInput", "FileAssetInput2", "MultiAssetInput2", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput"]
|
|
28
30
|
|
|
29
31
|
class PromptAssetMetadataInputAsset(BaseModel):
|
|
30
32
|
"""
|
|
31
33
|
PromptAssetMetadataInputAsset
|
|
32
34
|
"""
|
|
35
|
+
# data type: ExistingAssetInput
|
|
36
|
+
oneof_schema_1_validator: Optional[ExistingAssetInput] = None
|
|
33
37
|
# data type: FileAssetInput2
|
|
34
|
-
|
|
38
|
+
oneof_schema_2_validator: Optional[FileAssetInput2] = None
|
|
35
39
|
# data type: MultiAssetInput2
|
|
36
|
-
|
|
40
|
+
oneof_schema_3_validator: Optional[MultiAssetInput2] = None
|
|
41
|
+
# data type: ReferenceAssetInput
|
|
42
|
+
oneof_schema_4_validator: Optional[ReferenceAssetInput] = None
|
|
37
43
|
# data type: TextAssetInput
|
|
38
|
-
|
|
44
|
+
oneof_schema_5_validator: Optional[TextAssetInput] = None
|
|
39
45
|
# data type: UrlAssetInput
|
|
40
|
-
|
|
41
|
-
actual_instance: Optional[Union[FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput]] = None
|
|
42
|
-
one_of_schemas: Set[str] = { "FileAssetInput2", "MultiAssetInput2", "TextAssetInput", "UrlAssetInput" }
|
|
46
|
+
oneof_schema_6_validator: Optional[UrlAssetInput] = None
|
|
47
|
+
actual_instance: Optional[Union[ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput]] = None
|
|
48
|
+
one_of_schemas: Set[str] = { "ExistingAssetInput", "FileAssetInput2", "MultiAssetInput2", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput" }
|
|
43
49
|
|
|
44
50
|
model_config = ConfigDict(
|
|
45
51
|
validate_assignment=True,
|
|
@@ -65,6 +71,11 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
65
71
|
instance = PromptAssetMetadataInputAsset.model_construct()
|
|
66
72
|
error_messages = []
|
|
67
73
|
match = 0
|
|
74
|
+
# validate data type: ExistingAssetInput
|
|
75
|
+
if not isinstance(v, ExistingAssetInput):
|
|
76
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ExistingAssetInput`")
|
|
77
|
+
else:
|
|
78
|
+
match += 1
|
|
68
79
|
# validate data type: FileAssetInput2
|
|
69
80
|
if not isinstance(v, FileAssetInput2):
|
|
70
81
|
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput2`")
|
|
@@ -75,6 +86,11 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
75
86
|
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput2`")
|
|
76
87
|
else:
|
|
77
88
|
match += 1
|
|
89
|
+
# validate data type: ReferenceAssetInput
|
|
90
|
+
if not isinstance(v, ReferenceAssetInput):
|
|
91
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ReferenceAssetInput`")
|
|
92
|
+
else:
|
|
93
|
+
match += 1
|
|
78
94
|
# validate data type: TextAssetInput
|
|
79
95
|
if not isinstance(v, TextAssetInput):
|
|
80
96
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
|
|
@@ -87,10 +103,10 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
87
103
|
match += 1
|
|
88
104
|
if match > 1:
|
|
89
105
|
# more than 1 match
|
|
90
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
106
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
91
107
|
elif match == 0:
|
|
92
108
|
# no match
|
|
93
|
-
raise ValueError("No match found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
109
|
+
raise ValueError("No match found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
94
110
|
else:
|
|
95
111
|
return v
|
|
96
112
|
|
|
@@ -105,6 +121,12 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
105
121
|
error_messages = []
|
|
106
122
|
match = 0
|
|
107
123
|
|
|
124
|
+
# deserialize data into ExistingAssetInput
|
|
125
|
+
try:
|
|
126
|
+
instance.actual_instance = ExistingAssetInput.from_json(json_str)
|
|
127
|
+
match += 1
|
|
128
|
+
except (ValidationError, ValueError) as e:
|
|
129
|
+
error_messages.append(str(e))
|
|
108
130
|
# deserialize data into FileAssetInput2
|
|
109
131
|
try:
|
|
110
132
|
instance.actual_instance = FileAssetInput2.from_json(json_str)
|
|
@@ -117,6 +139,12 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
117
139
|
match += 1
|
|
118
140
|
except (ValidationError, ValueError) as e:
|
|
119
141
|
error_messages.append(str(e))
|
|
142
|
+
# deserialize data into ReferenceAssetInput
|
|
143
|
+
try:
|
|
144
|
+
instance.actual_instance = ReferenceAssetInput.from_json(json_str)
|
|
145
|
+
match += 1
|
|
146
|
+
except (ValidationError, ValueError) as e:
|
|
147
|
+
error_messages.append(str(e))
|
|
120
148
|
# deserialize data into TextAssetInput
|
|
121
149
|
try:
|
|
122
150
|
instance.actual_instance = TextAssetInput.from_json(json_str)
|
|
@@ -132,10 +160,10 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
132
160
|
|
|
133
161
|
if match > 1:
|
|
134
162
|
# more than 1 match
|
|
135
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
163
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
136
164
|
elif match == 0:
|
|
137
165
|
# no match
|
|
138
|
-
raise ValueError("No match found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
166
|
+
raise ValueError("No match found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
139
167
|
else:
|
|
140
168
|
return instance
|
|
141
169
|
|
|
@@ -149,7 +177,7 @@ class PromptAssetMetadataInputAsset(BaseModel):
|
|
|
149
177
|
else:
|
|
150
178
|
return json.dumps(self.actual_instance)
|
|
151
179
|
|
|
152
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput]]:
|
|
180
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ExistingAssetInput, FileAssetInput2, MultiAssetInput2, ReferenceAssetInput, TextAssetInput, UrlAssetInput]]:
|
|
153
181
|
"""Returns the dict representation of the actual instance"""
|
|
154
182
|
if self.actual_instance is None:
|
|
155
183
|
return None
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ReferenceAssetInput(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ReferenceAssetInput
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for ReferenceAssetInput", alias="_t")
|
|
30
|
+
identifier: Optional[StrictStr] = None
|
|
31
|
+
reference: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "identifier", "reference"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['ReferenceAssetInput']):
|
|
38
|
+
raise ValueError("must be one of enum values ('ReferenceAssetInput')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of ReferenceAssetInput from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
"identifier",
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of ReferenceAssetInput from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'ReferenceAssetInput',
|
|
95
|
+
"identifier": obj.get("identifier"),
|
|
96
|
+
"reference": obj.get("reference")
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -20,17 +20,17 @@ 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.feature_flag import FeatureFlag
|
|
23
|
-
from rapidata.api_client.models.
|
|
23
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import ValidationSetZipPostRequestBlueprint
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
27
27
|
class SimpleWorkflowModel(BaseModel):
|
|
28
28
|
"""
|
|
29
|
-
|
|
29
|
+
SimpleWorkflowModel
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
t: StrictStr = Field(description="Discriminator value for SimpleWorkflow", alias="_t")
|
|
32
|
-
blueprint:
|
|
33
|
-
feature_flags: Optional[List[FeatureFlag]] = Field(default=None,
|
|
32
|
+
blueprint: ValidationSetZipPostRequestBlueprint
|
|
33
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
34
34
|
__properties: ClassVar[List[str]] = ["_t", "blueprint", "featureFlags"]
|
|
35
35
|
|
|
36
36
|
@field_validator('t')
|
|
@@ -102,7 +102,7 @@ class SimpleWorkflowModel(BaseModel):
|
|
|
102
102
|
|
|
103
103
|
_obj = cls.model_validate({
|
|
104
104
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'SimpleWorkflow',
|
|
105
|
-
"blueprint":
|
|
105
|
+
"blueprint": ValidationSetZipPostRequestBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
|
|
106
106
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
107
107
|
})
|
|
108
108
|
return _obj
|
|
@@ -17,30 +17,36 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.existing_asset_input import ExistingAssetInput
|
|
20
21
|
from rapidata.api_client.models.file_asset_input3 import FileAssetInput3
|
|
21
22
|
from rapidata.api_client.models.multi_asset_input3 import MultiAssetInput3
|
|
23
|
+
from rapidata.api_client.models.reference_asset_input import ReferenceAssetInput
|
|
22
24
|
from rapidata.api_client.models.text_asset_input import TextAssetInput
|
|
23
25
|
from rapidata.api_client.models.url_asset_input import UrlAssetInput
|
|
24
26
|
from pydantic import StrictStr, Field
|
|
25
27
|
from typing import Union, List, Set, Optional, Dict
|
|
26
28
|
from typing_extensions import Literal, Self
|
|
27
29
|
|
|
28
|
-
SUBMITPROMPTMODELPROMPTASSET_ONE_OF_SCHEMAS = ["FileAssetInput3", "MultiAssetInput3", "TextAssetInput", "UrlAssetInput"]
|
|
30
|
+
SUBMITPROMPTMODELPROMPTASSET_ONE_OF_SCHEMAS = ["ExistingAssetInput", "FileAssetInput3", "MultiAssetInput3", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput"]
|
|
29
31
|
|
|
30
32
|
class SubmitPromptModelPromptAsset(BaseModel):
|
|
31
33
|
"""
|
|
32
34
|
|
|
33
35
|
"""
|
|
36
|
+
# data type: ExistingAssetInput
|
|
37
|
+
oneof_schema_1_validator: Optional[ExistingAssetInput] = None
|
|
34
38
|
# data type: FileAssetInput3
|
|
35
|
-
|
|
39
|
+
oneof_schema_2_validator: Optional[FileAssetInput3] = None
|
|
36
40
|
# data type: MultiAssetInput3
|
|
37
|
-
|
|
41
|
+
oneof_schema_3_validator: Optional[MultiAssetInput3] = None
|
|
42
|
+
# data type: ReferenceAssetInput
|
|
43
|
+
oneof_schema_4_validator: Optional[ReferenceAssetInput] = None
|
|
38
44
|
# data type: TextAssetInput
|
|
39
|
-
|
|
45
|
+
oneof_schema_5_validator: Optional[TextAssetInput] = None
|
|
40
46
|
# data type: UrlAssetInput
|
|
41
|
-
|
|
42
|
-
actual_instance: Optional[Union[FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput]] = None
|
|
43
|
-
one_of_schemas: Set[str] = { "FileAssetInput3", "MultiAssetInput3", "TextAssetInput", "UrlAssetInput" }
|
|
47
|
+
oneof_schema_6_validator: Optional[UrlAssetInput] = None
|
|
48
|
+
actual_instance: Optional[Union[ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput]] = None
|
|
49
|
+
one_of_schemas: Set[str] = { "ExistingAssetInput", "FileAssetInput3", "MultiAssetInput3", "ReferenceAssetInput", "TextAssetInput", "UrlAssetInput" }
|
|
44
50
|
|
|
45
51
|
model_config = ConfigDict(
|
|
46
52
|
validate_assignment=True,
|
|
@@ -69,6 +75,11 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
69
75
|
instance = SubmitPromptModelPromptAsset.model_construct()
|
|
70
76
|
error_messages = []
|
|
71
77
|
match = 0
|
|
78
|
+
# validate data type: ExistingAssetInput
|
|
79
|
+
if not isinstance(v, ExistingAssetInput):
|
|
80
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ExistingAssetInput`")
|
|
81
|
+
else:
|
|
82
|
+
match += 1
|
|
72
83
|
# validate data type: FileAssetInput3
|
|
73
84
|
if not isinstance(v, FileAssetInput3):
|
|
74
85
|
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput3`")
|
|
@@ -79,6 +90,11 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
79
90
|
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput3`")
|
|
80
91
|
else:
|
|
81
92
|
match += 1
|
|
93
|
+
# validate data type: ReferenceAssetInput
|
|
94
|
+
if not isinstance(v, ReferenceAssetInput):
|
|
95
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ReferenceAssetInput`")
|
|
96
|
+
else:
|
|
97
|
+
match += 1
|
|
82
98
|
# validate data type: TextAssetInput
|
|
83
99
|
if not isinstance(v, TextAssetInput):
|
|
84
100
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
|
|
@@ -91,10 +107,10 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
91
107
|
match += 1
|
|
92
108
|
if match > 1:
|
|
93
109
|
# more than 1 match
|
|
94
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
110
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
95
111
|
elif match == 0:
|
|
96
112
|
# no match
|
|
97
|
-
raise ValueError("No match found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
113
|
+
raise ValueError("No match found when setting `actual_instance` in SubmitPromptModelPromptAsset with oneOf schemas: ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
98
114
|
else:
|
|
99
115
|
return v
|
|
100
116
|
|
|
@@ -112,6 +128,12 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
112
128
|
error_messages = []
|
|
113
129
|
match = 0
|
|
114
130
|
|
|
131
|
+
# deserialize data into ExistingAssetInput
|
|
132
|
+
try:
|
|
133
|
+
instance.actual_instance = ExistingAssetInput.from_json(json_str)
|
|
134
|
+
match += 1
|
|
135
|
+
except (ValidationError, ValueError) as e:
|
|
136
|
+
error_messages.append(str(e))
|
|
115
137
|
# deserialize data into FileAssetInput3
|
|
116
138
|
try:
|
|
117
139
|
instance.actual_instance = FileAssetInput3.from_json(json_str)
|
|
@@ -124,6 +146,12 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
124
146
|
match += 1
|
|
125
147
|
except (ValidationError, ValueError) as e:
|
|
126
148
|
error_messages.append(str(e))
|
|
149
|
+
# deserialize data into ReferenceAssetInput
|
|
150
|
+
try:
|
|
151
|
+
instance.actual_instance = ReferenceAssetInput.from_json(json_str)
|
|
152
|
+
match += 1
|
|
153
|
+
except (ValidationError, ValueError) as e:
|
|
154
|
+
error_messages.append(str(e))
|
|
127
155
|
# deserialize data into TextAssetInput
|
|
128
156
|
try:
|
|
129
157
|
instance.actual_instance = TextAssetInput.from_json(json_str)
|
|
@@ -139,10 +167,10 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
139
167
|
|
|
140
168
|
if match > 1:
|
|
141
169
|
# more than 1 match
|
|
142
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
170
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
143
171
|
elif match == 0:
|
|
144
172
|
# no match
|
|
145
|
-
raise ValueError("No match found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
173
|
+
raise ValueError("No match found when deserializing the JSON string into SubmitPromptModelPromptAsset with oneOf schemas: ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
|
|
146
174
|
else:
|
|
147
175
|
return instance
|
|
148
176
|
|
|
@@ -156,7 +184,7 @@ class SubmitPromptModelPromptAsset(BaseModel):
|
|
|
156
184
|
else:
|
|
157
185
|
return json.dumps(self.actual_instance)
|
|
158
186
|
|
|
159
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput3, MultiAssetInput3, TextAssetInput, UrlAssetInput]]:
|
|
187
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ExistingAssetInput, FileAssetInput3, MultiAssetInput3, ReferenceAssetInput, TextAssetInput, UrlAssetInput]]:
|
|
160
188
|
"""Returns the dict representation of the actual instance"""
|
|
161
189
|
if self.actual_instance is None:
|
|
162
190
|
return None
|
|
@@ -28,7 +28,7 @@ class TextAsset(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TextAsset", alias="_t")
|
|
30
30
|
text: StrictStr
|
|
31
|
-
metadata: Optional[Dict[str,
|
|
31
|
+
metadata: Optional[Dict[str, FileAssetMetadataValue]] = None
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "text", "metadata"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -99,7 +99,7 @@ class TextAsset(BaseModel):
|
|
|
99
99
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TextAsset',
|
|
100
100
|
"text": obj.get("text"),
|
|
101
101
|
"metadata": dict(
|
|
102
|
-
(_k,
|
|
102
|
+
(_k, FileAssetMetadataValue.from_dict(_v))
|
|
103
103
|
for _k, _v in obj["metadata"].items()
|
|
104
104
|
)
|
|
105
105
|
if obj.get("metadata") is not None
|
|
@@ -107,7 +107,7 @@ class TextAsset(BaseModel):
|
|
|
107
107
|
})
|
|
108
108
|
return _obj
|
|
109
109
|
|
|
110
|
-
from rapidata.api_client.models.
|
|
110
|
+
from rapidata.api_client.models.file_asset_metadata_value import FileAssetMetadataValue
|
|
111
111
|
# TODO: Rewrite to not use raise_errors
|
|
112
112
|
TextAsset.model_rebuild(raise_errors=False)
|
|
113
113
|
|