rapidata 2.32.0__py3-none-any.whl → 2.33.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 +6 -0
- rapidata/api_client/api/benchmark_api.py +194 -200
- rapidata/api_client/api/order_api.py +68 -6
- rapidata/api_client/api/participant_api.py +945 -130
- rapidata/api_client/api/validation_set_api.py +1106 -253
- rapidata/api_client/models/__init__.py +6 -0
- rapidata/api_client/models/benchmark_query_result.py +4 -2
- rapidata/api_client/models/preview_order_model.py +87 -0
- rapidata/api_client/models/prompt_by_benchmark_result.py +4 -2
- rapidata/api_client/models/sample_by_participant.py +120 -0
- rapidata/api_client/models/sample_by_participant_paged_result.py +105 -0
- rapidata/api_client/models/submit_order_model.py +87 -0
- rapidata/api_client/models/submit_prompt_model.py +9 -2
- rapidata/api_client/models/update_participant_name_model.py +87 -0
- rapidata/api_client/models/update_should_alert_model.py +87 -0
- rapidata/api_client_README.md +13 -1
- rapidata/rapidata_client/validation/rapidata_validation_set.py +17 -1
- {rapidata-2.32.0.dist-info → rapidata-2.33.0.dist-info}/METADATA +1 -1
- {rapidata-2.32.0.dist-info → rapidata-2.33.0.dist-info}/RECORD +22 -16
- {rapidata-2.32.0.dist-info → rapidata-2.33.0.dist-info}/LICENSE +0 -0
- {rapidata-2.32.0.dist-info → rapidata-2.33.0.dist-info}/WHEEL +0 -0
|
@@ -270,6 +270,7 @@ from rapidata.api_client.models.potential_validation_rapid_paged_result import P
|
|
|
270
270
|
from rapidata.api_client.models.potential_validation_rapid_truth import PotentialValidationRapidTruth
|
|
271
271
|
from rapidata.api_client.models.preliminary_download_model import PreliminaryDownloadModel
|
|
272
272
|
from rapidata.api_client.models.preliminary_download_result import PreliminaryDownloadResult
|
|
273
|
+
from rapidata.api_client.models.preview_order_model import PreviewOrderModel
|
|
273
274
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
274
275
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
275
276
|
from rapidata.api_client.models.probabilistic_attach_category_referee_info import ProbabilisticAttachCategoryRefereeInfo
|
|
@@ -305,6 +306,8 @@ from rapidata.api_client.models.root_filter import RootFilter
|
|
|
305
306
|
from rapidata.api_client.models.run_status import RunStatus
|
|
306
307
|
from rapidata.api_client.models.runs_by_leaderboard_result import RunsByLeaderboardResult
|
|
307
308
|
from rapidata.api_client.models.runs_by_leaderboard_result_paged_result import RunsByLeaderboardResultPagedResult
|
|
309
|
+
from rapidata.api_client.models.sample_by_participant import SampleByParticipant
|
|
310
|
+
from rapidata.api_client.models.sample_by_participant_paged_result import SampleByParticipantPagedResult
|
|
308
311
|
from rapidata.api_client.models.scrub_payload import ScrubPayload
|
|
309
312
|
from rapidata.api_client.models.scrub_range import ScrubRange
|
|
310
313
|
from rapidata.api_client.models.scrub_rapid_blueprint import ScrubRapidBlueprint
|
|
@@ -335,6 +338,7 @@ from rapidata.api_client.models.streams_metadata import StreamsMetadata
|
|
|
335
338
|
from rapidata.api_client.models.streams_metadata_model import StreamsMetadataModel
|
|
336
339
|
from rapidata.api_client.models.submit_coco_model import SubmitCocoModel
|
|
337
340
|
from rapidata.api_client.models.submit_coco_result import SubmitCocoResult
|
|
341
|
+
from rapidata.api_client.models.submit_order_model import SubmitOrderModel
|
|
338
342
|
from rapidata.api_client.models.submit_participant_result import SubmitParticipantResult
|
|
339
343
|
from rapidata.api_client.models.submit_prompt_model import SubmitPromptModel
|
|
340
344
|
from rapidata.api_client.models.submit_prompt_model_prompt_asset import SubmitPromptModelPromptAsset
|
|
@@ -360,6 +364,8 @@ from rapidata.api_client.models.update_dataset_name_model import UpdateDatasetNa
|
|
|
360
364
|
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
361
365
|
from rapidata.api_client.models.update_leaderboard_name_model import UpdateLeaderboardNameModel
|
|
362
366
|
from rapidata.api_client.models.update_order_name_model import UpdateOrderNameModel
|
|
367
|
+
from rapidata.api_client.models.update_participant_name_model import UpdateParticipantNameModel
|
|
368
|
+
from rapidata.api_client.models.update_should_alert_model import UpdateShouldAlertModel
|
|
363
369
|
from rapidata.api_client.models.update_validation_rapid_model import UpdateValidationRapidModel
|
|
364
370
|
from rapidata.api_client.models.update_validation_rapid_model_truth import UpdateValidationRapidModelTruth
|
|
365
371
|
from rapidata.api_client.models.upload_coco_result import UploadCocoResult
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -29,9 +29,10 @@ class BenchmarkQueryResult(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
id: StrictStr
|
|
31
31
|
name: StrictStr
|
|
32
|
+
is_managed: StrictBool = Field(alias="isManaged")
|
|
32
33
|
created_at: datetime = Field(alias="createdAt")
|
|
33
34
|
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["id", "name", "createdAt", "ownerMail"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "name", "isManaged", "createdAt", "ownerMail"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -86,6 +87,7 @@ class BenchmarkQueryResult(BaseModel):
|
|
|
86
87
|
_obj = cls.model_validate({
|
|
87
88
|
"id": obj.get("id"),
|
|
88
89
|
"name": obj.get("name"),
|
|
90
|
+
"isManaged": obj.get("isManaged"),
|
|
89
91
|
"createdAt": obj.get("createdAt"),
|
|
90
92
|
"ownerMail": obj.get("ownerMail")
|
|
91
93
|
})
|
|
@@ -0,0 +1,87 @@
|
|
|
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, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class PreviewOrderModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for previewing an order.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
ignore_failed_datapoints: Optional[StrictBool] = Field(default=False, description="whether the order should proceed to be submitted even if certain datapoints failed.", alias="ignoreFailedDatapoints")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["ignoreFailedDatapoints"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of PreviewOrderModel from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of PreviewOrderModel from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"ignoreFailedDatapoints": obj.get("ignoreFailedDatapoints") if obj.get("ignoreFailedDatapoints") is not None else False
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -32,7 +32,8 @@ class PromptByBenchmarkResult(BaseModel):
|
|
|
32
32
|
prompt_asset: Optional[GetValidationRapidsResultAsset] = Field(default=None, alias="promptAsset")
|
|
33
33
|
identifier: StrictStr
|
|
34
34
|
created_at: datetime = Field(alias="createdAt")
|
|
35
|
-
|
|
35
|
+
tags: List[StrictStr]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["prompt", "promptAsset", "identifier", "createdAt", "tags"]
|
|
36
37
|
|
|
37
38
|
model_config = ConfigDict(
|
|
38
39
|
populate_by_name=True,
|
|
@@ -101,7 +102,8 @@ class PromptByBenchmarkResult(BaseModel):
|
|
|
101
102
|
"prompt": obj.get("prompt"),
|
|
102
103
|
"promptAsset": GetValidationRapidsResultAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None,
|
|
103
104
|
"identifier": obj.get("identifier"),
|
|
104
|
-
"createdAt": obj.get("createdAt")
|
|
105
|
+
"createdAt": obj.get("createdAt"),
|
|
106
|
+
"tags": obj.get("tags")
|
|
105
107
|
})
|
|
106
108
|
return _obj
|
|
107
109
|
|
|
@@ -0,0 +1,120 @@
|
|
|
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 datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
24
|
+
from rapidata.api_client.models.get_validation_rapids_result_asset import GetValidationRapidsResultAsset
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SampleByParticipant(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SampleByParticipant
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr
|
|
33
|
+
identifier: StrictStr
|
|
34
|
+
asset: DatapointAsset
|
|
35
|
+
prompt: Optional[StrictStr] = None
|
|
36
|
+
prompt_asset: Optional[GetValidationRapidsResultAsset] = Field(default=None, alias="promptAsset")
|
|
37
|
+
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
|
|
38
|
+
owner_id: Optional[StrictStr] = Field(default=None, alias="ownerId")
|
|
39
|
+
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "identifier", "asset", "prompt", "promptAsset", "createdAt", "ownerId", "ownerMail"]
|
|
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 SampleByParticipant 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
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
82
|
+
if self.asset:
|
|
83
|
+
_dict['asset'] = self.asset.to_dict()
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of prompt_asset
|
|
85
|
+
if self.prompt_asset:
|
|
86
|
+
_dict['promptAsset'] = self.prompt_asset.to_dict()
|
|
87
|
+
# set to None if prompt (nullable) is None
|
|
88
|
+
# and model_fields_set contains the field
|
|
89
|
+
if self.prompt is None and "prompt" in self.model_fields_set:
|
|
90
|
+
_dict['prompt'] = None
|
|
91
|
+
|
|
92
|
+
# set to None if prompt_asset (nullable) is None
|
|
93
|
+
# and model_fields_set contains the field
|
|
94
|
+
if self.prompt_asset is None and "prompt_asset" in self.model_fields_set:
|
|
95
|
+
_dict['promptAsset'] = None
|
|
96
|
+
|
|
97
|
+
return _dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
101
|
+
"""Create an instance of SampleByParticipant from a dict"""
|
|
102
|
+
if obj is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
if not isinstance(obj, dict):
|
|
106
|
+
return cls.model_validate(obj)
|
|
107
|
+
|
|
108
|
+
_obj = cls.model_validate({
|
|
109
|
+
"id": obj.get("id"),
|
|
110
|
+
"identifier": obj.get("identifier"),
|
|
111
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
112
|
+
"prompt": obj.get("prompt"),
|
|
113
|
+
"promptAsset": GetValidationRapidsResultAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None,
|
|
114
|
+
"createdAt": obj.get("createdAt"),
|
|
115
|
+
"ownerId": obj.get("ownerId"),
|
|
116
|
+
"ownerMail": obj.get("ownerMail")
|
|
117
|
+
})
|
|
118
|
+
return _obj
|
|
119
|
+
|
|
120
|
+
|
|
@@ -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_participant import SampleByParticipant
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class SampleByParticipantPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SampleByParticipantPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[SampleByParticipant]
|
|
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 SampleByParticipantPagedResult 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 SampleByParticipantPagedResult 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": [SampleByParticipant.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
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
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, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class SubmitOrderModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for submitting an order.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
ignore_failed_datapoints: Optional[StrictBool] = Field(default=False, description="whether the order should proceed to be submitted even if certain datapoints failed.", alias="ignoreFailedDatapoints")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["ignoreFailedDatapoints"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of SubmitOrderModel from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of SubmitOrderModel from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"ignoreFailedDatapoints": obj.get("ignoreFailedDatapoints") if obj.get("ignoreFailedDatapoints") is not None else False
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -30,7 +30,8 @@ class SubmitPromptModel(BaseModel):
|
|
|
30
30
|
identifier: StrictStr = Field(description="An identifier associated to the prompt")
|
|
31
31
|
prompt: Optional[StrictStr] = Field(default=None, description="The prompt")
|
|
32
32
|
prompt_asset: Optional[SubmitPromptModelPromptAsset] = Field(default=None, alias="promptAsset")
|
|
33
|
-
|
|
33
|
+
tags: Optional[List[StrictStr]] = Field(default=None, description="The tags of a given prompt")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["identifier", "prompt", "promptAsset", "tags"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
37
|
populate_by_name=True,
|
|
@@ -84,6 +85,11 @@ class SubmitPromptModel(BaseModel):
|
|
|
84
85
|
if self.prompt_asset is None and "prompt_asset" in self.model_fields_set:
|
|
85
86
|
_dict['promptAsset'] = None
|
|
86
87
|
|
|
88
|
+
# set to None if tags (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.tags is None and "tags" in self.model_fields_set:
|
|
91
|
+
_dict['tags'] = None
|
|
92
|
+
|
|
87
93
|
return _dict
|
|
88
94
|
|
|
89
95
|
@classmethod
|
|
@@ -98,7 +104,8 @@ class SubmitPromptModel(BaseModel):
|
|
|
98
104
|
_obj = cls.model_validate({
|
|
99
105
|
"identifier": obj.get("identifier"),
|
|
100
106
|
"prompt": obj.get("prompt"),
|
|
101
|
-
"promptAsset": SubmitPromptModelPromptAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None
|
|
107
|
+
"promptAsset": SubmitPromptModelPromptAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None,
|
|
108
|
+
"tags": obj.get("tags")
|
|
102
109
|
})
|
|
103
110
|
return _obj
|
|
104
111
|
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UpdateParticipantNameModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model used to update the name of a participant.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr = Field(description="The new name of the participant.")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["name"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of UpdateParticipantNameModel from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of UpdateParticipantNameModel from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"name": obj.get("name")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|