rapidata 2.11.1__py3-none-any.whl → 2.13.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 +0 -33
- rapidata/api_client/__init__.py +17 -39
- rapidata/api_client/api/__init__.py +0 -1
- rapidata/api_client/api/campaign_api.py +13 -13
- rapidata/api_client/api/datapoint_api.py +6 -6
- rapidata/api_client/api/dataset_api.py +574 -16
- rapidata/api_client/api/rapid_api.py +262 -0
- rapidata/api_client/api/validation_api.py +7 -7
- rapidata/api_client/models/__init__.py +17 -38
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/add_campaign_model_user_filters_inner.py +224 -0
- rapidata/api_client/models/campaign_query_result.py +105 -0
- rapidata/api_client/models/campaign_query_result_paged_result.py +105 -0
- rapidata/api_client/models/classification_metadata_model.py +2 -4
- rapidata/api_client/models/compare_workflow_config.py +8 -10
- rapidata/api_client/models/compare_workflow_config_model.py +9 -11
- rapidata/api_client/models/compare_workflow_config_model_pair_maker_config.py +8 -22
- rapidata/api_client/models/compare_workflow_config_pair_maker_config.py +8 -22
- rapidata/api_client/models/compare_workflow_model.py +8 -10
- rapidata/api_client/models/compare_workflow_model1.py +8 -10
- rapidata/api_client/models/compare_workflow_model1_pair_maker_information.py +8 -22
- rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +10 -24
- rapidata/api_client/models/count_metadata_model.py +2 -4
- rapidata/api_client/models/create_datapoint_from_urls_model.py +87 -0
- rapidata/api_client/models/create_datapoint_result.py +97 -0
- rapidata/api_client/models/create_order_model_user_filters_inner.py +23 -9
- rapidata/api_client/models/datapoint_state.py +38 -0
- rapidata/api_client/models/demographic.py +89 -0
- rapidata/api_client/models/demographic_metadata_model.py +18 -9
- rapidata/api_client/models/elo_config.py +91 -0
- rapidata/api_client/models/elo_config_model.py +91 -0
- rapidata/api_client/models/file_asset_model.py +18 -13
- rapidata/api_client/models/file_asset_model_metadata_value.py +266 -0
- rapidata/api_client/models/get_compare_workflow_results_model.py +1 -9
- rapidata/api_client/models/get_compare_workflow_results_result.py +6 -15
- rapidata/api_client/models/get_datapoint_by_id_result.py +114 -0
- rapidata/api_client/models/get_dataset_progress_result.py +93 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +3 -3
- rapidata/api_client/models/image_dimension_metadata_model.py +2 -4
- rapidata/api_client/models/inspect_report_result.py +92 -0
- rapidata/api_client/models/location_metadata_model.py +2 -4
- rapidata/api_client/models/multi_asset_model.py +18 -13
- rapidata/api_client/models/new_user_filter_model.py +94 -0
- rapidata/api_client/models/new_user_filter_model1.py +94 -0
- rapidata/api_client/models/null_asset_model.py +18 -13
- rapidata/api_client/models/online_pair_maker_config_model.py +1 -1
- rapidata/api_client/models/original_filename_metadata_model.py +2 -4
- rapidata/api_client/models/prompt_metadata_input.py +2 -4
- rapidata/api_client/models/prompt_metadata_model.py +2 -4
- rapidata/api_client/models/query_validation_rapids_result.py +14 -9
- rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
- rapidata/api_client/models/report_model.py +11 -4
- rapidata/api_client/models/source_url_metadata_model.py +96 -0
- rapidata/api_client/models/text_asset_model.py +18 -13
- rapidata/api_client/models/text_metadata_model.py +2 -4
- rapidata/api_client/models/transcription_metadata_input.py +2 -4
- rapidata/api_client/models/transcription_metadata_model.py +1 -3
- rapidata/api_client/models/translated_prompt_metadata_model.py +2 -4
- rapidata/api_client/models/upload_from_s3_result.py +87 -0
- rapidata/api_client_README.md +20 -39
- rapidata/rapidata_client/metadata/_base_metadata.py +0 -3
- rapidata/rapidata_client/metadata/_private_text_metadata.py +2 -1
- rapidata/rapidata_client/metadata/_prompt_metadata.py +3 -3
- rapidata/rapidata_client/metadata/_public_text_metadata.py +2 -1
- rapidata/rapidata_client/metadata/_select_words_metadata.py +2 -4
- rapidata/rapidata_client/order/_rapidata_order_builder.py +8 -9
- rapidata/rapidata_client/order/rapidata_order.py +132 -108
- rapidata/rapidata_client/validation/validation_set_manager.py +3 -2
- {rapidata-2.11.1.dist-info → rapidata-2.13.0.dist-info}/METADATA +1 -1
- {rapidata-2.11.1.dist-info → rapidata-2.13.0.dist-info}/RECORD +72 -55
- {rapidata-2.11.1.dist-info → rapidata-2.13.0.dist-info}/LICENSE +0 -0
- {rapidata-2.11.1.dist-info → rapidata-2.13.0.dist-info}/WHEEL +0 -0
|
@@ -17,30 +17,30 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
-
from rapidata.api_client.models.
|
|
21
|
-
from rapidata.api_client.models.
|
|
22
|
-
from rapidata.api_client.models.
|
|
23
|
-
from rapidata.api_client.models.
|
|
20
|
+
from rapidata.api_client.models.file_asset_model import FileAssetModel
|
|
21
|
+
from rapidata.api_client.models.multi_asset_model import MultiAssetModel
|
|
22
|
+
from rapidata.api_client.models.null_asset_model import NullAssetModel
|
|
23
|
+
from rapidata.api_client.models.text_asset_model import TextAssetModel
|
|
24
24
|
from pydantic import StrictStr, Field
|
|
25
25
|
from typing import Union, List, Set, Optional, Dict
|
|
26
26
|
from typing_extensions import Literal, Self
|
|
27
27
|
|
|
28
|
-
QUERYVALIDATIONRAPIDSRESULTASSET_ONE_OF_SCHEMAS = ["
|
|
28
|
+
QUERYVALIDATIONRAPIDSRESULTASSET_ONE_OF_SCHEMAS = ["FileAssetModel", "MultiAssetModel", "NullAssetModel", "TextAssetModel"]
|
|
29
29
|
|
|
30
30
|
class QueryValidationRapidsResultAsset(BaseModel):
|
|
31
31
|
"""
|
|
32
32
|
QueryValidationRapidsResultAsset
|
|
33
33
|
"""
|
|
34
|
-
# data type:
|
|
35
|
-
oneof_schema_1_validator: Optional[
|
|
36
|
-
# data type:
|
|
37
|
-
oneof_schema_2_validator: Optional[
|
|
38
|
-
# data type:
|
|
39
|
-
oneof_schema_3_validator: Optional[
|
|
40
|
-
# data type:
|
|
41
|
-
oneof_schema_4_validator: Optional[
|
|
42
|
-
actual_instance: Optional[Union[
|
|
43
|
-
one_of_schemas: Set[str] = { "
|
|
34
|
+
# data type: FileAssetModel
|
|
35
|
+
oneof_schema_1_validator: Optional[FileAssetModel] = None
|
|
36
|
+
# data type: MultiAssetModel
|
|
37
|
+
oneof_schema_2_validator: Optional[MultiAssetModel] = None
|
|
38
|
+
# data type: NullAssetModel
|
|
39
|
+
oneof_schema_3_validator: Optional[NullAssetModel] = None
|
|
40
|
+
# data type: TextAssetModel
|
|
41
|
+
oneof_schema_4_validator: Optional[TextAssetModel] = None
|
|
42
|
+
actual_instance: Optional[Union[FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel]] = None
|
|
43
|
+
one_of_schemas: Set[str] = { "FileAssetModel", "MultiAssetModel", "NullAssetModel", "TextAssetModel" }
|
|
44
44
|
|
|
45
45
|
model_config = ConfigDict(
|
|
46
46
|
validate_assignment=True,
|
|
@@ -69,32 +69,32 @@ class QueryValidationRapidsResultAsset(BaseModel):
|
|
|
69
69
|
instance = QueryValidationRapidsResultAsset.model_construct()
|
|
70
70
|
error_messages = []
|
|
71
71
|
match = 0
|
|
72
|
-
# validate data type:
|
|
73
|
-
if not isinstance(v,
|
|
74
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
72
|
+
# validate data type: FileAssetModel
|
|
73
|
+
if not isinstance(v, FileAssetModel):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetModel`")
|
|
75
75
|
else:
|
|
76
76
|
match += 1
|
|
77
|
-
# validate data type:
|
|
78
|
-
if not isinstance(v,
|
|
79
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
77
|
+
# validate data type: MultiAssetModel
|
|
78
|
+
if not isinstance(v, MultiAssetModel):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetModel`")
|
|
80
80
|
else:
|
|
81
81
|
match += 1
|
|
82
|
-
# validate data type:
|
|
83
|
-
if not isinstance(v,
|
|
84
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
82
|
+
# validate data type: NullAssetModel
|
|
83
|
+
if not isinstance(v, NullAssetModel):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullAssetModel`")
|
|
85
85
|
else:
|
|
86
86
|
match += 1
|
|
87
|
-
# validate data type:
|
|
88
|
-
if not isinstance(v,
|
|
89
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `
|
|
87
|
+
# validate data type: TextAssetModel
|
|
88
|
+
if not isinstance(v, TextAssetModel):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetModel`")
|
|
90
90
|
else:
|
|
91
91
|
match += 1
|
|
92
92
|
if match > 1:
|
|
93
93
|
# more than 1 match
|
|
94
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas:
|
|
94
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
95
95
|
elif match == 0:
|
|
96
96
|
# no match
|
|
97
|
-
raise ValueError("No match found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas:
|
|
97
|
+
raise ValueError("No match found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
98
98
|
else:
|
|
99
99
|
return v
|
|
100
100
|
|
|
@@ -112,37 +112,37 @@ class QueryValidationRapidsResultAsset(BaseModel):
|
|
|
112
112
|
error_messages = []
|
|
113
113
|
match = 0
|
|
114
114
|
|
|
115
|
-
# deserialize data into
|
|
115
|
+
# deserialize data into FileAssetModel
|
|
116
116
|
try:
|
|
117
|
-
instance.actual_instance =
|
|
117
|
+
instance.actual_instance = FileAssetModel.from_json(json_str)
|
|
118
118
|
match += 1
|
|
119
119
|
except (ValidationError, ValueError) as e:
|
|
120
120
|
error_messages.append(str(e))
|
|
121
|
-
# deserialize data into
|
|
121
|
+
# deserialize data into MultiAssetModel
|
|
122
122
|
try:
|
|
123
|
-
instance.actual_instance =
|
|
123
|
+
instance.actual_instance = MultiAssetModel.from_json(json_str)
|
|
124
124
|
match += 1
|
|
125
125
|
except (ValidationError, ValueError) as e:
|
|
126
126
|
error_messages.append(str(e))
|
|
127
|
-
# deserialize data into
|
|
127
|
+
# deserialize data into NullAssetModel
|
|
128
128
|
try:
|
|
129
|
-
instance.actual_instance =
|
|
129
|
+
instance.actual_instance = NullAssetModel.from_json(json_str)
|
|
130
130
|
match += 1
|
|
131
131
|
except (ValidationError, ValueError) as e:
|
|
132
132
|
error_messages.append(str(e))
|
|
133
|
-
# deserialize data into
|
|
133
|
+
# deserialize data into TextAssetModel
|
|
134
134
|
try:
|
|
135
|
-
instance.actual_instance =
|
|
135
|
+
instance.actual_instance = TextAssetModel.from_json(json_str)
|
|
136
136
|
match += 1
|
|
137
137
|
except (ValidationError, ValueError) as e:
|
|
138
138
|
error_messages.append(str(e))
|
|
139
139
|
|
|
140
140
|
if match > 1:
|
|
141
141
|
# more than 1 match
|
|
142
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas:
|
|
142
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
143
143
|
elif match == 0:
|
|
144
144
|
# no match
|
|
145
|
-
raise ValueError("No match found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas:
|
|
145
|
+
raise ValueError("No match found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
146
146
|
else:
|
|
147
147
|
return instance
|
|
148
148
|
|
|
@@ -156,7 +156,7 @@ class QueryValidationRapidsResultAsset(BaseModel):
|
|
|
156
156
|
else:
|
|
157
157
|
return json.dumps(self.actual_instance)
|
|
158
158
|
|
|
159
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any],
|
|
159
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel]]:
|
|
160
160
|
"""Returns the dict representation of the actual instance"""
|
|
161
161
|
if self.actual_instance is None:
|
|
162
162
|
return None
|
|
@@ -26,10 +26,11 @@ 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(alias="rapidId")
|
|
29
|
+
rapid_id: StrictStr = Field(description="The rapid an issue was encountered with", alias="rapidId")
|
|
30
30
|
issue: StrictStr
|
|
31
|
-
message: Optional[StrictStr] = None
|
|
32
|
-
|
|
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")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["rapidId", "issue", "message", "dump"]
|
|
33
34
|
|
|
34
35
|
@field_validator('issue')
|
|
35
36
|
def issue_validate_enum(cls, value):
|
|
@@ -82,6 +83,11 @@ class ReportModel(BaseModel):
|
|
|
82
83
|
if self.message is None and "message" in self.model_fields_set:
|
|
83
84
|
_dict['message'] = None
|
|
84
85
|
|
|
86
|
+
# set to None if dump (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.dump is None and "dump" in self.model_fields_set:
|
|
89
|
+
_dict['dump'] = None
|
|
90
|
+
|
|
85
91
|
return _dict
|
|
86
92
|
|
|
87
93
|
@classmethod
|
|
@@ -96,7 +102,8 @@ class ReportModel(BaseModel):
|
|
|
96
102
|
_obj = cls.model_validate({
|
|
97
103
|
"rapidId": obj.get("rapidId"),
|
|
98
104
|
"issue": obj.get("issue"),
|
|
99
|
-
"message": obj.get("message")
|
|
105
|
+
"message": obj.get("message"),
|
|
106
|
+
"dump": obj.get("dump")
|
|
100
107
|
})
|
|
101
108
|
return _obj
|
|
102
109
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class SourceUrlMetadataModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SourceUrlMetadataModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for SourceUrlMetadataModel", alias="_t")
|
|
30
|
+
url: StrictStr
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "url"]
|
|
32
|
+
|
|
33
|
+
@field_validator('t')
|
|
34
|
+
def t_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in set(['SourceUrlMetadataModel']):
|
|
37
|
+
raise ValueError("must be one of enum values ('SourceUrlMetadataModel')")
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of SourceUrlMetadataModel from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of SourceUrlMetadataModel 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
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'SourceUrlMetadataModel',
|
|
92
|
+
"url": obj.get("url")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -19,7 +19,7 @@ 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.file_asset_model_metadata_value import FileAssetModelMetadataValue
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -27,17 +27,17 @@ class TextAssetModel(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
TextAssetModel
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
t: StrictStr = Field(description="Discriminator value for
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for TextAsset", alias="_t")
|
|
31
31
|
text: StrictStr
|
|
32
|
-
metadata:
|
|
32
|
+
metadata: Dict[str, FileAssetModelMetadataValue]
|
|
33
33
|
identifier: StrictStr
|
|
34
34
|
__properties: ClassVar[List[str]] = ["_t", "text", "metadata", "identifier"]
|
|
35
35
|
|
|
36
36
|
@field_validator('t')
|
|
37
37
|
def t_validate_enum(cls, value):
|
|
38
38
|
"""Validates the enum"""
|
|
39
|
-
if value not in set(['
|
|
40
|
-
raise ValueError("must be one of enum values ('
|
|
39
|
+
if value not in set(['TextAsset']):
|
|
40
|
+
raise ValueError("must be one of enum values ('TextAsset')")
|
|
41
41
|
return value
|
|
42
42
|
|
|
43
43
|
model_config = ConfigDict(
|
|
@@ -79,13 +79,13 @@ class TextAssetModel(BaseModel):
|
|
|
79
79
|
exclude=excluded_fields,
|
|
80
80
|
exclude_none=True,
|
|
81
81
|
)
|
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of each
|
|
83
|
-
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
|
|
83
|
+
_field_dict = {}
|
|
84
84
|
if self.metadata:
|
|
85
|
-
for
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
_dict['metadata'] =
|
|
85
|
+
for _key_metadata in self.metadata:
|
|
86
|
+
if self.metadata[_key_metadata]:
|
|
87
|
+
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
88
|
+
_dict['metadata'] = _field_dict
|
|
89
89
|
return _dict
|
|
90
90
|
|
|
91
91
|
@classmethod
|
|
@@ -98,9 +98,14 @@ class TextAssetModel(BaseModel):
|
|
|
98
98
|
return cls.model_validate(obj)
|
|
99
99
|
|
|
100
100
|
_obj = cls.model_validate({
|
|
101
|
-
"_t": obj.get("_t") if obj.get("_t") is not None else '
|
|
101
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'TextAsset',
|
|
102
102
|
"text": obj.get("text"),
|
|
103
|
-
"metadata":
|
|
103
|
+
"metadata": dict(
|
|
104
|
+
(_k, FileAssetModelMetadataValue.from_dict(_v))
|
|
105
|
+
for _k, _v in obj["metadata"].items()
|
|
106
|
+
)
|
|
107
|
+
if obj.get("metadata") is not None
|
|
108
|
+
else None,
|
|
104
109
|
"identifier": obj.get("identifier")
|
|
105
110
|
})
|
|
106
111
|
return _obj
|
|
@@ -28,8 +28,7 @@ class TextMetadataModel(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TextMetadata", alias="_t")
|
|
30
30
|
text: StrictStr
|
|
31
|
-
|
|
32
|
-
__properties: ClassVar[List[str]] = ["_t", "text", "identifier"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "text"]
|
|
33
32
|
|
|
34
33
|
@field_validator('t')
|
|
35
34
|
def t_validate_enum(cls, value):
|
|
@@ -90,8 +89,7 @@ class TextMetadataModel(BaseModel):
|
|
|
90
89
|
|
|
91
90
|
_obj = cls.model_validate({
|
|
92
91
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TextMetadata',
|
|
93
|
-
"text": obj.get("text")
|
|
94
|
-
"identifier": obj.get("identifier")
|
|
92
|
+
"text": obj.get("text")
|
|
95
93
|
})
|
|
96
94
|
return _obj
|
|
97
95
|
|
|
@@ -28,8 +28,7 @@ class TranscriptionMetadataInput(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TranscriptionMetadataInput", alias="_t")
|
|
30
30
|
transcription: StrictStr
|
|
31
|
-
|
|
32
|
-
__properties: ClassVar[List[str]] = ["_t", "transcription", "identifier"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "transcription"]
|
|
33
32
|
|
|
34
33
|
@field_validator('t')
|
|
35
34
|
def t_validate_enum(cls, value):
|
|
@@ -90,8 +89,7 @@ class TranscriptionMetadataInput(BaseModel):
|
|
|
90
89
|
|
|
91
90
|
_obj = cls.model_validate({
|
|
92
91
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadataInput',
|
|
93
|
-
"transcription": obj.get("transcription")
|
|
94
|
-
"identifier": obj.get("identifier")
|
|
92
|
+
"transcription": obj.get("transcription")
|
|
95
93
|
})
|
|
96
94
|
return _obj
|
|
97
95
|
|
|
@@ -27,9 +27,8 @@ class TranscriptionMetadataModel(BaseModel):
|
|
|
27
27
|
TranscriptionMetadataModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TranscriptionMetadataModel", alias="_t")
|
|
30
|
-
identifier: StrictStr
|
|
31
30
|
transcription: StrictStr
|
|
32
|
-
__properties: ClassVar[List[str]] = ["_t", "
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "transcription"]
|
|
33
32
|
|
|
34
33
|
@field_validator('t')
|
|
35
34
|
def t_validate_enum(cls, value):
|
|
@@ -90,7 +89,6 @@ class TranscriptionMetadataModel(BaseModel):
|
|
|
90
89
|
|
|
91
90
|
_obj = cls.model_validate({
|
|
92
91
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadataModel',
|
|
93
|
-
"identifier": obj.get("identifier"),
|
|
94
92
|
"transcription": obj.get("transcription")
|
|
95
93
|
})
|
|
96
94
|
return _obj
|
|
@@ -29,8 +29,7 @@ class TranslatedPromptMetadataModel(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
t: StrictStr = Field(description="Discriminator value for TranslatedPromptMetadata", alias="_t")
|
|
31
31
|
prompt: TranslatedString
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "prompt", "identifier"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "prompt"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -94,8 +93,7 @@ class TranslatedPromptMetadataModel(BaseModel):
|
|
|
94
93
|
|
|
95
94
|
_obj = cls.model_validate({
|
|
96
95
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranslatedPromptMetadata',
|
|
97
|
-
"prompt": TranslatedString.from_dict(obj["prompt"]) if obj.get("prompt") is not None else None
|
|
98
|
-
"identifier": obj.get("identifier")
|
|
96
|
+
"prompt": TranslatedString.from_dict(obj["prompt"]) if obj.get("prompt") is not None else None
|
|
99
97
|
})
|
|
100
98
|
return _obj
|
|
101
99
|
|
|
@@ -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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UploadFromS3Result(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
UploadFromS3Result
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
estimated_count: Optional[StrictInt] = Field(default=None, alias="estimatedCount")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["estimatedCount"]
|
|
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 UploadFromS3Result 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 UploadFromS3Result 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
|
+
"estimatedCount": obj.get("estimatedCount")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|