rapidata 2.28.5__py3-none-any.whl → 2.29.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.

Files changed (84) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +41 -8
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/benchmark_api.py +2766 -0
  5. rapidata/api_client/api/customer_rapid_api.py +332 -1
  6. rapidata/api_client/api/dataset_api.py +16 -0
  7. rapidata/api_client/api/leaderboard_api.py +1392 -270
  8. rapidata/api_client/models/__init__.py +40 -8
  9. rapidata/api_client/models/add_campaign_model.py +3 -3
  10. rapidata/api_client/models/and_user_filter_model.py +106 -0
  11. rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
  12. rapidata/api_client/models/benchmark_query_result.py +94 -0
  13. rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
  14. rapidata/api_client/models/boost_leaderboard_model.py +89 -0
  15. rapidata/api_client/models/create_benchmark_model.py +87 -0
  16. rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
  17. rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
  18. rapidata/api_client/models/create_benchmark_result.py +87 -0
  19. rapidata/api_client/models/create_datapoint_result.py +4 -16
  20. rapidata/api_client/models/create_leaderboard_model.py +18 -2
  21. rapidata/api_client/models/create_leaderboard_result.py +5 -3
  22. rapidata/api_client/models/create_order_model.py +3 -3
  23. rapidata/api_client/models/file_asset_input.py +104 -0
  24. rapidata/api_client/models/file_asset_input1.py +104 -0
  25. rapidata/api_client/models/file_asset_input1_file.py +168 -0
  26. rapidata/api_client/models/file_asset_input2.py +104 -0
  27. rapidata/api_client/models/file_asset_input_file.py +182 -0
  28. rapidata/api_client/models/form_file_wrapper.py +120 -0
  29. rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
  30. rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
  31. rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
  32. rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
  33. rapidata/api_client/models/get_participant_by_id_result.py +6 -26
  34. rapidata/api_client/models/get_standing_by_id_result.py +113 -0
  35. rapidata/api_client/models/local_file_wrapper.py +120 -0
  36. rapidata/api_client/models/multi_asset_input.py +110 -0
  37. rapidata/api_client/models/multi_asset_input1.py +110 -0
  38. rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
  39. rapidata/api_client/models/multi_asset_input2.py +110 -0
  40. rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
  41. rapidata/api_client/models/not_user_filter_model.py +3 -3
  42. rapidata/api_client/models/or_user_filter_model.py +3 -3
  43. rapidata/api_client/models/participant_by_benchmark.py +102 -0
  44. rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
  45. rapidata/api_client/models/participant_status.py +1 -4
  46. rapidata/api_client/models/potential_validation_rapid.py +103 -0
  47. rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
  48. rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
  49. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  50. rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
  51. rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
  52. rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
  53. rapidata/api_client/models/prompt_metadata_input.py +5 -3
  54. rapidata/api_client/models/proxy_file_wrapper.py +114 -0
  55. rapidata/api_client/models/query_validation_model.py +97 -0
  56. rapidata/api_client/models/standing_by_leaderboard.py +113 -0
  57. rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
  58. rapidata/api_client/models/standing_status.py +38 -0
  59. rapidata/api_client/models/stream_file_wrapper.py +116 -0
  60. rapidata/api_client/models/submit_prompt_model.py +89 -0
  61. rapidata/api_client/models/text_asset_input.py +100 -0
  62. rapidata/api_client/models/transcription_metadata_input.py +5 -3
  63. rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
  64. rapidata/api_client_README.md +62 -16
  65. rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
  66. rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
  67. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
  68. rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
  69. rapidata/rapidata_client/filter/not_filter.py +2 -2
  70. rapidata/rapidata_client/filter/or_filter.py +2 -2
  71. rapidata/rapidata_client/metadata/__init__.py +1 -0
  72. rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
  73. rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
  74. rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
  75. rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
  76. rapidata/rapidata_client/rapidata_client.py +3 -3
  77. rapidata/service/openapi_service.py +5 -0
  78. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
  79. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/RECORD +82 -35
  80. rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
  81. rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
  82. /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
  83. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
  84. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,105 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.potential_validation_rapid import PotentialValidationRapid
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class PotentialValidationRapidPagedResult(BaseModel):
27
+ """
28
+ PotentialValidationRapidPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[PotentialValidationRapid]
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 PotentialValidationRapidPagedResult 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 PotentialValidationRapidPagedResult 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": [PotentialValidationRapid.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,280 @@
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.attach_category_truth import AttachCategoryTruth
21
+ from rapidata.api_client.models.bounding_box_truth import BoundingBoxTruth
22
+ from rapidata.api_client.models.compare_truth import CompareTruth
23
+ from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
24
+ from rapidata.api_client.models.line_truth import LineTruth
25
+ from rapidata.api_client.models.locate_box_truth import LocateBoxTruth
26
+ from rapidata.api_client.models.multi_compare_truth import MultiCompareTruth
27
+ from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
28
+ from rapidata.api_client.models.polygon_truth import PolygonTruth
29
+ from rapidata.api_client.models.scrub_truth import ScrubTruth
30
+ from rapidata.api_client.models.skip_truth import SkipTruth
31
+ from rapidata.api_client.models.transcription_truth import TranscriptionTruth
32
+ from pydantic import StrictStr, Field
33
+ from typing import Union, List, Set, Optional, Dict
34
+ from typing_extensions import Literal, Self
35
+
36
+ POTENTIALVALIDATIONRAPIDTRUTH_ONE_OF_SCHEMAS = ["AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "MultiCompareTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth"]
37
+
38
+ class PotentialValidationRapidTruth(BaseModel):
39
+ """
40
+ PotentialValidationRapidTruth
41
+ """
42
+ # data type: TranscriptionTruth
43
+ oneof_schema_1_validator: Optional[TranscriptionTruth] = None
44
+ # data type: ScrubTruth
45
+ oneof_schema_2_validator: Optional[ScrubTruth] = None
46
+ # data type: PolygonTruth
47
+ oneof_schema_3_validator: Optional[PolygonTruth] = None
48
+ # data type: NamedEntityTruth
49
+ oneof_schema_4_validator: Optional[NamedEntityTruth] = None
50
+ # data type: LocateBoxTruth
51
+ oneof_schema_5_validator: Optional[LocateBoxTruth] = None
52
+ # data type: LineTruth
53
+ oneof_schema_6_validator: Optional[LineTruth] = None
54
+ # data type: EmptyValidationTruth
55
+ oneof_schema_7_validator: Optional[EmptyValidationTruth] = None
56
+ # data type: CompareTruth
57
+ oneof_schema_8_validator: Optional[CompareTruth] = None
58
+ # data type: MultiCompareTruth
59
+ oneof_schema_9_validator: Optional[MultiCompareTruth] = None
60
+ # data type: SkipTruth
61
+ oneof_schema_10_validator: Optional[SkipTruth] = None
62
+ # data type: AttachCategoryTruth
63
+ oneof_schema_11_validator: Optional[AttachCategoryTruth] = None
64
+ # data type: BoundingBoxTruth
65
+ oneof_schema_12_validator: Optional[BoundingBoxTruth] = None
66
+ actual_instance: Optional[Union[AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]] = None
67
+ one_of_schemas: Set[str] = { "AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "MultiCompareTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "SkipTruth", "TranscriptionTruth" }
68
+
69
+ model_config = ConfigDict(
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+
75
+ discriminator_value_class_map: Dict[str, str] = {
76
+ }
77
+
78
+ def __init__(self, *args, **kwargs) -> None:
79
+ if args:
80
+ if len(args) > 1:
81
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
82
+ if kwargs:
83
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
84
+ super().__init__(actual_instance=args[0])
85
+ else:
86
+ super().__init__(**kwargs)
87
+
88
+ @field_validator('actual_instance')
89
+ def actual_instance_must_validate_oneof(cls, v):
90
+ instance = PotentialValidationRapidTruth.model_construct()
91
+ error_messages = []
92
+ match = 0
93
+ # validate data type: TranscriptionTruth
94
+ if not isinstance(v, TranscriptionTruth):
95
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionTruth`")
96
+ else:
97
+ match += 1
98
+ # validate data type: ScrubTruth
99
+ if not isinstance(v, ScrubTruth):
100
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubTruth`")
101
+ else:
102
+ match += 1
103
+ # validate data type: PolygonTruth
104
+ if not isinstance(v, PolygonTruth):
105
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonTruth`")
106
+ else:
107
+ match += 1
108
+ # validate data type: NamedEntityTruth
109
+ if not isinstance(v, NamedEntityTruth):
110
+ error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityTruth`")
111
+ else:
112
+ match += 1
113
+ # validate data type: LocateBoxTruth
114
+ if not isinstance(v, LocateBoxTruth):
115
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LocateBoxTruth`")
116
+ else:
117
+ match += 1
118
+ # validate data type: LineTruth
119
+ if not isinstance(v, LineTruth):
120
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LineTruth`")
121
+ else:
122
+ match += 1
123
+ # validate data type: EmptyValidationTruth
124
+ if not isinstance(v, EmptyValidationTruth):
125
+ error_messages.append(f"Error! Input type `{type(v)}` is not `EmptyValidationTruth`")
126
+ else:
127
+ match += 1
128
+ # validate data type: CompareTruth
129
+ if not isinstance(v, CompareTruth):
130
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareTruth`")
131
+ else:
132
+ match += 1
133
+ # validate data type: MultiCompareTruth
134
+ if not isinstance(v, MultiCompareTruth):
135
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiCompareTruth`")
136
+ else:
137
+ match += 1
138
+ # validate data type: SkipTruth
139
+ if not isinstance(v, SkipTruth):
140
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SkipTruth`")
141
+ else:
142
+ match += 1
143
+ # validate data type: AttachCategoryTruth
144
+ if not isinstance(v, AttachCategoryTruth):
145
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryTruth`")
146
+ else:
147
+ match += 1
148
+ # validate data type: BoundingBoxTruth
149
+ if not isinstance(v, BoundingBoxTruth):
150
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxTruth`")
151
+ else:
152
+ match += 1
153
+ if match > 1:
154
+ # more than 1 match
155
+ raise ValueError("Multiple matches found when setting `actual_instance` in PotentialValidationRapidTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
156
+ elif match == 0:
157
+ # no match
158
+ raise ValueError("No match found when setting `actual_instance` in PotentialValidationRapidTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
159
+ else:
160
+ return v
161
+
162
+ @classmethod
163
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
164
+ return cls.from_json(json.dumps(obj))
165
+
166
+ @classmethod
167
+ def from_json(cls, json_str: str) -> Self:
168
+ """Returns the object represented by the json string"""
169
+ instance = cls.model_construct()
170
+ error_messages = []
171
+ match = 0
172
+
173
+ # deserialize data into TranscriptionTruth
174
+ try:
175
+ instance.actual_instance = TranscriptionTruth.from_json(json_str)
176
+ match += 1
177
+ except (ValidationError, ValueError) as e:
178
+ error_messages.append(str(e))
179
+ # deserialize data into ScrubTruth
180
+ try:
181
+ instance.actual_instance = ScrubTruth.from_json(json_str)
182
+ match += 1
183
+ except (ValidationError, ValueError) as e:
184
+ error_messages.append(str(e))
185
+ # deserialize data into PolygonTruth
186
+ try:
187
+ instance.actual_instance = PolygonTruth.from_json(json_str)
188
+ match += 1
189
+ except (ValidationError, ValueError) as e:
190
+ error_messages.append(str(e))
191
+ # deserialize data into NamedEntityTruth
192
+ try:
193
+ instance.actual_instance = NamedEntityTruth.from_json(json_str)
194
+ match += 1
195
+ except (ValidationError, ValueError) as e:
196
+ error_messages.append(str(e))
197
+ # deserialize data into LocateBoxTruth
198
+ try:
199
+ instance.actual_instance = LocateBoxTruth.from_json(json_str)
200
+ match += 1
201
+ except (ValidationError, ValueError) as e:
202
+ error_messages.append(str(e))
203
+ # deserialize data into LineTruth
204
+ try:
205
+ instance.actual_instance = LineTruth.from_json(json_str)
206
+ match += 1
207
+ except (ValidationError, ValueError) as e:
208
+ error_messages.append(str(e))
209
+ # deserialize data into EmptyValidationTruth
210
+ try:
211
+ instance.actual_instance = EmptyValidationTruth.from_json(json_str)
212
+ match += 1
213
+ except (ValidationError, ValueError) as e:
214
+ error_messages.append(str(e))
215
+ # deserialize data into CompareTruth
216
+ try:
217
+ instance.actual_instance = CompareTruth.from_json(json_str)
218
+ match += 1
219
+ except (ValidationError, ValueError) as e:
220
+ error_messages.append(str(e))
221
+ # deserialize data into MultiCompareTruth
222
+ try:
223
+ instance.actual_instance = MultiCompareTruth.from_json(json_str)
224
+ match += 1
225
+ except (ValidationError, ValueError) as e:
226
+ error_messages.append(str(e))
227
+ # deserialize data into SkipTruth
228
+ try:
229
+ instance.actual_instance = SkipTruth.from_json(json_str)
230
+ match += 1
231
+ except (ValidationError, ValueError) as e:
232
+ error_messages.append(str(e))
233
+ # deserialize data into AttachCategoryTruth
234
+ try:
235
+ instance.actual_instance = AttachCategoryTruth.from_json(json_str)
236
+ match += 1
237
+ except (ValidationError, ValueError) as e:
238
+ error_messages.append(str(e))
239
+ # deserialize data into BoundingBoxTruth
240
+ try:
241
+ instance.actual_instance = BoundingBoxTruth.from_json(json_str)
242
+ match += 1
243
+ except (ValidationError, ValueError) as e:
244
+ error_messages.append(str(e))
245
+
246
+ if match > 1:
247
+ # more than 1 match
248
+ raise ValueError("Multiple matches found when deserializing the JSON string into PotentialValidationRapidTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
249
+ elif match == 0:
250
+ # no match
251
+ raise ValueError("No match found when deserializing the JSON string into PotentialValidationRapidTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
252
+ else:
253
+ return instance
254
+
255
+ def to_json(self) -> str:
256
+ """Returns the JSON representation of the actual instance"""
257
+ if self.actual_instance is None:
258
+ return "null"
259
+
260
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
261
+ return self.actual_instance.to_json()
262
+ else:
263
+ return json.dumps(self.actual_instance)
264
+
265
+ def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, MultiCompareTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, SkipTruth, TranscriptionTruth]]:
266
+ """Returns the dict representation of the actual instance"""
267
+ if self.actual_instance is None:
268
+ return None
269
+
270
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
271
+ return self.actual_instance.to_dict()
272
+ else:
273
+ # primitive type
274
+ return self.actual_instance
275
+
276
+ def to_str(self) -> str:
277
+ """Returns the string representation of the actual instance"""
278
+ return pprint.pformat(self.model_dump())
279
+
280
+
@@ -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, Optional
22
- from rapidata.api_client.models.url_asset_input import UrlAssetInput
22
+ from rapidata.api_client.models.prompt_asset_metadata_input_asset import PromptAssetMetadataInputAsset
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -28,7 +28,7 @@ class PromptAssetMetadataInput(BaseModel):
28
28
  PromptAssetMetadataInput
29
29
  """ # noqa: E501
30
30
  t: StrictStr = Field(description="Discriminator value for PromptAssetMetadataInput", alias="_t")
31
- asset: UrlAssetInput
31
+ asset: PromptAssetMetadataInputAsset
32
32
  identifier: Optional[StrictStr] = None
33
33
  __properties: ClassVar[List[str]] = ["_t", "asset", "identifier"]
34
34
 
@@ -94,7 +94,7 @@ class PromptAssetMetadataInput(BaseModel):
94
94
 
95
95
  _obj = cls.model_validate({
96
96
  "_t": obj.get("_t") if obj.get("_t") is not None else 'PromptAssetMetadataInput',
97
- "asset": UrlAssetInput.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
97
+ "asset": PromptAssetMetadataInputAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
98
98
  "identifier": obj.get("identifier")
99
99
  })
100
100
  return _obj
@@ -0,0 +1,170 @@
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.file_asset_input2 import FileAssetInput2
21
+ from rapidata.api_client.models.text_asset_input import TextAssetInput
22
+ from rapidata.api_client.models.url_asset_input import UrlAssetInput
23
+ from pydantic import StrictStr, Field
24
+ from typing import Union, List, Set, Optional, Dict
25
+ from typing_extensions import Literal, Self
26
+
27
+ PROMPTASSETMETADATAINPUTASSET_ONE_OF_SCHEMAS = ["FileAssetInput2", "MultiAssetInput2", "TextAssetInput", "UrlAssetInput"]
28
+
29
+ class PromptAssetMetadataInputAsset(BaseModel):
30
+ """
31
+ PromptAssetMetadataInputAsset
32
+ """
33
+ # data type: FileAssetInput2
34
+ oneof_schema_1_validator: Optional[FileAssetInput2] = None
35
+ # data type: MultiAssetInput2
36
+ oneof_schema_2_validator: Optional[MultiAssetInput2] = None
37
+ # data type: TextAssetInput
38
+ oneof_schema_3_validator: Optional[TextAssetInput] = None
39
+ # data type: UrlAssetInput
40
+ oneof_schema_4_validator: Optional[UrlAssetInput] = None
41
+ actual_instance: Optional[Union[FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput]] = None
42
+ one_of_schemas: Set[str] = { "FileAssetInput2", "MultiAssetInput2", "TextAssetInput", "UrlAssetInput" }
43
+
44
+ model_config = ConfigDict(
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ discriminator_value_class_map: Dict[str, str] = {
51
+ }
52
+
53
+ def __init__(self, *args, **kwargs) -> None:
54
+ if args:
55
+ if len(args) > 1:
56
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
57
+ if kwargs:
58
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
59
+ super().__init__(actual_instance=args[0])
60
+ else:
61
+ super().__init__(**kwargs)
62
+
63
+ @field_validator('actual_instance')
64
+ def actual_instance_must_validate_oneof(cls, v):
65
+ instance = PromptAssetMetadataInputAsset.model_construct()
66
+ error_messages = []
67
+ match = 0
68
+ # validate data type: FileAssetInput2
69
+ if not isinstance(v, FileAssetInput2):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetInput2`")
71
+ else:
72
+ match += 1
73
+ # validate data type: MultiAssetInput2
74
+ if not isinstance(v, MultiAssetInput2):
75
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetInput2`")
76
+ else:
77
+ match += 1
78
+ # validate data type: TextAssetInput
79
+ if not isinstance(v, TextAssetInput):
80
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetInput`")
81
+ else:
82
+ match += 1
83
+ # validate data type: UrlAssetInput
84
+ if not isinstance(v, UrlAssetInput):
85
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UrlAssetInput`")
86
+ else:
87
+ match += 1
88
+ if match > 1:
89
+ # more than 1 match
90
+ raise ValueError("Multiple matches found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
91
+ elif match == 0:
92
+ # no match
93
+ raise ValueError("No match found when setting `actual_instance` in PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
94
+ else:
95
+ return v
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
99
+ return cls.from_json(json.dumps(obj))
100
+
101
+ @classmethod
102
+ def from_json(cls, json_str: str) -> Self:
103
+ """Returns the object represented by the json string"""
104
+ instance = cls.model_construct()
105
+ error_messages = []
106
+ match = 0
107
+
108
+ # deserialize data into FileAssetInput2
109
+ try:
110
+ instance.actual_instance = FileAssetInput2.from_json(json_str)
111
+ match += 1
112
+ except (ValidationError, ValueError) as e:
113
+ error_messages.append(str(e))
114
+ # deserialize data into MultiAssetInput2
115
+ try:
116
+ instance.actual_instance = MultiAssetInput2.from_json(json_str)
117
+ match += 1
118
+ except (ValidationError, ValueError) as e:
119
+ error_messages.append(str(e))
120
+ # deserialize data into TextAssetInput
121
+ try:
122
+ instance.actual_instance = TextAssetInput.from_json(json_str)
123
+ match += 1
124
+ except (ValidationError, ValueError) as e:
125
+ error_messages.append(str(e))
126
+ # deserialize data into UrlAssetInput
127
+ try:
128
+ instance.actual_instance = UrlAssetInput.from_json(json_str)
129
+ match += 1
130
+ except (ValidationError, ValueError) as e:
131
+ error_messages.append(str(e))
132
+
133
+ if match > 1:
134
+ # more than 1 match
135
+ raise ValueError("Multiple matches found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
136
+ elif match == 0:
137
+ # no match
138
+ raise ValueError("No match found when deserializing the JSON string into PromptAssetMetadataInputAsset with oneOf schemas: FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput. Details: " + ", ".join(error_messages))
139
+ else:
140
+ return instance
141
+
142
+ def to_json(self) -> str:
143
+ """Returns the JSON representation of the actual instance"""
144
+ if self.actual_instance is None:
145
+ return "null"
146
+
147
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
148
+ return self.actual_instance.to_json()
149
+ else:
150
+ return json.dumps(self.actual_instance)
151
+
152
+ def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetInput2, MultiAssetInput2, TextAssetInput, UrlAssetInput]]:
153
+ """Returns the dict representation of the actual instance"""
154
+ if self.actual_instance is None:
155
+ return None
156
+
157
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
158
+ return self.actual_instance.to_dict()
159
+ else:
160
+ # primitive type
161
+ return self.actual_instance
162
+
163
+ def to_str(self) -> str:
164
+ """Returns the string representation of the actual instance"""
165
+ return pprint.pformat(self.model_dump())
166
+
167
+ from rapidata.api_client.models.multi_asset_input2 import MultiAssetInput2
168
+ # TODO: Rewrite to not use raise_errors
169
+ PromptAssetMetadataInputAsset.model_rebuild(raise_errors=False)
170
+
@@ -0,0 +1,92 @@
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
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class PromptByBenchmarkResult(BaseModel):
27
+ """
28
+ PromptByBenchmarkResult
29
+ """ # noqa: E501
30
+ prompt: StrictStr
31
+ identifier: StrictStr
32
+ created_at: datetime = Field(alias="createdAt")
33
+ __properties: ClassVar[List[str]] = ["prompt", "identifier", "createdAt"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of PromptByBenchmarkResult from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of PromptByBenchmarkResult from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "prompt": obj.get("prompt"),
87
+ "identifier": obj.get("identifier"),
88
+ "createdAt": obj.get("createdAt")
89
+ })
90
+ return _obj
91
+
92
+