rapidata 0.5.1__py3-none-any.whl → 1.0.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.
- rapidata/__init__.py +3 -0
- rapidata/api_client/__init__.py +3 -1
- rapidata/api_client/api/validation_api.py +276 -0
- rapidata/api_client/models/__init__.py +3 -1
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/add_validation_text_rapid_model.py +118 -0
- rapidata/api_client/models/capped_selection.py +108 -0
- rapidata/api_client/models/capped_selection_selections_inner.py +198 -0
- rapidata/api_client/models/create_order_model.py +3 -3
- rapidata/api_client_README.md +4 -1
- rapidata/rapidata_client/__init__.py +1 -0
- rapidata/rapidata_client/assets/__init__.py +8 -0
- rapidata/rapidata_client/assets/base_asset.py +11 -0
- rapidata/rapidata_client/assets/media_asset.py +33 -0
- rapidata/rapidata_client/assets/multi_asset.py +44 -0
- rapidata/rapidata_client/assets/text_asset.py +25 -0
- rapidata/rapidata_client/dataset/rapidata_dataset.py +4 -4
- rapidata/rapidata_client/dataset/rapidata_validation_set.py +54 -27
- rapidata/rapidata_client/dataset/validation_rapid_parts.py +4 -1
- rapidata/rapidata_client/dataset/validation_set_builder.py +41 -24
- rapidata/rapidata_client/order/rapidata_order_builder.py +98 -33
- rapidata/rapidata_client/rapidata_client.py +24 -0
- rapidata/rapidata_client/simple_builders/simple_classification_builders.py +122 -0
- rapidata/rapidata_client/simple_builders/simple_compare_builders.py +86 -0
- {rapidata-0.5.1.dist-info → rapidata-1.0.0.dist-info}/METADATA +1 -1
- {rapidata-0.5.1.dist-info → rapidata-1.0.0.dist-info}/RECORD +28 -18
- {rapidata-0.5.1.dist-info → rapidata-1.0.0.dist-info}/LICENSE +0 -0
- {rapidata-0.5.1.dist-info → rapidata-1.0.0.dist-info}/WHEEL +0 -0
rapidata/__init__.py
CHANGED
rapidata/api_client/__init__.py
CHANGED
|
@@ -49,6 +49,7 @@ from rapidata.api_client.models.add_validation_rapid_model import AddValidationR
|
|
|
49
49
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
50
50
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
51
51
|
from rapidata.api_client.models.add_validation_rapid_result import AddValidationRapidResult
|
|
52
|
+
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
52
53
|
from rapidata.api_client.models.admin_order_model import AdminOrderModel
|
|
53
54
|
from rapidata.api_client.models.admin_order_model_paged_result import AdminOrderModelPagedResult
|
|
54
55
|
from rapidata.api_client.models.age_group import AgeGroup
|
|
@@ -68,6 +69,8 @@ from rapidata.api_client.models.campaign_query_model import CampaignQueryModel
|
|
|
68
69
|
from rapidata.api_client.models.campaign_query_model_paged_result import CampaignQueryModelPagedResult
|
|
69
70
|
from rapidata.api_client.models.campaign_status import CampaignStatus
|
|
70
71
|
from rapidata.api_client.models.campaign_user_filter_model import CampaignUserFilterModel
|
|
72
|
+
from rapidata.api_client.models.capped_selection import CappedSelection
|
|
73
|
+
from rapidata.api_client.models.capped_selection_selections_inner import CappedSelectionSelectionsInner
|
|
71
74
|
from rapidata.api_client.models.classification_metadata import ClassificationMetadata
|
|
72
75
|
from rapidata.api_client.models.classification_metadata_filter_config import ClassificationMetadataFilterConfig
|
|
73
76
|
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
@@ -103,7 +106,6 @@ from rapidata.api_client.models.create_independent_workflow_model_workflow_confi
|
|
|
103
106
|
from rapidata.api_client.models.create_independent_workflow_result import CreateIndependentWorkflowResult
|
|
104
107
|
from rapidata.api_client.models.create_order_model import CreateOrderModel
|
|
105
108
|
from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
|
|
106
|
-
from rapidata.api_client.models.create_order_model_selections_inner import CreateOrderModelSelectionsInner
|
|
107
109
|
from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
|
|
108
110
|
from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
|
|
109
111
|
from rapidata.api_client.models.create_order_result import CreateOrderResult
|
|
@@ -21,6 +21,7 @@ from typing import List, Optional, Tuple, Union
|
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model import AddValidationRapidModel
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_result import AddValidationRapidResult
|
|
24
|
+
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
24
25
|
from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
|
|
25
26
|
from rapidata.api_client.models.get_available_validation_sets_result import GetAvailableValidationSetsResult
|
|
26
27
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
@@ -335,6 +336,281 @@ class ValidationApi:
|
|
|
335
336
|
|
|
336
337
|
|
|
337
338
|
|
|
339
|
+
@validate_call
|
|
340
|
+
def validation_add_validation_text_rapid_post(
|
|
341
|
+
self,
|
|
342
|
+
add_validation_text_rapid_model: Annotated[Optional[AddValidationTextRapidModel], Field(description="The model containing the information needed to add the validation rapid.")] = None,
|
|
343
|
+
_request_timeout: Union[
|
|
344
|
+
None,
|
|
345
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
346
|
+
Tuple[
|
|
347
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
348
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
349
|
+
]
|
|
350
|
+
] = None,
|
|
351
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
352
|
+
_content_type: Optional[StrictStr] = None,
|
|
353
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
354
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
355
|
+
) -> AddValidationRapidResult:
|
|
356
|
+
"""Adds a new validation rapid to the specified validation set.
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
:param add_validation_text_rapid_model: The model containing the information needed to add the validation rapid.
|
|
360
|
+
:type add_validation_text_rapid_model: AddValidationTextRapidModel
|
|
361
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
362
|
+
number provided, it will be total request
|
|
363
|
+
timeout. It can also be a pair (tuple) of
|
|
364
|
+
(connection, read) timeouts.
|
|
365
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
366
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
367
|
+
request; this effectively ignores the
|
|
368
|
+
authentication in the spec for a single request.
|
|
369
|
+
:type _request_auth: dict, optional
|
|
370
|
+
:param _content_type: force content-type for the request.
|
|
371
|
+
:type _content_type: str, Optional
|
|
372
|
+
:param _headers: set to override the headers for a single
|
|
373
|
+
request; this effectively ignores the headers
|
|
374
|
+
in the spec for a single request.
|
|
375
|
+
:type _headers: dict, optional
|
|
376
|
+
:param _host_index: set to override the host_index for a single
|
|
377
|
+
request; this effectively ignores the host_index
|
|
378
|
+
in the spec for a single request.
|
|
379
|
+
:type _host_index: int, optional
|
|
380
|
+
:return: Returns the result object.
|
|
381
|
+
""" # noqa: E501
|
|
382
|
+
|
|
383
|
+
_param = self._validation_add_validation_text_rapid_post_serialize(
|
|
384
|
+
add_validation_text_rapid_model=add_validation_text_rapid_model,
|
|
385
|
+
_request_auth=_request_auth,
|
|
386
|
+
_content_type=_content_type,
|
|
387
|
+
_headers=_headers,
|
|
388
|
+
_host_index=_host_index
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
392
|
+
'200': "AddValidationRapidResult",
|
|
393
|
+
}
|
|
394
|
+
response_data = self.api_client.call_api(
|
|
395
|
+
*_param,
|
|
396
|
+
_request_timeout=_request_timeout
|
|
397
|
+
)
|
|
398
|
+
response_data.read()
|
|
399
|
+
return self.api_client.response_deserialize(
|
|
400
|
+
response_data=response_data,
|
|
401
|
+
response_types_map=_response_types_map,
|
|
402
|
+
).data
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
@validate_call
|
|
406
|
+
def validation_add_validation_text_rapid_post_with_http_info(
|
|
407
|
+
self,
|
|
408
|
+
add_validation_text_rapid_model: Annotated[Optional[AddValidationTextRapidModel], Field(description="The model containing the information needed to add the validation rapid.")] = None,
|
|
409
|
+
_request_timeout: Union[
|
|
410
|
+
None,
|
|
411
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
412
|
+
Tuple[
|
|
413
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
414
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
415
|
+
]
|
|
416
|
+
] = None,
|
|
417
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
418
|
+
_content_type: Optional[StrictStr] = None,
|
|
419
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
420
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
421
|
+
) -> ApiResponse[AddValidationRapidResult]:
|
|
422
|
+
"""Adds a new validation rapid to the specified validation set.
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
:param add_validation_text_rapid_model: The model containing the information needed to add the validation rapid.
|
|
426
|
+
:type add_validation_text_rapid_model: AddValidationTextRapidModel
|
|
427
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
428
|
+
number provided, it will be total request
|
|
429
|
+
timeout. It can also be a pair (tuple) of
|
|
430
|
+
(connection, read) timeouts.
|
|
431
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
432
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
433
|
+
request; this effectively ignores the
|
|
434
|
+
authentication in the spec for a single request.
|
|
435
|
+
:type _request_auth: dict, optional
|
|
436
|
+
:param _content_type: force content-type for the request.
|
|
437
|
+
:type _content_type: str, Optional
|
|
438
|
+
:param _headers: set to override the headers for a single
|
|
439
|
+
request; this effectively ignores the headers
|
|
440
|
+
in the spec for a single request.
|
|
441
|
+
:type _headers: dict, optional
|
|
442
|
+
:param _host_index: set to override the host_index for a single
|
|
443
|
+
request; this effectively ignores the host_index
|
|
444
|
+
in the spec for a single request.
|
|
445
|
+
:type _host_index: int, optional
|
|
446
|
+
:return: Returns the result object.
|
|
447
|
+
""" # noqa: E501
|
|
448
|
+
|
|
449
|
+
_param = self._validation_add_validation_text_rapid_post_serialize(
|
|
450
|
+
add_validation_text_rapid_model=add_validation_text_rapid_model,
|
|
451
|
+
_request_auth=_request_auth,
|
|
452
|
+
_content_type=_content_type,
|
|
453
|
+
_headers=_headers,
|
|
454
|
+
_host_index=_host_index
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
458
|
+
'200': "AddValidationRapidResult",
|
|
459
|
+
}
|
|
460
|
+
response_data = self.api_client.call_api(
|
|
461
|
+
*_param,
|
|
462
|
+
_request_timeout=_request_timeout
|
|
463
|
+
)
|
|
464
|
+
response_data.read()
|
|
465
|
+
return self.api_client.response_deserialize(
|
|
466
|
+
response_data=response_data,
|
|
467
|
+
response_types_map=_response_types_map,
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
@validate_call
|
|
472
|
+
def validation_add_validation_text_rapid_post_without_preload_content(
|
|
473
|
+
self,
|
|
474
|
+
add_validation_text_rapid_model: Annotated[Optional[AddValidationTextRapidModel], Field(description="The model containing the information needed to add the validation rapid.")] = None,
|
|
475
|
+
_request_timeout: Union[
|
|
476
|
+
None,
|
|
477
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
478
|
+
Tuple[
|
|
479
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
480
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
481
|
+
]
|
|
482
|
+
] = None,
|
|
483
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
484
|
+
_content_type: Optional[StrictStr] = None,
|
|
485
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
486
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
487
|
+
) -> RESTResponseType:
|
|
488
|
+
"""Adds a new validation rapid to the specified validation set.
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
:param add_validation_text_rapid_model: The model containing the information needed to add the validation rapid.
|
|
492
|
+
:type add_validation_text_rapid_model: AddValidationTextRapidModel
|
|
493
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
494
|
+
number provided, it will be total request
|
|
495
|
+
timeout. It can also be a pair (tuple) of
|
|
496
|
+
(connection, read) timeouts.
|
|
497
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
498
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
499
|
+
request; this effectively ignores the
|
|
500
|
+
authentication in the spec for a single request.
|
|
501
|
+
:type _request_auth: dict, optional
|
|
502
|
+
:param _content_type: force content-type for the request.
|
|
503
|
+
:type _content_type: str, Optional
|
|
504
|
+
:param _headers: set to override the headers for a single
|
|
505
|
+
request; this effectively ignores the headers
|
|
506
|
+
in the spec for a single request.
|
|
507
|
+
:type _headers: dict, optional
|
|
508
|
+
:param _host_index: set to override the host_index for a single
|
|
509
|
+
request; this effectively ignores the host_index
|
|
510
|
+
in the spec for a single request.
|
|
511
|
+
:type _host_index: int, optional
|
|
512
|
+
:return: Returns the result object.
|
|
513
|
+
""" # noqa: E501
|
|
514
|
+
|
|
515
|
+
_param = self._validation_add_validation_text_rapid_post_serialize(
|
|
516
|
+
add_validation_text_rapid_model=add_validation_text_rapid_model,
|
|
517
|
+
_request_auth=_request_auth,
|
|
518
|
+
_content_type=_content_type,
|
|
519
|
+
_headers=_headers,
|
|
520
|
+
_host_index=_host_index
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
524
|
+
'200': "AddValidationRapidResult",
|
|
525
|
+
}
|
|
526
|
+
response_data = self.api_client.call_api(
|
|
527
|
+
*_param,
|
|
528
|
+
_request_timeout=_request_timeout
|
|
529
|
+
)
|
|
530
|
+
return response_data.response
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
def _validation_add_validation_text_rapid_post_serialize(
|
|
534
|
+
self,
|
|
535
|
+
add_validation_text_rapid_model,
|
|
536
|
+
_request_auth,
|
|
537
|
+
_content_type,
|
|
538
|
+
_headers,
|
|
539
|
+
_host_index,
|
|
540
|
+
) -> RequestSerialized:
|
|
541
|
+
|
|
542
|
+
_host = None
|
|
543
|
+
|
|
544
|
+
_collection_formats: Dict[str, str] = {
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
_path_params: Dict[str, str] = {}
|
|
548
|
+
_query_params: List[Tuple[str, str]] = []
|
|
549
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
550
|
+
_form_params: List[Tuple[str, str]] = []
|
|
551
|
+
_files: Dict[
|
|
552
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
553
|
+
] = {}
|
|
554
|
+
_body_params: Optional[bytes] = None
|
|
555
|
+
|
|
556
|
+
# process the path parameters
|
|
557
|
+
# process the query parameters
|
|
558
|
+
# process the header parameters
|
|
559
|
+
# process the form parameters
|
|
560
|
+
# process the body parameter
|
|
561
|
+
if add_validation_text_rapid_model is not None:
|
|
562
|
+
_body_params = add_validation_text_rapid_model
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
# set the HTTP header `Accept`
|
|
566
|
+
if 'Accept' not in _header_params:
|
|
567
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
568
|
+
[
|
|
569
|
+
'text/plain',
|
|
570
|
+
'application/json',
|
|
571
|
+
'text/json'
|
|
572
|
+
]
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
# set the HTTP header `Content-Type`
|
|
576
|
+
if _content_type:
|
|
577
|
+
_header_params['Content-Type'] = _content_type
|
|
578
|
+
else:
|
|
579
|
+
_default_content_type = (
|
|
580
|
+
self.api_client.select_header_content_type(
|
|
581
|
+
[
|
|
582
|
+
'application/json',
|
|
583
|
+
'text/json',
|
|
584
|
+
'application/*+json'
|
|
585
|
+
]
|
|
586
|
+
)
|
|
587
|
+
)
|
|
588
|
+
if _default_content_type is not None:
|
|
589
|
+
_header_params['Content-Type'] = _default_content_type
|
|
590
|
+
|
|
591
|
+
# authentication setting
|
|
592
|
+
_auth_settings: List[str] = [
|
|
593
|
+
'bearer'
|
|
594
|
+
]
|
|
595
|
+
|
|
596
|
+
return self.api_client.param_serialize(
|
|
597
|
+
method='POST',
|
|
598
|
+
resource_path='/Validation/AddValidationTextRapid',
|
|
599
|
+
path_params=_path_params,
|
|
600
|
+
query_params=_query_params,
|
|
601
|
+
header_params=_header_params,
|
|
602
|
+
body=_body_params,
|
|
603
|
+
post_params=_form_params,
|
|
604
|
+
files=_files,
|
|
605
|
+
auth_settings=_auth_settings,
|
|
606
|
+
collection_formats=_collection_formats,
|
|
607
|
+
_host=_host,
|
|
608
|
+
_request_auth=_request_auth
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
338
614
|
@validate_call
|
|
339
615
|
def validation_create_validation_set_post(
|
|
340
616
|
self,
|
|
@@ -20,6 +20,7 @@ from rapidata.api_client.models.add_validation_rapid_model import AddValidationR
|
|
|
20
20
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
21
21
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_result import AddValidationRapidResult
|
|
23
|
+
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
23
24
|
from rapidata.api_client.models.admin_order_model import AdminOrderModel
|
|
24
25
|
from rapidata.api_client.models.admin_order_model_paged_result import AdminOrderModelPagedResult
|
|
25
26
|
from rapidata.api_client.models.age_group import AgeGroup
|
|
@@ -39,6 +40,8 @@ from rapidata.api_client.models.campaign_query_model import CampaignQueryModel
|
|
|
39
40
|
from rapidata.api_client.models.campaign_query_model_paged_result import CampaignQueryModelPagedResult
|
|
40
41
|
from rapidata.api_client.models.campaign_status import CampaignStatus
|
|
41
42
|
from rapidata.api_client.models.campaign_user_filter_model import CampaignUserFilterModel
|
|
43
|
+
from rapidata.api_client.models.capped_selection import CappedSelection
|
|
44
|
+
from rapidata.api_client.models.capped_selection_selections_inner import CappedSelectionSelectionsInner
|
|
42
45
|
from rapidata.api_client.models.classification_metadata import ClassificationMetadata
|
|
43
46
|
from rapidata.api_client.models.classification_metadata_filter_config import ClassificationMetadataFilterConfig
|
|
44
47
|
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
@@ -74,7 +77,6 @@ from rapidata.api_client.models.create_independent_workflow_model_workflow_confi
|
|
|
74
77
|
from rapidata.api_client.models.create_independent_workflow_result import CreateIndependentWorkflowResult
|
|
75
78
|
from rapidata.api_client.models.create_order_model import CreateOrderModel
|
|
76
79
|
from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
|
|
77
|
-
from rapidata.api_client.models.create_order_model_selections_inner import CreateOrderModelSelectionsInner
|
|
78
80
|
from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
|
|
79
81
|
from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
|
|
80
82
|
from rapidata.api_client.models.create_order_result import CreateOrderResult
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.capped_selection_selections_inner import CappedSelectionSelectionsInner
|
|
23
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
|
|
@@ -35,7 +35,7 @@ class AddCampaignModel(BaseModel):
|
|
|
35
35
|
campaign_name: StrictStr = Field(description="The name of the campaign.", alias="campaignName")
|
|
36
36
|
user_filters: List[CreateOrderModelUserFiltersInner] = Field(description="The user filters to apply to the campaign.", alias="userFilters")
|
|
37
37
|
validation_set_id: Optional[StrictStr] = Field(default=None, description="A validation set that should be used.", alias="validationSetId")
|
|
38
|
-
selections: Optional[List[
|
|
38
|
+
selections: Optional[List[CappedSelectionSelectionsInner]] = Field(description="The selections that the campaign should have.")
|
|
39
39
|
feature_flags: List[FeatureFlag] = Field(description="The feature flags that should be applied to the campaign.", alias="featureFlags")
|
|
40
40
|
priority: StrictInt = Field(description="The priority of the campaign.")
|
|
41
41
|
__properties: ClassVar[List[str]] = ["_t", "pipelineId", "artifactId", "campaignName", "userFilters", "validationSetId", "selections", "featureFlags", "priority"]
|
|
@@ -140,7 +140,7 @@ class AddCampaignModel(BaseModel):
|
|
|
140
140
|
"campaignName": obj.get("campaignName"),
|
|
141
141
|
"userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
|
|
142
142
|
"validationSetId": obj.get("validationSetId"),
|
|
143
|
-
"selections": [
|
|
143
|
+
"selections": [CappedSelectionSelectionsInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None,
|
|
144
144
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
145
145
|
"priority": obj.get("priority")
|
|
146
146
|
})
|
|
@@ -0,0 +1,118 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
23
|
+
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
24
|
+
from rapidata.api_client.models.datapoint_metadata_model_metadata_inner import DatapointMetadataModelMetadataInner
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class AddValidationTextRapidModel(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The model for adding a validation rapid.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
validation_set_id: StrictStr = Field(description="The ID of the validation set to add the rapid to.", alias="validationSetId")
|
|
33
|
+
payload: AddValidationRapidModelPayload
|
|
34
|
+
metadata: List[DatapointMetadataModelMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
35
|
+
truth: AddValidationRapidModelTruth
|
|
36
|
+
text: StrictStr
|
|
37
|
+
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["validationSetId", "payload", "metadata", "truth", "text", "randomCorrectProbability"]
|
|
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 AddValidationTextRapidModel 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
|
+
# override the default output from pydantic by calling `to_dict()` of payload
|
|
80
|
+
if self.payload:
|
|
81
|
+
_dict['payload'] = self.payload.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.metadata:
|
|
85
|
+
for _item_metadata in self.metadata:
|
|
86
|
+
if _item_metadata:
|
|
87
|
+
_items.append(_item_metadata.to_dict())
|
|
88
|
+
_dict['metadata'] = _items
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of truth
|
|
90
|
+
if self.truth:
|
|
91
|
+
_dict['truth'] = self.truth.to_dict()
|
|
92
|
+
# set to None if random_correct_probability (nullable) is None
|
|
93
|
+
# and model_fields_set contains the field
|
|
94
|
+
if self.random_correct_probability is None and "random_correct_probability" in self.model_fields_set:
|
|
95
|
+
_dict['randomCorrectProbability'] = None
|
|
96
|
+
|
|
97
|
+
return _dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
101
|
+
"""Create an instance of AddValidationTextRapidModel from a dict"""
|
|
102
|
+
if obj is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
if not isinstance(obj, dict):
|
|
106
|
+
return cls.model_validate(obj)
|
|
107
|
+
|
|
108
|
+
_obj = cls.model_validate({
|
|
109
|
+
"validationSetId": obj.get("validationSetId"),
|
|
110
|
+
"payload": AddValidationRapidModelPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
111
|
+
"metadata": [DatapointMetadataModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
112
|
+
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
113
|
+
"text": obj.get("text"),
|
|
114
|
+
"randomCorrectProbability": obj.get("randomCorrectProbability")
|
|
115
|
+
})
|
|
116
|
+
return _obj
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
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, 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 CappedSelection(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CappedSelection
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for CappedSelection", alias="_t")
|
|
30
|
+
selections: List[CappedSelectionSelectionsInner]
|
|
31
|
+
max_rapids: StrictInt = Field(alias="maxRapids")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "selections", "maxRapids"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['CappedSelection']):
|
|
38
|
+
raise ValueError("must be one of enum values ('CappedSelection')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of CappedSelection from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in selections (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.selections:
|
|
83
|
+
for _item_selections in self.selections:
|
|
84
|
+
if _item_selections:
|
|
85
|
+
_items.append(_item_selections.to_dict())
|
|
86
|
+
_dict['selections'] = _items
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of CappedSelection from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CappedSelection',
|
|
100
|
+
"selections": [CappedSelectionSelectionsInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None,
|
|
101
|
+
"maxRapids": obj.get("maxRapids")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
from rapidata.api_client.models.capped_selection_selections_inner import CappedSelectionSelectionsInner
|
|
106
|
+
# TODO: Rewrite to not use raise_errors
|
|
107
|
+
CappedSelection.model_rebuild(raise_errors=False)
|
|
108
|
+
|