rapidata 2.35.3__py3-none-any.whl → 2.36.1__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 +25 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/benchmark_api.py +294 -0
- rapidata/api_client/api/campaign_api.py +268 -0
- rapidata/api_client/api/customer_rapid_api.py +247 -0
- rapidata/api_client/api/leaderboard_api.py +295 -6
- rapidata/api_client/api/pipeline_api.py +0 -873
- rapidata/api_client/api/sample_api.py +299 -0
- rapidata/api_client/api/validation_set_api.py +537 -312
- rapidata/api_client/models/__init__.py +24 -4
- rapidata/api_client/models/add_validation_rapid_model.py +12 -2
- rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
- rapidata/api_client/models/and_filter.py +121 -0
- rapidata/api_client/models/and_filter_filters_inner.py +268 -0
- rapidata/api_client/models/asset_type.py +40 -0
- rapidata/api_client/models/boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result.py +10 -1
- rapidata/api_client/models/campaign_filter.py +98 -0
- rapidata/api_client/models/change_boost_model.py +89 -0
- rapidata/api_client/models/compare_rapid_blueprint.py +5 -3
- rapidata/api_client/models/compare_rapid_blueprint1.py +96 -0
- rapidata/api_client/models/country_filter.py +98 -0
- rapidata/api_client/models/create_leaderboard_model.py +32 -2
- rapidata/api_client/models/demographic_filter.py +100 -0
- rapidata/api_client/models/feature_flag_model.py +4 -4
- rapidata/api_client/models/free_text_payload.py +10 -3
- rapidata/api_client/models/free_text_rapid_blueprint.py +10 -3
- rapidata/api_client/models/get_compare_ab_summary_result.py +4 -2
- rapidata/api_client/models/get_leaderboard_by_id_result.py +29 -2
- rapidata/api_client/models/get_public_responses_result.py +95 -0
- rapidata/api_client/models/get_sample_by_id_result.py +126 -0
- rapidata/api_client/models/language_filter.py +98 -0
- rapidata/api_client/models/leaderboard_query_result.py +29 -2
- rapidata/api_client/models/new_user_filter.py +96 -0
- rapidata/api_client/models/not_filter.py +117 -0
- rapidata/api_client/models/or_filter.py +121 -0
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/public_rapid_response.py +112 -0
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/response_count_filter.py +109 -0
- rapidata/api_client/models/sample_by_identifier.py +126 -0
- rapidata/api_client/models/sample_by_identifier_paged_result.py +105 -0
- rapidata/api_client/models/simple_workflow_config_blueprint.py +37 -23
- rapidata/api_client/models/update_leaderboard_model.py +91 -0
- rapidata/api_client/models/user_score_filter.py +102 -0
- rapidata/api_client/models/user_state.py +38 -0
- rapidata/api_client/models/user_state_filter.py +101 -0
- rapidata/api_client/models/validation_set_model.py +54 -3
- rapidata/api_client_README.md +33 -10
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +26 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +298 -219
- rapidata/rapidata_client/workflow/_compare_workflow.py +7 -2
- rapidata/rapidata_client/workflow/_free_text_workflow.py +9 -2
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/METADATA +1 -1
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/RECORD +58 -32
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/LICENSE +0 -0
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/WHEEL +0 -0
|
@@ -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.sample_by_identifier import SampleByIdentifier
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class SampleByIdentifierPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SampleByIdentifierPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[SampleByIdentifier]
|
|
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 SampleByIdentifierPagedResult 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 SampleByIdentifierPagedResult 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": [SampleByIdentifier.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
|
+
|
|
@@ -19,18 +19,19 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
|
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
20
|
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
21
21
|
from rapidata.api_client.models.bounding_box_rapid_blueprint import BoundingBoxRapidBlueprint
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.compare_rapid_blueprint1 import CompareRapidBlueprint1
|
|
23
23
|
from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBlueprint
|
|
24
24
|
from rapidata.api_client.models.line_rapid_blueprint import LineRapidBlueprint
|
|
25
25
|
from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBlueprint
|
|
26
26
|
from rapidata.api_client.models.named_entity_rapid_blueprint import NamedEntityRapidBlueprint
|
|
27
27
|
from rapidata.api_client.models.polygon_rapid_blueprint import PolygonRapidBlueprint
|
|
28
|
+
from rapidata.api_client.models.scrub_rapid_blueprint import ScrubRapidBlueprint
|
|
28
29
|
from rapidata.api_client.models.transcription_rapid_blueprint import TranscriptionRapidBlueprint
|
|
29
30
|
from pydantic import StrictStr, Field
|
|
30
31
|
from typing import Union, List, Set, Optional, Dict
|
|
31
32
|
from typing_extensions import Literal, Self
|
|
32
33
|
|
|
33
|
-
SIMPLEWORKFLOWCONFIGBLUEPRINT_ONE_OF_SCHEMAS = ["AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "
|
|
34
|
+
SIMPLEWORKFLOWCONFIGBLUEPRINT_ONE_OF_SCHEMAS = ["AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint1", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "ScrubRapidBlueprint", "TranscriptionRapidBlueprint"]
|
|
34
35
|
|
|
35
36
|
class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
36
37
|
"""
|
|
@@ -38,24 +39,26 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
38
39
|
"""
|
|
39
40
|
# data type: TranscriptionRapidBlueprint
|
|
40
41
|
oneof_schema_1_validator: Optional[TranscriptionRapidBlueprint] = None
|
|
42
|
+
# data type: ScrubRapidBlueprint
|
|
43
|
+
oneof_schema_2_validator: Optional[ScrubRapidBlueprint] = None
|
|
41
44
|
# data type: PolygonRapidBlueprint
|
|
42
|
-
|
|
45
|
+
oneof_schema_3_validator: Optional[PolygonRapidBlueprint] = None
|
|
43
46
|
# data type: NamedEntityRapidBlueprint
|
|
44
|
-
|
|
47
|
+
oneof_schema_4_validator: Optional[NamedEntityRapidBlueprint] = None
|
|
45
48
|
# data type: LocateRapidBlueprint
|
|
46
|
-
|
|
49
|
+
oneof_schema_5_validator: Optional[LocateRapidBlueprint] = None
|
|
47
50
|
# data type: LineRapidBlueprint
|
|
48
|
-
|
|
51
|
+
oneof_schema_6_validator: Optional[LineRapidBlueprint] = None
|
|
49
52
|
# data type: FreeTextRapidBlueprint
|
|
50
|
-
|
|
51
|
-
# data type:
|
|
52
|
-
|
|
53
|
+
oneof_schema_7_validator: Optional[FreeTextRapidBlueprint] = None
|
|
54
|
+
# data type: CompareRapidBlueprint1
|
|
55
|
+
oneof_schema_8_validator: Optional[CompareRapidBlueprint1] = None
|
|
53
56
|
# data type: AttachCategoryRapidBlueprint
|
|
54
|
-
|
|
57
|
+
oneof_schema_9_validator: Optional[AttachCategoryRapidBlueprint] = None
|
|
55
58
|
# data type: BoundingBoxRapidBlueprint
|
|
56
|
-
|
|
57
|
-
actual_instance: Optional[Union[AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
58
|
-
one_of_schemas: Set[str] = { "AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "
|
|
59
|
+
oneof_schema_10_validator: Optional[BoundingBoxRapidBlueprint] = None
|
|
60
|
+
actual_instance: Optional[Union[AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint]] = None
|
|
61
|
+
one_of_schemas: Set[str] = { "AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint1", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "ScrubRapidBlueprint", "TranscriptionRapidBlueprint" }
|
|
59
62
|
|
|
60
63
|
model_config = ConfigDict(
|
|
61
64
|
validate_assignment=True,
|
|
@@ -86,6 +89,11 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
86
89
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionRapidBlueprint`")
|
|
87
90
|
else:
|
|
88
91
|
match += 1
|
|
92
|
+
# validate data type: ScrubRapidBlueprint
|
|
93
|
+
if not isinstance(v, ScrubRapidBlueprint):
|
|
94
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubRapidBlueprint`")
|
|
95
|
+
else:
|
|
96
|
+
match += 1
|
|
89
97
|
# validate data type: PolygonRapidBlueprint
|
|
90
98
|
if not isinstance(v, PolygonRapidBlueprint):
|
|
91
99
|
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonRapidBlueprint`")
|
|
@@ -111,9 +119,9 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
111
119
|
error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextRapidBlueprint`")
|
|
112
120
|
else:
|
|
113
121
|
match += 1
|
|
114
|
-
# validate data type:
|
|
115
|
-
if not isinstance(v,
|
|
116
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
122
|
+
# validate data type: CompareRapidBlueprint1
|
|
123
|
+
if not isinstance(v, CompareRapidBlueprint1):
|
|
124
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareRapidBlueprint1`")
|
|
117
125
|
else:
|
|
118
126
|
match += 1
|
|
119
127
|
# validate data type: AttachCategoryRapidBlueprint
|
|
@@ -128,10 +136,10 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
128
136
|
match += 1
|
|
129
137
|
if match > 1:
|
|
130
138
|
# more than 1 match
|
|
131
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
139
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
132
140
|
elif match == 0:
|
|
133
141
|
# no match
|
|
134
|
-
raise ValueError("No match found when setting `actual_instance` in SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
142
|
+
raise ValueError("No match found when setting `actual_instance` in SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
135
143
|
else:
|
|
136
144
|
return v
|
|
137
145
|
|
|
@@ -152,6 +160,12 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
152
160
|
match += 1
|
|
153
161
|
except (ValidationError, ValueError) as e:
|
|
154
162
|
error_messages.append(str(e))
|
|
163
|
+
# deserialize data into ScrubRapidBlueprint
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = ScrubRapidBlueprint.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
155
169
|
# deserialize data into PolygonRapidBlueprint
|
|
156
170
|
try:
|
|
157
171
|
instance.actual_instance = PolygonRapidBlueprint.from_json(json_str)
|
|
@@ -182,9 +196,9 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
182
196
|
match += 1
|
|
183
197
|
except (ValidationError, ValueError) as e:
|
|
184
198
|
error_messages.append(str(e))
|
|
185
|
-
# deserialize data into
|
|
199
|
+
# deserialize data into CompareRapidBlueprint1
|
|
186
200
|
try:
|
|
187
|
-
instance.actual_instance =
|
|
201
|
+
instance.actual_instance = CompareRapidBlueprint1.from_json(json_str)
|
|
188
202
|
match += 1
|
|
189
203
|
except (ValidationError, ValueError) as e:
|
|
190
204
|
error_messages.append(str(e))
|
|
@@ -203,10 +217,10 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
203
217
|
|
|
204
218
|
if match > 1:
|
|
205
219
|
# more than 1 match
|
|
206
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
220
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
207
221
|
elif match == 0:
|
|
208
222
|
# no match
|
|
209
|
-
raise ValueError("No match found when deserializing the JSON string into SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
223
|
+
raise ValueError("No match found when deserializing the JSON string into SimpleWorkflowConfigBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
210
224
|
else:
|
|
211
225
|
return instance
|
|
212
226
|
|
|
@@ -220,7 +234,7 @@ class SimpleWorkflowConfigBlueprint(BaseModel):
|
|
|
220
234
|
else:
|
|
221
235
|
return json.dumps(self.actual_instance)
|
|
222
236
|
|
|
223
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint,
|
|
237
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint1, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, ScrubRapidBlueprint, TranscriptionRapidBlueprint]]:
|
|
224
238
|
"""Returns the dict representation of the actual instance"""
|
|
225
239
|
if self.actual_instance is None:
|
|
226
240
|
return None
|
|
@@ -0,0 +1,91 @@
|
|
|
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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UpdateLeaderboardModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model used to update a leaderboard.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: Optional[StrictStr] = None
|
|
30
|
+
response_budget: Optional[StrictInt] = Field(default=None, alias="responseBudget")
|
|
31
|
+
min_responses: Optional[StrictInt] = Field(default=None, alias="minResponses")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["name", "responseBudget", "minResponses"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of UpdateLeaderboardModel from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of UpdateLeaderboardModel from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"name": obj.get("name"),
|
|
86
|
+
"responseBudget": obj.get("responseBudget"),
|
|
87
|
+
"minResponses": obj.get("minResponses")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -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, StrictFloat, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UserScoreFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
UserScoreFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for UserScoreFilter", alias="_t")
|
|
30
|
+
lowerbound: Union[StrictFloat, StrictInt]
|
|
31
|
+
upperbound: Union[StrictFloat, StrictInt]
|
|
32
|
+
dimension: StrictStr
|
|
33
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["_t", "lowerbound", "upperbound", "dimension", "executionOrder"]
|
|
35
|
+
|
|
36
|
+
@field_validator('t')
|
|
37
|
+
def t_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['UserScoreFilter']):
|
|
40
|
+
raise ValueError("must be one of enum values ('UserScoreFilter')")
|
|
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 UserScoreFilter 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 UserScoreFilter 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 'UserScoreFilter',
|
|
95
|
+
"lowerbound": obj.get("lowerbound"),
|
|
96
|
+
"upperbound": obj.get("upperbound"),
|
|
97
|
+
"dimension": obj.get("dimension"),
|
|
98
|
+
"executionOrder": obj.get("executionOrder")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class UserState(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
UserState
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
TRAINING = 'Training'
|
|
30
|
+
BLACKLIST = 'Blacklist'
|
|
31
|
+
ACTIVE = 'Active'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of UserState from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.user_state import UserState
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UserStateFilter(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
UserStateFilter
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for UserStateFilter", alias="_t")
|
|
31
|
+
states: List[UserState]
|
|
32
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "states", "executionOrder"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['UserStateFilter']):
|
|
39
|
+
raise ValueError("must be one of enum values ('UserStateFilter')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of UserStateFilter from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
"execution_order",
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of UserStateFilter 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
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'UserStateFilter',
|
|
96
|
+
"states": obj.get("states"),
|
|
97
|
+
"executionOrder": obj.get("executionOrder")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -18,8 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -29,10 +29,43 @@ class ValidationSetModel(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
id: StrictStr
|
|
31
31
|
name: StrictStr
|
|
32
|
+
asset_type: Optional[StrictStr] = Field(default=None, alias="assetType")
|
|
33
|
+
modality: Optional[StrictStr] = None
|
|
34
|
+
prompt_type: Optional[StrictStr] = Field(default=None, alias="promptType")
|
|
32
35
|
owner_id: StrictStr = Field(alias="ownerId")
|
|
33
36
|
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
34
37
|
created_at: datetime = Field(alias="createdAt")
|
|
35
|
-
__properties: ClassVar[List[str]] = ["id", "name", "ownerId", "ownerMail", "createdAt"]
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "name", "assetType", "modality", "promptType", "ownerId", "ownerMail", "createdAt"]
|
|
39
|
+
|
|
40
|
+
@field_validator('asset_type')
|
|
41
|
+
def asset_type_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if value not in set(['None', 'Image', 'Video', 'Audio', 'Text']):
|
|
47
|
+
raise ValueError("must be one of enum values ('None', 'Image', 'Video', 'Audio', 'Text')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('modality')
|
|
51
|
+
def modality_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if value not in set(['None', 'BoundingBox', 'Classify', 'Compare', 'FreeText', 'Line', 'Locate', 'NamedEntity', 'Polygon', 'Scrub', 'Transcription']):
|
|
57
|
+
raise ValueError("must be one of enum values ('None', 'BoundingBox', 'Classify', 'Compare', 'FreeText', 'Line', 'Locate', 'NamedEntity', 'Polygon', 'Scrub', 'Transcription')")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
@field_validator('prompt_type')
|
|
61
|
+
def prompt_type_validate_enum(cls, value):
|
|
62
|
+
"""Validates the enum"""
|
|
63
|
+
if value is None:
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
if value not in set(['None', 'Text', 'Asset']):
|
|
67
|
+
raise ValueError("must be one of enum values ('None', 'Text', 'Asset')")
|
|
68
|
+
return value
|
|
36
69
|
|
|
37
70
|
model_config = ConfigDict(
|
|
38
71
|
populate_by_name=True,
|
|
@@ -73,6 +106,21 @@ class ValidationSetModel(BaseModel):
|
|
|
73
106
|
exclude=excluded_fields,
|
|
74
107
|
exclude_none=True,
|
|
75
108
|
)
|
|
109
|
+
# set to None if asset_type (nullable) is None
|
|
110
|
+
# and model_fields_set contains the field
|
|
111
|
+
if self.asset_type is None and "asset_type" in self.model_fields_set:
|
|
112
|
+
_dict['assetType'] = None
|
|
113
|
+
|
|
114
|
+
# set to None if modality (nullable) is None
|
|
115
|
+
# and model_fields_set contains the field
|
|
116
|
+
if self.modality is None and "modality" in self.model_fields_set:
|
|
117
|
+
_dict['modality'] = None
|
|
118
|
+
|
|
119
|
+
# set to None if prompt_type (nullable) is None
|
|
120
|
+
# and model_fields_set contains the field
|
|
121
|
+
if self.prompt_type is None and "prompt_type" in self.model_fields_set:
|
|
122
|
+
_dict['promptType'] = None
|
|
123
|
+
|
|
76
124
|
return _dict
|
|
77
125
|
|
|
78
126
|
@classmethod
|
|
@@ -87,6 +135,9 @@ class ValidationSetModel(BaseModel):
|
|
|
87
135
|
_obj = cls.model_validate({
|
|
88
136
|
"id": obj.get("id"),
|
|
89
137
|
"name": obj.get("name"),
|
|
138
|
+
"assetType": obj.get("assetType"),
|
|
139
|
+
"modality": obj.get("modality"),
|
|
140
|
+
"promptType": obj.get("promptType"),
|
|
90
141
|
"ownerId": obj.get("ownerId"),
|
|
91
142
|
"ownerMail": obj.get("ownerMail"),
|
|
92
143
|
"createdAt": obj.get("createdAt")
|