rapidata 2.13.0__py3-none-any.whl → 2.14.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 +29 -0
- rapidata/api_client/__init__.py +6 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/dataset_api.py +265 -0
- rapidata/api_client/api/workflow_api.py +298 -1
- rapidata/api_client/models/__init__.py +5 -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/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/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_responses_result.py +95 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +3 -3
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +17 -2
- rapidata/api_client_README.md +8 -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/order/_rapidata_dataset.py +311 -108
- rapidata/rapidata_client/order/rapidata_order_manager.py +64 -6
- rapidata/rapidata_client/validation/rapids/rapids.py +4 -5
- rapidata/rapidata_client/workflow/__init__.py +1 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +40 -0
- {rapidata-2.13.0.dist-info → rapidata-2.14.0.dist-info}/METADATA +1 -1
- {rapidata-2.13.0.dist-info → rapidata-2.14.0.dist-info}/RECORD +36 -32
- {rapidata-2.13.0.dist-info → rapidata-2.14.0.dist-info}/LICENSE +0 -0
- {rapidata-2.13.0.dist-info → rapidata-2.14.0.dist-info}/WHEEL +0 -0
|
@@ -16,14 +16,16 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from pydantic import Field, StrictBool, StrictStr
|
|
19
|
+
from pydantic import Field, StrictBool, StrictInt, StrictStr
|
|
20
20
|
from typing import Optional
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
22
|
from rapidata.api_client.models.get_compare_ab_summary_result import GetCompareAbSummaryResult
|
|
23
|
+
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
23
24
|
from rapidata.api_client.models.get_workflow_by_id_result import GetWorkflowByIdResult
|
|
24
25
|
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
25
26
|
from rapidata.api_client.models.i_workflow_model_paged_result import IWorkflowModelPagedResult
|
|
26
27
|
from rapidata.api_client.models.query_workflows_model import QueryWorkflowsModel
|
|
28
|
+
from rapidata.api_client.models.sort_direction import SortDirection
|
|
27
29
|
|
|
28
30
|
from rapidata.api_client.api_client import ApiClient, RequestSerialized
|
|
29
31
|
from rapidata.api_client.api_response import ApiResponse
|
|
@@ -1101,6 +1103,301 @@ class WorkflowApi:
|
|
|
1101
1103
|
|
|
1102
1104
|
|
|
1103
1105
|
|
|
1106
|
+
@validate_call
|
|
1107
|
+
def workflow_id_responses_get(
|
|
1108
|
+
self,
|
|
1109
|
+
id: Annotated[StrictStr, Field(description="The ID of the workflow to get the responses for.")],
|
|
1110
|
+
limit: Annotated[Optional[StrictInt], Field(description="The number of responses to get.")] = None,
|
|
1111
|
+
sort: Annotated[Optional[SortDirection], Field(description="Whether the oldest or most recent responses should be returned.")] = None,
|
|
1112
|
+
_request_timeout: Union[
|
|
1113
|
+
None,
|
|
1114
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1115
|
+
Tuple[
|
|
1116
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1117
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1118
|
+
]
|
|
1119
|
+
] = None,
|
|
1120
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1121
|
+
_content_type: Optional[StrictStr] = None,
|
|
1122
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1123
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1124
|
+
) -> GetResponsesResult:
|
|
1125
|
+
"""Gets the !:limit most recent or oldest responses for a workflow. The responses are not guaranteed to be of any specific rapid. Instead, this endpoint returns all responses to any rapid in the workflow.
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
:param id: The ID of the workflow to get the responses for. (required)
|
|
1129
|
+
:type id: str
|
|
1130
|
+
:param limit: The number of responses to get.
|
|
1131
|
+
:type limit: int
|
|
1132
|
+
:param sort: Whether the oldest or most recent responses should be returned.
|
|
1133
|
+
:type sort: SortDirection
|
|
1134
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1135
|
+
number provided, it will be total request
|
|
1136
|
+
timeout. It can also be a pair (tuple) of
|
|
1137
|
+
(connection, read) timeouts.
|
|
1138
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1139
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1140
|
+
request; this effectively ignores the
|
|
1141
|
+
authentication in the spec for a single request.
|
|
1142
|
+
:type _request_auth: dict, optional
|
|
1143
|
+
:param _content_type: force content-type for the request.
|
|
1144
|
+
:type _content_type: str, Optional
|
|
1145
|
+
:param _headers: set to override the headers for a single
|
|
1146
|
+
request; this effectively ignores the headers
|
|
1147
|
+
in the spec for a single request.
|
|
1148
|
+
:type _headers: dict, optional
|
|
1149
|
+
:param _host_index: set to override the host_index for a single
|
|
1150
|
+
request; this effectively ignores the host_index
|
|
1151
|
+
in the spec for a single request.
|
|
1152
|
+
:type _host_index: int, optional
|
|
1153
|
+
:return: Returns the result object.
|
|
1154
|
+
""" # noqa: E501
|
|
1155
|
+
|
|
1156
|
+
_param = self._workflow_id_responses_get_serialize(
|
|
1157
|
+
id=id,
|
|
1158
|
+
limit=limit,
|
|
1159
|
+
sort=sort,
|
|
1160
|
+
_request_auth=_request_auth,
|
|
1161
|
+
_content_type=_content_type,
|
|
1162
|
+
_headers=_headers,
|
|
1163
|
+
_host_index=_host_index
|
|
1164
|
+
)
|
|
1165
|
+
|
|
1166
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1167
|
+
'200': "GetResponsesResult",
|
|
1168
|
+
}
|
|
1169
|
+
response_data = self.api_client.call_api(
|
|
1170
|
+
*_param,
|
|
1171
|
+
_request_timeout=_request_timeout
|
|
1172
|
+
)
|
|
1173
|
+
response_data.read()
|
|
1174
|
+
return self.api_client.response_deserialize(
|
|
1175
|
+
response_data=response_data,
|
|
1176
|
+
response_types_map=_response_types_map,
|
|
1177
|
+
).data
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
@validate_call
|
|
1181
|
+
def workflow_id_responses_get_with_http_info(
|
|
1182
|
+
self,
|
|
1183
|
+
id: Annotated[StrictStr, Field(description="The ID of the workflow to get the responses for.")],
|
|
1184
|
+
limit: Annotated[Optional[StrictInt], Field(description="The number of responses to get.")] = None,
|
|
1185
|
+
sort: Annotated[Optional[SortDirection], Field(description="Whether the oldest or most recent responses should be returned.")] = None,
|
|
1186
|
+
_request_timeout: Union[
|
|
1187
|
+
None,
|
|
1188
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1189
|
+
Tuple[
|
|
1190
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1191
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1192
|
+
]
|
|
1193
|
+
] = None,
|
|
1194
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1195
|
+
_content_type: Optional[StrictStr] = None,
|
|
1196
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1197
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1198
|
+
) -> ApiResponse[GetResponsesResult]:
|
|
1199
|
+
"""Gets the !:limit most recent or oldest responses for a workflow. The responses are not guaranteed to be of any specific rapid. Instead, this endpoint returns all responses to any rapid in the workflow.
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
:param id: The ID of the workflow to get the responses for. (required)
|
|
1203
|
+
:type id: str
|
|
1204
|
+
:param limit: The number of responses to get.
|
|
1205
|
+
:type limit: int
|
|
1206
|
+
:param sort: Whether the oldest or most recent responses should be returned.
|
|
1207
|
+
:type sort: SortDirection
|
|
1208
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1209
|
+
number provided, it will be total request
|
|
1210
|
+
timeout. It can also be a pair (tuple) of
|
|
1211
|
+
(connection, read) timeouts.
|
|
1212
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1213
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1214
|
+
request; this effectively ignores the
|
|
1215
|
+
authentication in the spec for a single request.
|
|
1216
|
+
:type _request_auth: dict, optional
|
|
1217
|
+
:param _content_type: force content-type for the request.
|
|
1218
|
+
:type _content_type: str, Optional
|
|
1219
|
+
:param _headers: set to override the headers for a single
|
|
1220
|
+
request; this effectively ignores the headers
|
|
1221
|
+
in the spec for a single request.
|
|
1222
|
+
:type _headers: dict, optional
|
|
1223
|
+
:param _host_index: set to override the host_index for a single
|
|
1224
|
+
request; this effectively ignores the host_index
|
|
1225
|
+
in the spec for a single request.
|
|
1226
|
+
:type _host_index: int, optional
|
|
1227
|
+
:return: Returns the result object.
|
|
1228
|
+
""" # noqa: E501
|
|
1229
|
+
|
|
1230
|
+
_param = self._workflow_id_responses_get_serialize(
|
|
1231
|
+
id=id,
|
|
1232
|
+
limit=limit,
|
|
1233
|
+
sort=sort,
|
|
1234
|
+
_request_auth=_request_auth,
|
|
1235
|
+
_content_type=_content_type,
|
|
1236
|
+
_headers=_headers,
|
|
1237
|
+
_host_index=_host_index
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1241
|
+
'200': "GetResponsesResult",
|
|
1242
|
+
}
|
|
1243
|
+
response_data = self.api_client.call_api(
|
|
1244
|
+
*_param,
|
|
1245
|
+
_request_timeout=_request_timeout
|
|
1246
|
+
)
|
|
1247
|
+
response_data.read()
|
|
1248
|
+
return self.api_client.response_deserialize(
|
|
1249
|
+
response_data=response_data,
|
|
1250
|
+
response_types_map=_response_types_map,
|
|
1251
|
+
)
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
@validate_call
|
|
1255
|
+
def workflow_id_responses_get_without_preload_content(
|
|
1256
|
+
self,
|
|
1257
|
+
id: Annotated[StrictStr, Field(description="The ID of the workflow to get the responses for.")],
|
|
1258
|
+
limit: Annotated[Optional[StrictInt], Field(description="The number of responses to get.")] = None,
|
|
1259
|
+
sort: Annotated[Optional[SortDirection], Field(description="Whether the oldest or most recent responses should be returned.")] = None,
|
|
1260
|
+
_request_timeout: Union[
|
|
1261
|
+
None,
|
|
1262
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1263
|
+
Tuple[
|
|
1264
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1265
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1266
|
+
]
|
|
1267
|
+
] = None,
|
|
1268
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1269
|
+
_content_type: Optional[StrictStr] = None,
|
|
1270
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1271
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1272
|
+
) -> RESTResponseType:
|
|
1273
|
+
"""Gets the !:limit most recent or oldest responses for a workflow. The responses are not guaranteed to be of any specific rapid. Instead, this endpoint returns all responses to any rapid in the workflow.
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
:param id: The ID of the workflow to get the responses for. (required)
|
|
1277
|
+
:type id: str
|
|
1278
|
+
:param limit: The number of responses to get.
|
|
1279
|
+
:type limit: int
|
|
1280
|
+
:param sort: Whether the oldest or most recent responses should be returned.
|
|
1281
|
+
:type sort: SortDirection
|
|
1282
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1283
|
+
number provided, it will be total request
|
|
1284
|
+
timeout. It can also be a pair (tuple) of
|
|
1285
|
+
(connection, read) timeouts.
|
|
1286
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1287
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1288
|
+
request; this effectively ignores the
|
|
1289
|
+
authentication in the spec for a single request.
|
|
1290
|
+
:type _request_auth: dict, optional
|
|
1291
|
+
:param _content_type: force content-type for the request.
|
|
1292
|
+
:type _content_type: str, Optional
|
|
1293
|
+
:param _headers: set to override the headers for a single
|
|
1294
|
+
request; this effectively ignores the headers
|
|
1295
|
+
in the spec for a single request.
|
|
1296
|
+
:type _headers: dict, optional
|
|
1297
|
+
:param _host_index: set to override the host_index for a single
|
|
1298
|
+
request; this effectively ignores the host_index
|
|
1299
|
+
in the spec for a single request.
|
|
1300
|
+
:type _host_index: int, optional
|
|
1301
|
+
:return: Returns the result object.
|
|
1302
|
+
""" # noqa: E501
|
|
1303
|
+
|
|
1304
|
+
_param = self._workflow_id_responses_get_serialize(
|
|
1305
|
+
id=id,
|
|
1306
|
+
limit=limit,
|
|
1307
|
+
sort=sort,
|
|
1308
|
+
_request_auth=_request_auth,
|
|
1309
|
+
_content_type=_content_type,
|
|
1310
|
+
_headers=_headers,
|
|
1311
|
+
_host_index=_host_index
|
|
1312
|
+
)
|
|
1313
|
+
|
|
1314
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1315
|
+
'200': "GetResponsesResult",
|
|
1316
|
+
}
|
|
1317
|
+
response_data = self.api_client.call_api(
|
|
1318
|
+
*_param,
|
|
1319
|
+
_request_timeout=_request_timeout
|
|
1320
|
+
)
|
|
1321
|
+
return response_data.response
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
def _workflow_id_responses_get_serialize(
|
|
1325
|
+
self,
|
|
1326
|
+
id,
|
|
1327
|
+
limit,
|
|
1328
|
+
sort,
|
|
1329
|
+
_request_auth,
|
|
1330
|
+
_content_type,
|
|
1331
|
+
_headers,
|
|
1332
|
+
_host_index,
|
|
1333
|
+
) -> RequestSerialized:
|
|
1334
|
+
|
|
1335
|
+
_host = None
|
|
1336
|
+
|
|
1337
|
+
_collection_formats: Dict[str, str] = {
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
_path_params: Dict[str, str] = {}
|
|
1341
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1342
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1343
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1344
|
+
_files: Dict[
|
|
1345
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1346
|
+
] = {}
|
|
1347
|
+
_body_params: Optional[bytes] = None
|
|
1348
|
+
|
|
1349
|
+
# process the path parameters
|
|
1350
|
+
if id is not None:
|
|
1351
|
+
_path_params['id'] = id
|
|
1352
|
+
# process the query parameters
|
|
1353
|
+
if limit is not None:
|
|
1354
|
+
|
|
1355
|
+
_query_params.append(('limit', limit))
|
|
1356
|
+
|
|
1357
|
+
if sort is not None:
|
|
1358
|
+
|
|
1359
|
+
_query_params.append(('sort', sort.value))
|
|
1360
|
+
|
|
1361
|
+
# process the header parameters
|
|
1362
|
+
# process the form parameters
|
|
1363
|
+
# process the body parameter
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
# set the HTTP header `Accept`
|
|
1367
|
+
if 'Accept' not in _header_params:
|
|
1368
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1369
|
+
[
|
|
1370
|
+
'text/plain',
|
|
1371
|
+
'application/json',
|
|
1372
|
+
'text/json'
|
|
1373
|
+
]
|
|
1374
|
+
)
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
# authentication setting
|
|
1378
|
+
_auth_settings: List[str] = [
|
|
1379
|
+
'bearer',
|
|
1380
|
+
'oauth2'
|
|
1381
|
+
]
|
|
1382
|
+
|
|
1383
|
+
return self.api_client.param_serialize(
|
|
1384
|
+
method='GET',
|
|
1385
|
+
resource_path='/workflow/{id}/responses',
|
|
1386
|
+
path_params=_path_params,
|
|
1387
|
+
query_params=_query_params,
|
|
1388
|
+
header_params=_header_params,
|
|
1389
|
+
body=_body_params,
|
|
1390
|
+
post_params=_form_params,
|
|
1391
|
+
files=_files,
|
|
1392
|
+
auth_settings=_auth_settings,
|
|
1393
|
+
collection_formats=_collection_formats,
|
|
1394
|
+
_host=_host,
|
|
1395
|
+
_request_auth=_request_auth
|
|
1396
|
+
)
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1104
1401
|
@validate_call
|
|
1105
1402
|
def workflow_query_get(
|
|
1106
1403
|
self,
|
|
@@ -18,7 +18,6 @@ from rapidata.api_client.models.ab_test_selection import AbTestSelection
|
|
|
18
18
|
from rapidata.api_client.models.ab_test_selection_a_inner import AbTestSelectionAInner
|
|
19
19
|
from rapidata.api_client.models.add_campaign_artifact_result import AddCampaignArtifactResult
|
|
20
20
|
from rapidata.api_client.models.add_campaign_model import AddCampaignModel
|
|
21
|
-
from rapidata.api_client.models.add_campaign_model_user_filters_inner import AddCampaignModelUserFiltersInner
|
|
22
21
|
from rapidata.api_client.models.add_validation_rapid_model import AddValidationRapidModel
|
|
23
22
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
24
23
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
@@ -75,6 +74,7 @@ from rapidata.api_client.models.create_complex_order_model import CreateComplexO
|
|
|
75
74
|
from rapidata.api_client.models.create_complex_order_model_pipeline import CreateComplexOrderModelPipeline
|
|
76
75
|
from rapidata.api_client.models.create_complex_order_result import CreateComplexOrderResult
|
|
77
76
|
from rapidata.api_client.models.create_datapoint_from_urls_model import CreateDatapointFromUrlsModel
|
|
77
|
+
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
78
78
|
from rapidata.api_client.models.create_datapoint_result import CreateDatapointResult
|
|
79
79
|
from rapidata.api_client.models.create_dataset_artifact_model import CreateDatasetArtifactModel
|
|
80
80
|
from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
|
|
@@ -90,10 +90,10 @@ from rapidata.api_client.models.create_simple_pipeline_model_artifacts_inner imp
|
|
|
90
90
|
from rapidata.api_client.models.create_simple_pipeline_model_pipeline_steps_inner import CreateSimplePipelineModelPipelineStepsInner
|
|
91
91
|
from rapidata.api_client.models.create_unsupported_order_model import CreateUnsupportedOrderModel
|
|
92
92
|
from rapidata.api_client.models.custom_user_filter_model import CustomUserFilterModel
|
|
93
|
+
from rapidata.api_client.models.datapoint import Datapoint
|
|
94
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
93
95
|
from rapidata.api_client.models.datapoint_metadata_model import DatapointMetadataModel
|
|
94
|
-
from rapidata.api_client.models.datapoint_metadata_model_metadata_inner import DatapointMetadataModelMetadataInner
|
|
95
96
|
from rapidata.api_client.models.datapoint_model import DatapointModel
|
|
96
|
-
from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
|
|
97
97
|
from rapidata.api_client.models.datapoint_state import DatapointState
|
|
98
98
|
from rapidata.api_client.models.dataset_artifact_model import DatasetArtifactModel
|
|
99
99
|
from rapidata.api_client.models.dataset_evaluation_step_model import DatasetEvaluationStepModel
|
|
@@ -128,10 +128,12 @@ from rapidata.api_client.models.get_datapoint_by_id_result import GetDatapointBy
|
|
|
128
128
|
from rapidata.api_client.models.get_datapoints_by_dataset_id_result import GetDatapointsByDatasetIdResult
|
|
129
129
|
from rapidata.api_client.models.get_dataset_by_id_result import GetDatasetByIdResult
|
|
130
130
|
from rapidata.api_client.models.get_dataset_progress_result import GetDatasetProgressResult
|
|
131
|
+
from rapidata.api_client.models.get_failed_datapoints_result import GetFailedDatapointsResult
|
|
131
132
|
from rapidata.api_client.models.get_order_by_id_result import GetOrderByIdResult
|
|
132
133
|
from rapidata.api_client.models.get_pipeline_by_id_result import GetPipelineByIdResult
|
|
133
134
|
from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
|
|
134
135
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
136
|
+
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
135
137
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
136
138
|
from rapidata.api_client.models.get_simple_workflow_results_result import GetSimpleWorkflowResultsResult
|
|
137
139
|
from rapidata.api_client.models.get_simple_workflow_results_result_paged_result import GetSimpleWorkflowResultsResultPagedResult
|
|
@@ -171,7 +173,6 @@ from rapidata.api_client.models.named_entity_result import NamedEntityResult
|
|
|
171
173
|
from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
|
|
172
174
|
from rapidata.api_client.models.never_ending_referee_config import NeverEndingRefereeConfig
|
|
173
175
|
from rapidata.api_client.models.new_user_filter_model import NewUserFilterModel
|
|
174
|
-
from rapidata.api_client.models.new_user_filter_model1 import NewUserFilterModel1
|
|
175
176
|
from rapidata.api_client.models.newsletter_model import NewsletterModel
|
|
176
177
|
from rapidata.api_client.models.not_available_yet_result import NotAvailableYetResult
|
|
177
178
|
from rapidata.api_client.models.null_asset_model import NullAssetModel
|
|
@@ -20,7 +20,7 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from rapidata.api_client.models.ab_test_selection_a_inner import AbTestSelectionAInner
|
|
23
|
-
from rapidata.api_client.models.
|
|
23
|
+
from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
|
|
24
24
|
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
@@ -32,7 +32,7 @@ class AddCampaignModel(BaseModel):
|
|
|
32
32
|
t: StrictStr = Field(description="Discriminator value for AddCampaignModel", alias="_t")
|
|
33
33
|
artifact_id: Optional[StrictStr] = Field(default=None, description="The id of the campaign artifact. If not provided a random value will be used.", alias="artifactId")
|
|
34
34
|
campaign_name: StrictStr = Field(description="The name of the campaign.", alias="campaignName")
|
|
35
|
-
user_filters: List[
|
|
35
|
+
user_filters: List[CreateOrderModelUserFiltersInner] = Field(description="The user filters to apply to the campaign.", alias="userFilters")
|
|
36
36
|
validation_set_id: Optional[StrictStr] = Field(default=None, description="A validation set that should be used.", alias="validationSetId")
|
|
37
37
|
selections: Optional[List[AbTestSelectionAInner]] = Field(default=None, description="The selections that the campaign should have.")
|
|
38
38
|
feature_flags: List[FeatureFlag] = Field(description="The feature flags that should be applied to the campaign.", alias="featureFlags")
|
|
@@ -137,7 +137,7 @@ class AddCampaignModel(BaseModel):
|
|
|
137
137
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'AddCampaignModel',
|
|
138
138
|
"artifactId": obj.get("artifactId"),
|
|
139
139
|
"campaignName": obj.get("campaignName"),
|
|
140
|
-
"userFilters": [
|
|
140
|
+
"userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
|
|
141
141
|
"validationSetId": obj.get("validationSetId"),
|
|
142
142
|
"selections": [AbTestSelectionAInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None,
|
|
143
143
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
24
|
-
from rapidata.api_client.models.
|
|
24
|
+
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ class AddValidationRapidModel(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
validation_set_id: StrictStr = Field(description="The ID of the validation set to add the rapid to.", alias="validationSetId")
|
|
33
33
|
payload: AddValidationRapidModelPayload
|
|
34
|
-
metadata: List[
|
|
34
|
+
metadata: List[CreateDatapointFromUrlsModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
35
|
truth: AddValidationRapidModelTruth
|
|
36
36
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
37
37
|
explanation: Optional[StrictStr] = Field(default=None, description="An explanation for the users if they answer the rapid incorrectly.")
|
|
@@ -113,7 +113,7 @@ class AddValidationRapidModel(BaseModel):
|
|
|
113
113
|
_obj = cls.model_validate({
|
|
114
114
|
"validationSetId": obj.get("validationSetId"),
|
|
115
115
|
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
116
|
-
"metadata": [
|
|
116
|
+
"metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
117
117
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
118
118
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
119
119
|
"explanation": obj.get("explanation")
|
|
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
24
|
-
from rapidata.api_client.models.
|
|
24
|
+
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
validation_set_id: StrictStr = Field(description="The ID of the validation set to add the rapid to.", alias="validationSetId")
|
|
33
33
|
payload: AddValidationRapidModelPayload
|
|
34
|
-
metadata: List[
|
|
34
|
+
metadata: List[CreateDatapointFromUrlsModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
35
|
truth: AddValidationRapidModelTruth
|
|
36
36
|
texts: List[StrictStr] = Field(description="The texts to use for the rapid.")
|
|
37
37
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
@@ -114,7 +114,7 @@ class AddValidationTextRapidModel(BaseModel):
|
|
|
114
114
|
_obj = cls.model_validate({
|
|
115
115
|
"validationSetId": obj.get("validationSetId"),
|
|
116
116
|
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
117
|
-
"metadata": [
|
|
117
|
+
"metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
118
118
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
119
119
|
"texts": obj.get("texts"),
|
|
120
120
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
@@ -17,8 +17,9 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -27,7 +28,9 @@ class CreateDatapointFromUrlsModel(BaseModel):
|
|
|
27
28
|
The model for creating a datapoint from urls.
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
urls: List[StrictStr] = Field(description="The urls to fetch the assets from. The urls must be publicly accessible. A HEAD request will be made to each url to check if it is accessible.")
|
|
30
|
-
|
|
31
|
+
metadata: Optional[List[CreateDatapointFromUrlsModelMetadataInner]] = Field(default=None, description="Additional metadata to attach to the datapoint. Most commonly used to add a prompt to the datapoint using the Rapidata.Shared.Assets.Abstraction.Models.Metadata.Input.PromptMetadataInput.")
|
|
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
|
+
__properties: ClassVar[List[str]] = ["urls", "metadata", "sortIndex"]
|
|
31
34
|
|
|
32
35
|
model_config = ConfigDict(
|
|
33
36
|
populate_by_name=True,
|
|
@@ -68,6 +71,23 @@ class CreateDatapointFromUrlsModel(BaseModel):
|
|
|
68
71
|
exclude=excluded_fields,
|
|
69
72
|
exclude_none=True,
|
|
70
73
|
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.metadata:
|
|
77
|
+
for _item_metadata in self.metadata:
|
|
78
|
+
if _item_metadata:
|
|
79
|
+
_items.append(_item_metadata.to_dict())
|
|
80
|
+
_dict['metadata'] = _items
|
|
81
|
+
# set to None if metadata (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
84
|
+
_dict['metadata'] = None
|
|
85
|
+
|
|
86
|
+
# set to None if sort_index (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.sort_index is None and "sort_index" in self.model_fields_set:
|
|
89
|
+
_dict['sortIndex'] = None
|
|
90
|
+
|
|
71
91
|
return _dict
|
|
72
92
|
|
|
73
93
|
@classmethod
|
|
@@ -80,7 +100,9 @@ class CreateDatapointFromUrlsModel(BaseModel):
|
|
|
80
100
|
return cls.model_validate(obj)
|
|
81
101
|
|
|
82
102
|
_obj = cls.model_validate({
|
|
83
|
-
"urls": obj.get("urls")
|
|
103
|
+
"urls": obj.get("urls"),
|
|
104
|
+
"metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
105
|
+
"sortIndex": obj.get("sortIndex")
|
|
84
106
|
})
|
|
85
107
|
return _obj
|
|
86
108
|
|