rapidata 2.28.5__py3-none-any.whl → 2.29.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +1 -1
- rapidata/api_client/__init__.py +41 -8
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/benchmark_api.py +2766 -0
- rapidata/api_client/api/customer_rapid_api.py +332 -1
- rapidata/api_client/api/dataset_api.py +16 -0
- rapidata/api_client/api/leaderboard_api.py +1392 -270
- rapidata/api_client/models/__init__.py +40 -8
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/and_user_filter_model.py +106 -0
- rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
- rapidata/api_client/models/benchmark_query_result.py +94 -0
- rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
- rapidata/api_client/models/boost_leaderboard_model.py +89 -0
- rapidata/api_client/models/create_benchmark_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
- rapidata/api_client/models/create_benchmark_result.py +87 -0
- rapidata/api_client/models/create_datapoint_result.py +4 -16
- rapidata/api_client/models/create_leaderboard_model.py +18 -2
- rapidata/api_client/models/create_leaderboard_result.py +5 -3
- rapidata/api_client/models/create_order_model.py +3 -3
- rapidata/api_client/models/file_asset_input.py +104 -0
- rapidata/api_client/models/file_asset_input1.py +104 -0
- rapidata/api_client/models/file_asset_input1_file.py +168 -0
- rapidata/api_client/models/file_asset_input2.py +104 -0
- rapidata/api_client/models/file_asset_input_file.py +182 -0
- rapidata/api_client/models/form_file_wrapper.py +120 -0
- rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
- rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
- rapidata/api_client/models/get_participant_by_id_result.py +6 -26
- rapidata/api_client/models/get_standing_by_id_result.py +113 -0
- rapidata/api_client/models/local_file_wrapper.py +120 -0
- rapidata/api_client/models/multi_asset_input.py +110 -0
- rapidata/api_client/models/multi_asset_input1.py +110 -0
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_input2.py +110 -0
- rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
- rapidata/api_client/models/not_user_filter_model.py +3 -3
- rapidata/api_client/models/or_user_filter_model.py +3 -3
- rapidata/api_client/models/participant_by_benchmark.py +102 -0
- rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
- rapidata/api_client/models/participant_status.py +1 -4
- rapidata/api_client/models/potential_validation_rapid.py +103 -0
- rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
- rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
- rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
- rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
- rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
- rapidata/api_client/models/prompt_metadata_input.py +5 -3
- rapidata/api_client/models/proxy_file_wrapper.py +114 -0
- rapidata/api_client/models/query_validation_model.py +97 -0
- rapidata/api_client/models/standing_by_leaderboard.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
- rapidata/api_client/models/standing_status.py +38 -0
- rapidata/api_client/models/stream_file_wrapper.py +116 -0
- rapidata/api_client/models/submit_prompt_model.py +89 -0
- rapidata/api_client/models/text_asset_input.py +100 -0
- rapidata/api_client/models/transcription_metadata_input.py +5 -3
- rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
- rapidata/api_client_README.md +62 -16
- rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
- rapidata/rapidata_client/filter/not_filter.py +2 -2
- rapidata/rapidata_client/filter/or_filter.py +2 -2
- rapidata/rapidata_client/metadata/__init__.py +1 -0
- rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
- rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
- rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
- rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
- rapidata/rapidata_client/rapidata_client.py +3 -3
- rapidata/service/openapi_service.py +5 -0
- {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
- {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/RECORD +82 -35
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
- /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
- {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
- {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
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 MultiAssetInput2(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
MultiAssetInput2
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for MultiAssetInput", alias="_t")
|
|
30
|
+
assets: List[PromptAssetMetadataInputAsset]
|
|
31
|
+
identifier: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "assets", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['MultiAssetInput']):
|
|
38
|
+
raise ValueError("must be one of enum values ('MultiAssetInput')")
|
|
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 MultiAssetInput2 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in assets (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.assets:
|
|
85
|
+
for _item_assets in self.assets:
|
|
86
|
+
if _item_assets:
|
|
87
|
+
_items.append(_item_assets.to_dict())
|
|
88
|
+
_dict['assets'] = _items
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of MultiAssetInput2 from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj)
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate({
|
|
101
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiAssetInput',
|
|
102
|
+
"assets": [PromptAssetMetadataInputAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None,
|
|
103
|
+
"identifier": obj.get("identifier")
|
|
104
|
+
})
|
|
105
|
+
return _obj
|
|
106
|
+
|
|
107
|
+
from rapidata.api_client.models.prompt_asset_metadata_input_asset import PromptAssetMetadataInputAsset
|
|
108
|
+
# TODO: Rewrite to not use raise_errors
|
|
109
|
+
MultiAssetInput2.model_rebuild(raise_errors=False)
|
|
110
|
+
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.file_asset_input import FileAssetInput
|
|
21
|
+
from rapidata.api_client.models.text_asset_input import TextAssetInput
|
|
22
|
+
from rapidata.api_client.models.url_asset_input import UrlAssetInput
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
MULTIASSETINPUTASSETSINNER_ONE_OF_SCHEMAS = ["FileAssetInput", "MultiAssetInput", "TextAssetInput", "UrlAssetInput"]
|
|
28
|
+
|
|
29
|
+
class MultiAssetInputAssetsInner(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
MultiAssetInputAssetsInner
|
|
32
|
+
"""
|
|
33
|
+
# data type: FileAssetInput
|
|
34
|
+
oneof_schema_1_validator: Optional[FileAssetInput] = None
|
|
35
|
+
# data type: MultiAssetInput
|
|
36
|
+
oneof_schema_2_validator: Optional[MultiAssetInput] = None
|
|
37
|
+
# data type: TextAssetInput
|
|
38
|
+
oneof_schema_3_validator: Optional[TextAssetInput] = None
|
|
39
|
+
# data type: UrlAssetInput
|
|
40
|
+
oneof_schema_4_validator: Optional[UrlAssetInput] = None
|
|
41
|
+
actual_instance: Optional[Union[FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput]] = None
|
|
42
|
+
one_of_schemas: Set[str] = { "FileAssetInput", "MultiAssetInput", "TextAssetInput", "UrlAssetInput" }
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
59
|
+
super().__init__(actual_instance=args[0])
|
|
60
|
+
else:
|
|
61
|
+
super().__init__(**kwargs)
|
|
62
|
+
|
|
63
|
+
@field_validator('actual_instance')
|
|
64
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
65
|
+
instance = MultiAssetInputAssetsInner.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
match = 0
|
|
68
|
+
# validate data type: FileAssetInput
|
|
69
|
+
if not isinstance(v, FileAssetInput):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput`")
|
|
71
|
+
else:
|
|
72
|
+
match += 1
|
|
73
|
+
# validate data type: MultiAssetInput
|
|
74
|
+
if not isinstance(v, MultiAssetInput):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput`")
|
|
76
|
+
else:
|
|
77
|
+
match += 1
|
|
78
|
+
# validate data type: TextAssetInput
|
|
79
|
+
if not isinstance(v, TextAssetInput):
|
|
80
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
|
|
81
|
+
else:
|
|
82
|
+
match += 1
|
|
83
|
+
# validate data type: UrlAssetInput
|
|
84
|
+
if not isinstance(v, UrlAssetInput):
|
|
85
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UrlAssetInput`")
|
|
86
|
+
else:
|
|
87
|
+
match += 1
|
|
88
|
+
if match > 1:
|
|
89
|
+
# 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))
|
|
91
|
+
elif match == 0:
|
|
92
|
+
# 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))
|
|
94
|
+
else:
|
|
95
|
+
return v
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
99
|
+
return cls.from_json(json.dumps(obj))
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_json(cls, json_str: str) -> Self:
|
|
103
|
+
"""Returns the object represented by the json string"""
|
|
104
|
+
instance = cls.model_construct()
|
|
105
|
+
error_messages = []
|
|
106
|
+
match = 0
|
|
107
|
+
|
|
108
|
+
# deserialize data into FileAssetInput
|
|
109
|
+
try:
|
|
110
|
+
instance.actual_instance = FileAssetInput.from_json(json_str)
|
|
111
|
+
match += 1
|
|
112
|
+
except (ValidationError, ValueError) as e:
|
|
113
|
+
error_messages.append(str(e))
|
|
114
|
+
# deserialize data into MultiAssetInput
|
|
115
|
+
try:
|
|
116
|
+
instance.actual_instance = MultiAssetInput.from_json(json_str)
|
|
117
|
+
match += 1
|
|
118
|
+
except (ValidationError, ValueError) as e:
|
|
119
|
+
error_messages.append(str(e))
|
|
120
|
+
# deserialize data into TextAssetInput
|
|
121
|
+
try:
|
|
122
|
+
instance.actual_instance = TextAssetInput.from_json(json_str)
|
|
123
|
+
match += 1
|
|
124
|
+
except (ValidationError, ValueError) as e:
|
|
125
|
+
error_messages.append(str(e))
|
|
126
|
+
# deserialize data into UrlAssetInput
|
|
127
|
+
try:
|
|
128
|
+
instance.actual_instance = UrlAssetInput.from_json(json_str)
|
|
129
|
+
match += 1
|
|
130
|
+
except (ValidationError, ValueError) as e:
|
|
131
|
+
error_messages.append(str(e))
|
|
132
|
+
|
|
133
|
+
if match > 1:
|
|
134
|
+
# 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))
|
|
136
|
+
elif match == 0:
|
|
137
|
+
# 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))
|
|
139
|
+
else:
|
|
140
|
+
return instance
|
|
141
|
+
|
|
142
|
+
def to_json(self) -> str:
|
|
143
|
+
"""Returns the JSON representation of the actual instance"""
|
|
144
|
+
if self.actual_instance is None:
|
|
145
|
+
return "null"
|
|
146
|
+
|
|
147
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
148
|
+
return self.actual_instance.to_json()
|
|
149
|
+
else:
|
|
150
|
+
return json.dumps(self.actual_instance)
|
|
151
|
+
|
|
152
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput, MultiAssetInput, TextAssetInput, UrlAssetInput]]:
|
|
153
|
+
"""Returns the dict representation of the actual instance"""
|
|
154
|
+
if self.actual_instance is None:
|
|
155
|
+
return None
|
|
156
|
+
|
|
157
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
158
|
+
return self.actual_instance.to_dict()
|
|
159
|
+
else:
|
|
160
|
+
# primitive type
|
|
161
|
+
return self.actual_instance
|
|
162
|
+
|
|
163
|
+
def to_str(self) -> str:
|
|
164
|
+
"""Returns the string representation of the actual instance"""
|
|
165
|
+
return pprint.pformat(self.model_dump())
|
|
166
|
+
|
|
167
|
+
from rapidata.api_client.models.multi_asset_input import MultiAssetInput
|
|
168
|
+
# TODO: Rewrite to not use raise_errors
|
|
169
|
+
MultiAssetInputAssetsInner.model_rebuild(raise_errors=False)
|
|
170
|
+
|
|
@@ -27,7 +27,7 @@ class NotUserFilterModel(BaseModel):
|
|
|
27
27
|
NotUserFilterModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for NotFilter", alias="_t")
|
|
30
|
-
filter:
|
|
30
|
+
filter: AndUserFilterModelFiltersInner
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "filter"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -92,11 +92,11 @@ class NotUserFilterModel(BaseModel):
|
|
|
92
92
|
|
|
93
93
|
_obj = cls.model_validate({
|
|
94
94
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'NotFilter',
|
|
95
|
-
"filter":
|
|
95
|
+
"filter": AndUserFilterModelFiltersInner.from_dict(obj["filter"]) if obj.get("filter") is not None else None
|
|
96
96
|
})
|
|
97
97
|
return _obj
|
|
98
98
|
|
|
99
|
-
from rapidata.api_client.models.
|
|
99
|
+
from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
|
|
100
100
|
# TODO: Rewrite to not use raise_errors
|
|
101
101
|
NotUserFilterModel.model_rebuild(raise_errors=False)
|
|
102
102
|
|
|
@@ -27,7 +27,7 @@ class OrUserFilterModel(BaseModel):
|
|
|
27
27
|
OrUserFilterModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for OrFilter", alias="_t")
|
|
30
|
-
filters: List[
|
|
30
|
+
filters: List[AndUserFilterModelFiltersInner]
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "filters"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -96,11 +96,11 @@ class OrUserFilterModel(BaseModel):
|
|
|
96
96
|
|
|
97
97
|
_obj = cls.model_validate({
|
|
98
98
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'OrFilter',
|
|
99
|
-
"filters": [
|
|
99
|
+
"filters": [AndUserFilterModelFiltersInner.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None
|
|
100
100
|
})
|
|
101
101
|
return _obj
|
|
102
102
|
|
|
103
|
-
from rapidata.api_client.models.
|
|
103
|
+
from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
|
|
104
104
|
# TODO: Rewrite to not use raise_errors
|
|
105
105
|
OrUserFilterModel.model_rebuild(raise_errors=False)
|
|
106
106
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ParticipantByBenchmark(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ParticipantByBenchmark
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: StrictStr
|
|
30
|
+
name: StrictStr
|
|
31
|
+
benchmark_id: StrictStr = Field(alias="benchmarkId")
|
|
32
|
+
dataset_id: StrictStr = Field(alias="datasetId")
|
|
33
|
+
status: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "benchmarkId", "datasetId", "status"]
|
|
35
|
+
|
|
36
|
+
@field_validator('status')
|
|
37
|
+
def status_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['Created', 'Submitted']):
|
|
40
|
+
raise ValueError("must be one of enum values ('Created', 'Submitted')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of ParticipantByBenchmark from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
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 ParticipantByBenchmark 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
|
+
"id": obj.get("id"),
|
|
95
|
+
"name": obj.get("name"),
|
|
96
|
+
"benchmarkId": obj.get("benchmarkId"),
|
|
97
|
+
"datasetId": obj.get("datasetId"),
|
|
98
|
+
"status": obj.get("status")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.participant_by_benchmark import ParticipantByBenchmark
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ParticipantByBenchmarkPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ParticipantByBenchmarkPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[ParticipantByBenchmark]
|
|
34
|
+
total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ParticipantByBenchmarkPagedResult from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
"total_pages",
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.items:
|
|
81
|
+
for _item_items in self.items:
|
|
82
|
+
if _item_items:
|
|
83
|
+
_items.append(_item_items.to_dict())
|
|
84
|
+
_dict['items'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of ParticipantByBenchmarkPagedResult from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"total": obj.get("total"),
|
|
98
|
+
"page": obj.get("page"),
|
|
99
|
+
"pageSize": obj.get("pageSize"),
|
|
100
|
+
"items": [ParticipantByBenchmark.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
101
|
+
"totalPages": obj.get("totalPages")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -27,10 +27,7 @@ class ParticipantStatus(str, Enum):
|
|
|
27
27
|
allowed enum values
|
|
28
28
|
"""
|
|
29
29
|
CREATED = 'Created'
|
|
30
|
-
|
|
31
|
-
RUNNING = 'Running'
|
|
32
|
-
COMPLETED = 'Completed'
|
|
33
|
-
FAILED = 'Failed'
|
|
30
|
+
SUBMITTED = 'Submitted'
|
|
34
31
|
|
|
35
32
|
@classmethod
|
|
36
33
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -0,0 +1,103 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
+
from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
|
|
23
|
+
from rapidata.api_client.models.potential_validation_rapid_truth import PotentialValidationRapidTruth
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PotentialValidationRapid(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PotentialValidationRapid
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
payload: GetValidationRapidsResultPayload
|
|
33
|
+
response_count: StrictInt = Field(alias="responseCount")
|
|
34
|
+
confidence: Union[StrictFloat, StrictInt]
|
|
35
|
+
truth: PotentialValidationRapidTruth
|
|
36
|
+
__properties: ClassVar[List[str]] = ["rapidId", "payload", "responseCount", "confidence", "truth"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of PotentialValidationRapid from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of payload
|
|
78
|
+
if self.payload:
|
|
79
|
+
_dict['payload'] = self.payload.to_dict()
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of truth
|
|
81
|
+
if self.truth:
|
|
82
|
+
_dict['truth'] = self.truth.to_dict()
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of PotentialValidationRapid from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({
|
|
95
|
+
"rapidId": obj.get("rapidId"),
|
|
96
|
+
"payload": GetValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
97
|
+
"responseCount": obj.get("responseCount"),
|
|
98
|
+
"confidence": obj.get("confidence"),
|
|
99
|
+
"truth": PotentialValidationRapidTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|