rapidata 2.15.0__py3-none-any.whl → 2.16.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/api_client/__init__.py +17 -7
- rapidata/api_client/api/__init__.py +2 -1
- rapidata/api_client/api/campaign_api.py +554 -30
- rapidata/api_client/api/client_api.py +292 -20
- rapidata/api_client/api/coco_api.py +594 -8
- rapidata/api_client/api/compare_workflow_api.py +23 -23
- rapidata/api_client/api/datapoint_api.py +548 -26
- rapidata/api_client/api/dataset_api.py +2198 -186
- rapidata/api_client/api/feedback_api.py +306 -0
- rapidata/api_client/api/identity_api.py +1143 -78
- rapidata/api_client/api/newsletter_api.py +299 -11
- rapidata/api_client/api/order_api.py +5358 -556
- rapidata/api_client/api/pipeline_api.py +263 -524
- rapidata/api_client/api/rapid_api.py +1930 -254
- rapidata/api_client/api/simple_workflow_api.py +23 -23
- rapidata/api_client/api/validation_set_api.py +5259 -0
- rapidata/api_client/api/workflow_api.py +929 -134
- rapidata/api_client/models/__init__.py +15 -6
- rapidata/api_client/models/ab_test_selection_a_inner.py +24 -10
- rapidata/api_client/models/add_user_response_result.py +106 -0
- rapidata/api_client/models/add_user_response_result_validation_truth.py +258 -0
- rapidata/api_client/models/add_validation_rapid_model.py +3 -3
- rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
- rapidata/api_client/models/are_rapids_active_result.py +87 -0
- rapidata/api_client/models/compare_workflow_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_files_model.py +102 -0
- rapidata/api_client/models/create_datapoint_from_files_model_metadata_inner.py +168 -0
- rapidata/api_client/models/create_datapoint_from_text_sources_model.py +109 -0
- rapidata/api_client/models/create_datapoint_from_urls_model.py +4 -4
- rapidata/api_client/models/create_datapoints_from_s3_bucket_model.py +124 -0
- rapidata/api_client/models/create_rapid_result.py +87 -0
- rapidata/api_client/models/create_validation_set_model.py +87 -0
- rapidata/api_client/models/datapoint_metadata_model.py +3 -3
- rapidata/api_client/models/get_validation_rapids_query.py +123 -0
- rapidata/api_client/models/get_validation_rapids_query_paged_result.py +105 -0
- rapidata/api_client/models/pipeline_id_workflow_artifact_id_put_request.py +140 -0
- rapidata/api_client/models/query_validation_rapids_result.py +3 -3
- rapidata/api_client/models/rapid_issue.py +4 -0
- rapidata/api_client/models/report_model.py +4 -4
- rapidata/api_client/models/shuffling_selection.py +106 -0
- rapidata/api_client/models/update_dataset_name_model.py +87 -0
- rapidata/api_client/models/update_order_name_model.py +87 -0
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +3 -3
- rapidata/api_client/models/user_score_user_filter_model.py +9 -2
- rapidata/api_client_README.md +153 -88
- rapidata/rapidata_client/demographic/demographic_manager.py +1 -1
- rapidata/rapidata_client/filter/user_score_filter.py +4 -1
- rapidata/rapidata_client/order/_rapidata_dataset.py +10 -11
- rapidata/rapidata_client/order/_rapidata_order_builder.py +1 -1
- rapidata/rapidata_client/order/rapidata_order.py +5 -5
- rapidata/rapidata_client/order/rapidata_order_manager.py +1 -1
- rapidata/rapidata_client/order/rapidata_results.py +1 -1
- rapidata/rapidata_client/validation/rapidata_validation_set.py +11 -0
- rapidata/rapidata_client/validation/rapids/rapids.py +3 -5
- rapidata/rapidata_client/validation/validation_set_manager.py +36 -21
- rapidata/rapidata_client/workflow/_ranking_workflow.py +2 -2
- {rapidata-2.15.0.dist-info → rapidata-2.16.0.dist-info}/METADATA +1 -1
- {rapidata-2.15.0.dist-info → rapidata-2.16.0.dist-info}/RECORD +60 -43
- {rapidata-2.15.0.dist-info → rapidata-2.16.0.dist-info}/LICENSE +0 -0
- {rapidata-2.15.0.dist-info → rapidata-2.16.0.dist-info}/WHEEL +0 -0
|
@@ -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 CreateRapidResult(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CreateRapidResult
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["rapidId"]
|
|
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 CreateRapidResult 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 CreateRapidResult 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
|
+
"rapidId": obj.get("rapidId")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -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 CreateValidationSetModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The body request for creating a new validation set.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr = Field(description="The name of the validation set.")
|
|
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 CreateValidationSetModel 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 CreateValidationSetModel 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
|
+
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ class DatapointMetadataModel(BaseModel):
|
|
|
28
28
|
The model for creating a datapoint.
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
dataset_id: StrictStr = Field(description="The id of the dataset to create the datapoint in.", alias="datasetId")
|
|
31
|
-
metadata: List[
|
|
31
|
+
metadata: List[CreateDatapointFromFilesModelMetadataInner] = Field(description="The metadata of the datapoint.")
|
|
32
32
|
sort_index: Optional[StrictInt] = Field(default=None, description="The index will be used to keep the datapoints in order. Useful if upload is parallelized", alias="sortIndex")
|
|
33
33
|
__properties: ClassVar[List[str]] = ["datasetId", "metadata", "sortIndex"]
|
|
34
34
|
|
|
@@ -96,7 +96,7 @@ class DatapointMetadataModel(BaseModel):
|
|
|
96
96
|
|
|
97
97
|
_obj = cls.model_validate({
|
|
98
98
|
"datasetId": obj.get("datasetId"),
|
|
99
|
-
"metadata": [
|
|
99
|
+
"metadata": [CreateDatapointFromFilesModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
100
100
|
"sortIndex": obj.get("sortIndex")
|
|
101
101
|
})
|
|
102
102
|
return _obj
|
|
@@ -0,0 +1,123 @@
|
|
|
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 rapidata.api_client.models.page_info import PageInfo
|
|
23
|
+
from rapidata.api_client.models.root_filter import RootFilter
|
|
24
|
+
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetValidationRapidsQuery(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
GetValidationRapidsQuery
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
t: StrictStr = Field(description="Discriminator value for GetValidationRapidsQuery", alias="_t")
|
|
33
|
+
page_info: Optional[PageInfo] = Field(default=None, alias="pageInfo")
|
|
34
|
+
root_filter: Optional[RootFilter] = Field(default=None, alias="rootFilter")
|
|
35
|
+
sort_criteria: Optional[List[SortCriterion]] = Field(default=None, alias="sortCriteria")
|
|
36
|
+
validation_set_id: StrictStr = Field(alias="validationSetId")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["_t", "pageInfo", "rootFilter", "sortCriteria", "validationSetId"]
|
|
38
|
+
|
|
39
|
+
@field_validator('t')
|
|
40
|
+
def t_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value not in set(['GetValidationRapidsQuery']):
|
|
43
|
+
raise ValueError("must be one of enum values ('GetValidationRapidsQuery')")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of GetValidationRapidsQuery from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of page_info
|
|
86
|
+
if self.page_info:
|
|
87
|
+
_dict['pageInfo'] = self.page_info.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of root_filter
|
|
89
|
+
if self.root_filter:
|
|
90
|
+
_dict['rootFilter'] = self.root_filter.to_dict()
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.sort_criteria:
|
|
94
|
+
for _item_sort_criteria in self.sort_criteria:
|
|
95
|
+
if _item_sort_criteria:
|
|
96
|
+
_items.append(_item_sort_criteria.to_dict())
|
|
97
|
+
_dict['sortCriteria'] = _items
|
|
98
|
+
# set to None if sort_criteria (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
|
|
101
|
+
_dict['sortCriteria'] = None
|
|
102
|
+
|
|
103
|
+
return _dict
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
107
|
+
"""Create an instance of GetValidationRapidsQuery from a dict"""
|
|
108
|
+
if obj is None:
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
if not isinstance(obj, dict):
|
|
112
|
+
return cls.model_validate(obj)
|
|
113
|
+
|
|
114
|
+
_obj = cls.model_validate({
|
|
115
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'GetValidationRapidsQuery',
|
|
116
|
+
"pageInfo": PageInfo.from_dict(obj["pageInfo"]) if obj.get("pageInfo") is not None else None,
|
|
117
|
+
"rootFilter": RootFilter.from_dict(obj["rootFilter"]) if obj.get("rootFilter") is not None else None,
|
|
118
|
+
"sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None,
|
|
119
|
+
"validationSetId": obj.get("validationSetId")
|
|
120
|
+
})
|
|
121
|
+
return _obj
|
|
122
|
+
|
|
123
|
+
|
|
@@ -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.get_validation_rapids_query import GetValidationRapidsQuery
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetValidationRapidsQueryPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetValidationRapidsQueryPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[GetValidationRapidsQuery]
|
|
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 GetValidationRapidsQueryPagedResult 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 GetValidationRapidsQueryPagedResult 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": [GetValidationRapidsQuery.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,140 @@
|
|
|
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.compare_workflow_config_model import CompareWorkflowConfigModel
|
|
21
|
+
from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
PIPELINEIDWORKFLOWARTIFACTIDPUTREQUEST_ONE_OF_SCHEMAS = ["CompareWorkflowConfigModel", "SimpleWorkflowConfigModel"]
|
|
27
|
+
|
|
28
|
+
class PipelineIdWorkflowArtifactIdPutRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The base configuration for a workflow.
|
|
31
|
+
"""
|
|
32
|
+
# data type: CompareWorkflowConfigModel
|
|
33
|
+
oneof_schema_1_validator: Optional[CompareWorkflowConfigModel] = None
|
|
34
|
+
# data type: SimpleWorkflowConfigModel
|
|
35
|
+
oneof_schema_2_validator: Optional[SimpleWorkflowConfigModel] = None
|
|
36
|
+
actual_instance: Optional[Union[CompareWorkflowConfigModel, SimpleWorkflowConfigModel]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "CompareWorkflowConfigModel", "SimpleWorkflowConfigModel" }
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
49
|
+
if args:
|
|
50
|
+
if len(args) > 1:
|
|
51
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
52
|
+
if kwargs:
|
|
53
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
54
|
+
super().__init__(actual_instance=args[0])
|
|
55
|
+
else:
|
|
56
|
+
super().__init__(**kwargs)
|
|
57
|
+
|
|
58
|
+
@field_validator('actual_instance')
|
|
59
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
60
|
+
instance = PipelineIdWorkflowArtifactIdPutRequest.model_construct()
|
|
61
|
+
error_messages = []
|
|
62
|
+
match = 0
|
|
63
|
+
# validate data type: CompareWorkflowConfigModel
|
|
64
|
+
if not isinstance(v, CompareWorkflowConfigModel):
|
|
65
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowConfigModel`")
|
|
66
|
+
else:
|
|
67
|
+
match += 1
|
|
68
|
+
# validate data type: SimpleWorkflowConfigModel
|
|
69
|
+
if not isinstance(v, SimpleWorkflowConfigModel):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowConfigModel`")
|
|
71
|
+
else:
|
|
72
|
+
match += 1
|
|
73
|
+
if match > 1:
|
|
74
|
+
# more than 1 match
|
|
75
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
76
|
+
elif match == 0:
|
|
77
|
+
# no match
|
|
78
|
+
raise ValueError("No match found when setting `actual_instance` in PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
79
|
+
else:
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
84
|
+
return cls.from_json(json.dumps(obj))
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_json(cls, json_str: str) -> Self:
|
|
88
|
+
"""Returns the object represented by the json string"""
|
|
89
|
+
instance = cls.model_construct()
|
|
90
|
+
error_messages = []
|
|
91
|
+
match = 0
|
|
92
|
+
|
|
93
|
+
# deserialize data into CompareWorkflowConfigModel
|
|
94
|
+
try:
|
|
95
|
+
instance.actual_instance = CompareWorkflowConfigModel.from_json(json_str)
|
|
96
|
+
match += 1
|
|
97
|
+
except (ValidationError, ValueError) as e:
|
|
98
|
+
error_messages.append(str(e))
|
|
99
|
+
# deserialize data into SimpleWorkflowConfigModel
|
|
100
|
+
try:
|
|
101
|
+
instance.actual_instance = SimpleWorkflowConfigModel.from_json(json_str)
|
|
102
|
+
match += 1
|
|
103
|
+
except (ValidationError, ValueError) as e:
|
|
104
|
+
error_messages.append(str(e))
|
|
105
|
+
|
|
106
|
+
if match > 1:
|
|
107
|
+
# more than 1 match
|
|
108
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
109
|
+
elif match == 0:
|
|
110
|
+
# no match
|
|
111
|
+
raise ValueError("No match found when deserializing the JSON string into PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
112
|
+
else:
|
|
113
|
+
return instance
|
|
114
|
+
|
|
115
|
+
def to_json(self) -> str:
|
|
116
|
+
"""Returns the JSON representation of the actual instance"""
|
|
117
|
+
if self.actual_instance is None:
|
|
118
|
+
return "null"
|
|
119
|
+
|
|
120
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
121
|
+
return self.actual_instance.to_json()
|
|
122
|
+
else:
|
|
123
|
+
return json.dumps(self.actual_instance)
|
|
124
|
+
|
|
125
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowConfigModel, SimpleWorkflowConfigModel]]:
|
|
126
|
+
"""Returns the dict representation of the actual instance"""
|
|
127
|
+
if self.actual_instance is None:
|
|
128
|
+
return None
|
|
129
|
+
|
|
130
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
131
|
+
return self.actual_instance.to_dict()
|
|
132
|
+
else:
|
|
133
|
+
# primitive type
|
|
134
|
+
return self.actual_instance
|
|
135
|
+
|
|
136
|
+
def to_str(self) -> str:
|
|
137
|
+
"""Returns the string representation of the actual instance"""
|
|
138
|
+
return pprint.pformat(self.model_dump())
|
|
139
|
+
|
|
140
|
+
|
|
@@ -19,10 +19,10 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.add_user_response_result_validation_truth import AddUserResponseResultValidationTruth
|
|
22
23
|
from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
23
24
|
from rapidata.api_client.models.query_validation_rapids_result_asset import QueryValidationRapidsResultAsset
|
|
24
25
|
from rapidata.api_client.models.query_validation_rapids_result_payload import QueryValidationRapidsResultPayload
|
|
25
|
-
from rapidata.api_client.models.query_validation_rapids_result_truth import QueryValidationRapidsResultTruth
|
|
26
26
|
from typing import Optional, Set
|
|
27
27
|
from typing_extensions import Self
|
|
28
28
|
|
|
@@ -33,7 +33,7 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
33
33
|
id: StrictStr
|
|
34
34
|
type: StrictStr
|
|
35
35
|
asset: Optional[QueryValidationRapidsResultAsset] = None
|
|
36
|
-
truth: Optional[
|
|
36
|
+
truth: Optional[AddUserResponseResultValidationTruth] = None
|
|
37
37
|
payload: QueryValidationRapidsResultPayload
|
|
38
38
|
metadata: Dict[str, FileAssetModelMetadataValue]
|
|
39
39
|
correct_validation_count: StrictInt = Field(alias="correctValidationCount")
|
|
@@ -126,7 +126,7 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
126
126
|
"id": obj.get("id"),
|
|
127
127
|
"type": obj.get("type"),
|
|
128
128
|
"asset": QueryValidationRapidsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
129
|
-
"truth":
|
|
129
|
+
"truth": AddUserResponseResultValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
130
130
|
"payload": QueryValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
131
131
|
"metadata": dict(
|
|
132
132
|
(_k, FileAssetModelMetadataValue.from_dict(_v))
|
|
@@ -32,6 +32,10 @@ class RapidIssue(str, Enum):
|
|
|
32
32
|
INAPPROPRIATE = 'Inappropriate'
|
|
33
33
|
NOCORRECTOPTION = 'NoCorrectOption'
|
|
34
34
|
WRONGLANGUAGE = 'WrongLanguage'
|
|
35
|
+
DONOTUNDERSTAND = 'DoNotUnderstand'
|
|
36
|
+
DONOTCARE = 'DoNotCare'
|
|
37
|
+
NOTSEEOPTIONSORMEDIADIDNTLOAD = 'NotSeeOptionsOrMediaDidntLoad'
|
|
38
|
+
MYANSWERISCORRECT = 'MyAnswerIsCorrect'
|
|
35
39
|
|
|
36
40
|
@classmethod
|
|
37
41
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -26,17 +26,17 @@ class ReportModel(BaseModel):
|
|
|
26
26
|
"""
|
|
27
27
|
The model for reporting an issue with a rapid.
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
rapid_id: StrictStr = Field(description="The rapid an issue was encountered with", alias="rapidId")
|
|
29
|
+
rapid_id: Optional[StrictStr] = Field(default=None, description="The rapid an issue was encountered with.", alias="rapidId")
|
|
30
30
|
issue: StrictStr
|
|
31
31
|
message: Optional[StrictStr] = Field(default=None, description="An optional message typed by the user.")
|
|
32
|
-
dump: Optional[StrictStr] = Field(default=None, description="A dump, that the frontend defines and can read again")
|
|
32
|
+
dump: Optional[StrictStr] = Field(default=None, description="A dump, that the frontend defines and can read again.")
|
|
33
33
|
__properties: ClassVar[List[str]] = ["rapidId", "issue", "message", "dump"]
|
|
34
34
|
|
|
35
35
|
@field_validator('issue')
|
|
36
36
|
def issue_validate_enum(cls, value):
|
|
37
37
|
"""Validates the enum"""
|
|
38
|
-
if value not in set(['Other', 'CannotSubmit', 'NoAsset', 'Inappropriate', 'NoCorrectOption', 'WrongLanguage']):
|
|
39
|
-
raise ValueError("must be one of enum values ('Other', 'CannotSubmit', 'NoAsset', 'Inappropriate', 'NoCorrectOption', 'WrongLanguage')")
|
|
38
|
+
if value not in set(['Other', 'CannotSubmit', 'NoAsset', 'Inappropriate', 'NoCorrectOption', 'WrongLanguage', 'DoNotUnderstand', 'DoNotCare', 'NotSeeOptionsOrMediaDidntLoad', 'MyAnswerIsCorrect']):
|
|
39
|
+
raise ValueError("must be one of enum values ('Other', 'CannotSubmit', 'NoAsset', 'Inappropriate', 'NoCorrectOption', 'WrongLanguage', 'DoNotUnderstand', 'DoNotCare', 'NotSeeOptionsOrMediaDidntLoad', 'MyAnswerIsCorrect')")
|
|
40
40
|
return value
|
|
41
41
|
|
|
42
42
|
model_config = ConfigDict(
|