rapidata 2.13.1__py3-none-any.whl → 2.14.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/api_client/__init__.py +18 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/dataset_api.py +265 -0
- rapidata/api_client/api/rapid_api.py +262 -0
- rapidata/api_client/api/workflow_api.py +298 -1
- rapidata/api_client/models/__init__.py +17 -4
- rapidata/api_client/models/add_campaign_model.py +3 -3
- 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/classification_metadata.py +2 -4
- rapidata/api_client/models/compare_workflow_config.py +17 -2
- rapidata/api_client/models/compare_workflow_config_metadata_value.py +238 -0
- rapidata/api_client/models/compare_workflow_config_model.py +17 -2
- rapidata/api_client/models/compare_workflow_model.py +17 -2
- rapidata/api_client/models/count_metadata.py +1 -3
- rapidata/api_client/models/create_datapoint_from_urls_model.py +26 -4
- rapidata/api_client/models/create_datapoint_from_urls_model_metadata_inner.py +168 -0
- rapidata/api_client/models/create_datapoint_result.py +5 -3
- rapidata/api_client/models/datapoint.py +7 -30
- rapidata/api_client/models/datapoint_asset.py +40 -40
- rapidata/api_client/models/datapoint_metadata_model.py +3 -3
- rapidata/api_client/models/datapoint_model.py +3 -3
- rapidata/api_client/models/early_stopping_referee_model.py +1 -1
- rapidata/api_client/models/get_compare_workflow_results_result.py +3 -3
- rapidata/api_client/models/get_datapoint_by_id_result.py +3 -3
- rapidata/api_client/models/get_failed_datapoints_result.py +95 -0
- rapidata/api_client/models/get_rapid_responses_result.py +112 -0
- rapidata/api_client/models/get_responses_result.py +95 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +10 -4
- rapidata/api_client/models/image_dimension_metadata.py +1 -3
- rapidata/api_client/models/location_metadata.py +2 -4
- rapidata/api_client/models/metadata_visibilities.py +1 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/original_filename_metadata.py +2 -4
- rapidata/api_client/models/prompt_metadata.py +1 -3
- rapidata/api_client/models/scrub_result.py +4 -4
- rapidata/api_client/models/source_url_metadata.py +98 -0
- rapidata/api_client/models/text_metadata.py +3 -5
- rapidata/api_client/models/transcription_metadata.py +1 -3
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +17 -2
- rapidata/api_client_README.md +21 -4
- rapidata/rapidata_client/assets/_media_asset.py +5 -1
- rapidata/rapidata_client/assets/_multi_asset.py +6 -1
- rapidata/rapidata_client/filter/country_filter.py +1 -1
- rapidata/rapidata_client/filter/rapidata_filters.py +10 -2
- rapidata/rapidata_client/order/_rapidata_dataset.py +311 -108
- rapidata/rapidata_client/order/_rapidata_order_builder.py +5 -5
- rapidata/rapidata_client/order/rapidata_order.py +2 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +55 -6
- rapidata/rapidata_client/order/rapidata_results.py +2 -1
- rapidata/rapidata_client/rapidata_client.py +4 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +10 -9
- rapidata/rapidata_client/settings/no_shuffle.py +2 -2
- rapidata/rapidata_client/settings/rapidata_settings.py +8 -0
- rapidata/rapidata_client/validation/rapids/rapids.py +4 -5
- rapidata/rapidata_client/workflow/__init__.py +1 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +51 -0
- rapidata/service/credential_manager.py +7 -0
- rapidata/service/openapi_service.py +6 -6
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/METADATA +1 -1
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/RECORD +63 -56
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/LICENSE +0 -0
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.datapoint import Datapoint
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetFailedDatapointsResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetFailedDatapointsResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
datapoints: List[Datapoint]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["datapoints"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetFailedDatapointsResult from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in datapoints (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.datapoints:
|
|
75
|
+
for _item_datapoints in self.datapoints:
|
|
76
|
+
if _item_datapoints:
|
|
77
|
+
_items.append(_item_datapoints.to_dict())
|
|
78
|
+
_dict['datapoints'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetFailedDatapointsResult from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"datapoints": [Datapoint.from_dict(_item) for _item in obj["datapoints"]] if obj.get("datapoints") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
|
+
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class GetRapidResponsesResult(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GetRapidResponsesResult
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
asset: DatapointAsset
|
|
33
|
+
responses: List[RapidResponse]
|
|
34
|
+
state: StrictStr
|
|
35
|
+
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
36
|
+
|
|
37
|
+
@field_validator('state')
|
|
38
|
+
def state_validate_enum(cls, value):
|
|
39
|
+
"""Validates the enum"""
|
|
40
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Done', 'None']):
|
|
41
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Done', 'None')")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
+
"""Create an instance of GetRapidResponsesResult from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
84
|
+
if self.asset:
|
|
85
|
+
_dict['asset'] = self.asset.to_dict()
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in responses (list)
|
|
87
|
+
_items = []
|
|
88
|
+
if self.responses:
|
|
89
|
+
for _item_responses in self.responses:
|
|
90
|
+
if _item_responses:
|
|
91
|
+
_items.append(_item_responses.to_dict())
|
|
92
|
+
_dict['responses'] = _items
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of GetRapidResponsesResult from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"rapidId": obj.get("rapidId"),
|
|
106
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
107
|
+
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
108
|
+
"state": obj.get("state")
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetResponsesResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetResponsesResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
responses: List[RapidResponse]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["responses"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetResponsesResult from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in responses (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.responses:
|
|
75
|
+
for _item_responses in self.responses:
|
|
76
|
+
if _item_responses:
|
|
77
|
+
_items.append(_item_responses.to_dict())
|
|
78
|
+
_dict['responses'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetResponsesResult from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -19,7 +19,8 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
|
+
from rapidata.api_client.models.query_validation_rapids_result_payload import QueryValidationRapidsResultPayload
|
|
23
24
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
@@ -29,10 +30,11 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
29
30
|
GetSimpleWorkflowResultsResult
|
|
30
31
|
""" # noqa: E501
|
|
31
32
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
-
|
|
33
|
+
payload: QueryValidationRapidsResultPayload
|
|
34
|
+
asset: DatapointAsset
|
|
33
35
|
responses: List[RapidResponse]
|
|
34
36
|
state: StrictStr
|
|
35
|
-
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["rapidId", "payload", "asset", "responses", "state"]
|
|
36
38
|
|
|
37
39
|
@field_validator('state')
|
|
38
40
|
def state_validate_enum(cls, value):
|
|
@@ -80,6 +82,9 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
80
82
|
exclude=excluded_fields,
|
|
81
83
|
exclude_none=True,
|
|
82
84
|
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of payload
|
|
86
|
+
if self.payload:
|
|
87
|
+
_dict['payload'] = self.payload.to_dict()
|
|
83
88
|
# override the default output from pydantic by calling `to_dict()` of asset
|
|
84
89
|
if self.asset:
|
|
85
90
|
_dict['asset'] = self.asset.to_dict()
|
|
@@ -103,7 +108,8 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
103
108
|
|
|
104
109
|
_obj = cls.model_validate({
|
|
105
110
|
"rapidId": obj.get("rapidId"),
|
|
106
|
-
"
|
|
111
|
+
"payload": QueryValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
112
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
107
113
|
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
108
114
|
"state": obj.get("state")
|
|
109
115
|
})
|
|
@@ -29,9 +29,8 @@ class ImageDimensionMetadata(BaseModel):
|
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ImageDimensionMetadata", alias="_t")
|
|
30
30
|
height: Optional[StrictInt] = None
|
|
31
31
|
width: Optional[StrictInt] = None
|
|
32
|
-
identifier: Optional[StrictStr] = None
|
|
33
32
|
visibilities: Optional[StrictStr] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["_t", "height", "width", "
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "height", "width", "visibilities"]
|
|
35
34
|
|
|
36
35
|
@field_validator('t')
|
|
37
36
|
def t_validate_enum(cls, value):
|
|
@@ -94,7 +93,6 @@ class ImageDimensionMetadata(BaseModel):
|
|
|
94
93
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'ImageDimensionMetadata',
|
|
95
94
|
"height": obj.get("height"),
|
|
96
95
|
"width": obj.get("width"),
|
|
97
|
-
"identifier": obj.get("identifier"),
|
|
98
96
|
"visibilities": obj.get("visibilities")
|
|
99
97
|
})
|
|
100
98
|
return _obj
|
|
@@ -30,8 +30,7 @@ class LocationMetadata(BaseModel):
|
|
|
30
30
|
x: Union[StrictFloat, StrictInt]
|
|
31
31
|
y: Union[StrictFloat, StrictInt]
|
|
32
32
|
visibilities: Optional[StrictStr] = None
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["_t", "x", "y", "visibilities", "identifier"]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "x", "y", "visibilities"]
|
|
35
34
|
|
|
36
35
|
@field_validator('t')
|
|
37
36
|
def t_validate_enum(cls, value):
|
|
@@ -94,8 +93,7 @@ class LocationMetadata(BaseModel):
|
|
|
94
93
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'LocationMetadata',
|
|
95
94
|
"x": obj.get("x"),
|
|
96
95
|
"y": obj.get("y"),
|
|
97
|
-
"visibilities": obj.get("visibilities")
|
|
98
|
-
"identifier": obj.get("identifier")
|
|
96
|
+
"visibilities": obj.get("visibilities")
|
|
99
97
|
})
|
|
100
98
|
return _obj
|
|
101
99
|
|
|
@@ -28,7 +28,7 @@ class MultiAssetModel(BaseModel):
|
|
|
28
28
|
MultiAssetModel
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
t: StrictStr = Field(description="Discriminator value for MultiAsset", alias="_t")
|
|
31
|
-
assets: List[
|
|
31
|
+
assets: List[DatapointAsset]
|
|
32
32
|
metadata: Dict[str, FileAssetModelMetadataValue]
|
|
33
33
|
identifier: StrictStr
|
|
34
34
|
__properties: ClassVar[List[str]] = ["_t", "assets", "metadata", "identifier"]
|
|
@@ -106,7 +106,7 @@ class MultiAssetModel(BaseModel):
|
|
|
106
106
|
|
|
107
107
|
_obj = cls.model_validate({
|
|
108
108
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiAsset',
|
|
109
|
-
"assets": [
|
|
109
|
+
"assets": [DatapointAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None,
|
|
110
110
|
"metadata": dict(
|
|
111
111
|
(_k, FileAssetModelMetadataValue.from_dict(_v))
|
|
112
112
|
for _k, _v in obj["metadata"].items()
|
|
@@ -117,7 +117,7 @@ class MultiAssetModel(BaseModel):
|
|
|
117
117
|
})
|
|
118
118
|
return _obj
|
|
119
119
|
|
|
120
|
-
from rapidata.api_client.models.
|
|
120
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
121
121
|
# TODO: Rewrite to not use raise_errors
|
|
122
122
|
MultiAssetModel.model_rebuild(raise_errors=False)
|
|
123
123
|
|
|
@@ -29,8 +29,7 @@ class OriginalFilenameMetadata(BaseModel):
|
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for OriginalFilenameMetadata", alias="_t")
|
|
30
30
|
original_filename: StrictStr = Field(alias="originalFilename")
|
|
31
31
|
visibilities: Optional[StrictStr] = None
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "originalFilename", "visibilities", "identifier"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "originalFilename", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,8 +91,7 @@ class OriginalFilenameMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'OriginalFilenameMetadata',
|
|
94
93
|
"originalFilename": obj.get("originalFilename"),
|
|
95
|
-
"visibilities": obj.get("visibilities")
|
|
96
|
-
"identifier": obj.get("identifier")
|
|
94
|
+
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
99
97
|
|
|
@@ -28,9 +28,8 @@ class PromptMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for PromptMetadata", alias="_t")
|
|
30
30
|
prompt: StrictStr
|
|
31
|
-
identifier: Optional[StrictStr] = None
|
|
32
31
|
visibilities: Optional[StrictStr] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "prompt", "
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "prompt", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class PromptMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'PromptMetadata',
|
|
94
93
|
"prompt": obj.get("prompt"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -27,9 +27,9 @@ class ScrubResult(BaseModel):
|
|
|
27
27
|
ScrubResult
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ScrubResult", alias="_t")
|
|
30
|
-
rapid_id: StrictStr = Field(alias="rapidId")
|
|
31
30
|
timestamps: List[StrictInt]
|
|
32
|
-
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "timestamps", "rapidId"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
35
35
|
def t_validate_enum(cls, value):
|
|
@@ -90,8 +90,8 @@ class ScrubResult(BaseModel):
|
|
|
90
90
|
|
|
91
91
|
_obj = cls.model_validate({
|
|
92
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'ScrubResult',
|
|
93
|
-
"
|
|
94
|
-
"
|
|
93
|
+
"timestamps": obj.get("timestamps"),
|
|
94
|
+
"rapidId": obj.get("rapidId")
|
|
95
95
|
})
|
|
96
96
|
return _obj
|
|
97
97
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class SourceUrlMetadata(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SourceUrlMetadata
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for SourceUrlMetadata", alias="_t")
|
|
30
|
+
url: StrictStr
|
|
31
|
+
visibilities: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "url", "visibilities"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['SourceUrlMetadata']):
|
|
38
|
+
raise ValueError("must be one of enum values ('SourceUrlMetadata')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of SourceUrlMetadata from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of SourceUrlMetadata from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'SourceUrlMetadata',
|
|
93
|
+
"url": obj.get("url"),
|
|
94
|
+
"visibilities": obj.get("visibilities")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
@@ -28,9 +28,8 @@ class TextMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TextMetadata", alias="_t")
|
|
30
30
|
text: StrictStr
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "text", "identifier", "visibilities"]
|
|
31
|
+
visibilities: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "text", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class TextMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TextMetadata',
|
|
94
93
|
"text": obj.get("text"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -28,9 +28,8 @@ class TranscriptionMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TranscriptionMetadata", alias="_t")
|
|
30
30
|
transcription: StrictStr
|
|
31
|
-
identifier: StrictStr
|
|
32
31
|
visibilities: StrictStr
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "transcription", "
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "transcription", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class TranscriptionMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadata',
|
|
94
93
|
"transcription": obj.get("transcription"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|