rapidata 2.36.1__py3-none-any.whl → 2.36.2__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 +2 -2
- rapidata/api_client/__init__.py +2 -4
- rapidata/api_client/api/validation_set_api.py +54 -31
- rapidata/api_client/models/__init__.py +2 -4
- rapidata/api_client/models/add_validation_rapid_model.py +17 -2
- rapidata/api_client/models/asset_metadata.py +9 -1
- rapidata/api_client/models/boost_query_result.py +5 -17
- rapidata/api_client/models/campaign_query_result.py +3 -9
- rapidata/api_client/models/classification_metadata.py +12 -1
- rapidata/api_client/models/compare_workflow_config.py +22 -12
- rapidata/api_client/models/compare_workflow_config_model.py +12 -2
- rapidata/api_client/models/compare_workflow_model.py +12 -2
- rapidata/api_client/models/count_metadata.py +12 -1
- rapidata/api_client/models/create_demographic_rapid_model.py +18 -3
- rapidata/api_client/models/create_order_model.py +6 -48
- rapidata/api_client/models/effort_capped_selection.py +2 -11
- rapidata/api_client/models/evaluation_workflow_config.py +13 -3
- rapidata/api_client/models/evaluation_workflow_model.py +13 -3
- rapidata/api_client/models/file_type_metadata.py +11 -6
- rapidata/api_client/models/file_type_metadata_model.py +2 -8
- rapidata/api_client/models/filter.py +5 -23
- rapidata/api_client/models/get_datapoint_by_id_result.py +3 -9
- rapidata/api_client/models/get_rapid_responses_result.py +3 -9
- rapidata/api_client/models/get_recommended_validation_set_result.py +95 -0
- rapidata/api_client/models/get_standing_by_id_result.py +3 -9
- rapidata/api_client/models/get_validation_rapids_result.py +3 -9
- rapidata/api_client/models/get_workflow_progress_result.py +3 -9
- rapidata/api_client/models/get_workflow_results_result.py +3 -9
- rapidata/api_client/models/image_dimension_metadata.py +12 -1
- rapidata/api_client/models/labeling_selection.py +2 -11
- rapidata/api_client/models/location_metadata.py +12 -1
- rapidata/api_client/models/order_model.py +3 -9
- rapidata/api_client/models/original_filename_metadata.py +12 -1
- rapidata/api_client/models/participant_by_benchmark.py +3 -9
- rapidata/api_client/models/prompt_metadata.py +12 -1
- rapidata/api_client/models/rapid_model.py +3 -9
- rapidata/api_client/models/report_model.py +3 -9
- rapidata/api_client/models/response_count_filter.py +2 -8
- rapidata/api_client/models/response_count_user_filter_model.py +2 -8
- rapidata/api_client/models/root_filter.py +3 -12
- rapidata/api_client/models/runs_by_leaderboard_result.py +3 -9
- rapidata/api_client/models/simple_workflow_config.py +13 -3
- rapidata/api_client/models/simple_workflow_config_model.py +11 -3
- rapidata/api_client/models/simple_workflow_model.py +13 -3
- rapidata/api_client/models/sort_criterion.py +3 -9
- rapidata/api_client/models/source_url_metadata.py +12 -1
- rapidata/api_client/models/standing_by_leaderboard.py +3 -9
- rapidata/api_client/models/streams_metadata.py +12 -1
- rapidata/api_client/models/text_metadata.py +12 -1
- rapidata/api_client/models/transcription_metadata.py +9 -1
- rapidata/api_client/models/update_should_alert_model.py +1 -1
- rapidata/api_client/models/validation_set_model.py +12 -24
- rapidata/api_client/models/video_duration_metadata.py +12 -1
- rapidata/api_client/models/workflow_aggregation_step_model.py +3 -12
- rapidata/api_client_README.md +2 -4
- rapidata/rapidata_client/__init__.py +1 -1
- rapidata/rapidata_client/benchmark/participant/_participant.py +5 -5
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +2 -1
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +10 -2
- rapidata/rapidata_client/config/__init__.py +1 -1
- rapidata/rapidata_client/config/rapidata_config.py +31 -0
- rapidata/rapidata_client/datapoints/__init__.py +10 -2
- rapidata/rapidata_client/datapoints/{datapoint.py → _datapoint.py} +105 -17
- rapidata/rapidata_client/datapoints/assets/_media_asset.py +80 -68
- rapidata/rapidata_client/datapoints/assets/_sessions.py +3 -3
- rapidata/rapidata_client/datapoints/assets/constants.py +7 -0
- rapidata/rapidata_client/exceptions/failed_upload_exception.py +42 -13
- rapidata/rapidata_client/filter/response_count_filter.py +16 -11
- rapidata/rapidata_client/order/_rapidata_dataset.py +8 -8
- rapidata/rapidata_client/order/_rapidata_order_builder.py +87 -8
- rapidata/rapidata_client/order/rapidata_order_manager.py +18 -4
- rapidata/rapidata_client/rapidata_client.py +6 -0
- rapidata/rapidata_client/selection/__init__.py +1 -1
- rapidata/rapidata_client/selection/effort_selection.py +18 -7
- rapidata/rapidata_client/selection/labeling_selection.py +19 -7
- rapidata/rapidata_client/selection/{retrieval_modes.py → rapidata_retrieval_modes.py} +7 -4
- rapidata/rapidata_client/validation/rapidata_validation_set.py +26 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +46 -19
- rapidata/rapidata_client/validation/validation_set_manager.py +41 -4
- rapidata/rapidata_client/workflow/_base_workflow.py +27 -0
- rapidata/rapidata_client/workflow/_classify_workflow.py +25 -9
- rapidata/rapidata_client/workflow/_compare_workflow.py +11 -0
- rapidata/rapidata_client/workflow/_draw_workflow.py +15 -7
- rapidata/rapidata_client/workflow/_evaluation_workflow.py +8 -1
- rapidata/rapidata_client/workflow/_free_text_workflow.py +11 -0
- rapidata/rapidata_client/workflow/_locate_workflow.py +15 -7
- rapidata/rapidata_client/workflow/_ranking_workflow.py +39 -15
- rapidata/rapidata_client/workflow/_select_words_workflow.py +41 -7
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +17 -8
- rapidata/service/openapi_service.py +1 -1
- {rapidata-2.36.1.dist-info → rapidata-2.36.2.dist-info}/METADATA +1 -1
- {rapidata-2.36.1.dist-info → rapidata-2.36.2.dist-info}/RECORD +94 -92
- rapidata/rapidata_client/config/config.py +0 -33
- {rapidata-2.36.1.dist-info → rapidata-2.36.2.dist-info}/LICENSE +0 -0
- {rapidata-2.36.1.dist-info → rapidata-2.36.2.dist-info}/WHEEL +0 -0
rapidata/__init__.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
__version__ = "2.36.
|
|
1
|
+
__version__ = "2.36.2"
|
|
2
2
|
|
|
3
3
|
from .rapidata_client import (
|
|
4
4
|
RapidataClient,
|
|
5
5
|
DemographicSelection,
|
|
6
6
|
LabelingSelection,
|
|
7
7
|
EffortSelection,
|
|
8
|
-
|
|
8
|
+
RapidataRetrievalMode,
|
|
9
9
|
ValidationSelection,
|
|
10
10
|
ConditionalValidationSelection,
|
|
11
11
|
CappedSelection,
|
rapidata/api_client/__init__.py
CHANGED
|
@@ -72,7 +72,6 @@ from rapidata.api_client.models.are_rapids_active_result import AreRapidsActiveR
|
|
|
72
72
|
from rapidata.api_client.models.asset_metadata import AssetMetadata
|
|
73
73
|
from rapidata.api_client.models.asset_metadata_asset import AssetMetadataAsset
|
|
74
74
|
from rapidata.api_client.models.asset_metadata_model import AssetMetadataModel
|
|
75
|
-
from rapidata.api_client.models.asset_type import AssetType
|
|
76
75
|
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
77
76
|
from rapidata.api_client.models.attach_category_result import AttachCategoryResult
|
|
78
77
|
from rapidata.api_client.models.attach_category_truth import AttachCategoryTruth
|
|
@@ -223,6 +222,7 @@ from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import
|
|
|
223
222
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
224
223
|
from rapidata.api_client.models.get_public_responses_result import GetPublicResponsesResult
|
|
225
224
|
from rapidata.api_client.models.get_rapid_responses_result import GetRapidResponsesResult
|
|
225
|
+
from rapidata.api_client.models.get_recommended_validation_set_result import GetRecommendedValidationSetResult
|
|
226
226
|
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
227
227
|
from rapidata.api_client.models.get_sample_by_id_result import GetSampleByIdResult
|
|
228
228
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
@@ -268,7 +268,6 @@ from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
|
268
268
|
from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
|
|
269
269
|
from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
|
|
270
270
|
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
271
|
-
from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
|
|
272
271
|
from rapidata.api_client.models.multi_asset import MultiAsset
|
|
273
272
|
from rapidata.api_client.models.multi_asset_input import MultiAssetInput
|
|
274
273
|
from rapidata.api_client.models.multi_asset_input1 import MultiAssetInput1
|
|
@@ -325,6 +324,7 @@ from rapidata.api_client.models.preview_order_model import PreviewOrderModel
|
|
|
325
324
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
326
325
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
327
326
|
from rapidata.api_client.models.probabilistic_attach_category_referee_info import ProbabilisticAttachCategoryRefereeInfo
|
|
327
|
+
from rapidata.api_client.models.problem_details import ProblemDetails
|
|
328
328
|
from rapidata.api_client.models.prompt_asset_metadata_input import PromptAssetMetadataInput
|
|
329
329
|
from rapidata.api_client.models.prompt_asset_metadata_input_asset import PromptAssetMetadataInputAsset
|
|
330
330
|
from rapidata.api_client.models.prompt_by_benchmark_result import PromptByBenchmarkResult
|
|
@@ -332,7 +332,6 @@ from rapidata.api_client.models.prompt_by_benchmark_result_paged_result import P
|
|
|
332
332
|
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
333
333
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
334
334
|
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
335
|
-
from rapidata.api_client.models.prompt_type import PromptType
|
|
336
335
|
from rapidata.api_client.models.proxy_file_wrapper import ProxyFileWrapper
|
|
337
336
|
from rapidata.api_client.models.public_order_model import PublicOrderModel
|
|
338
337
|
from rapidata.api_client.models.public_rapid_response import PublicRapidResponse
|
|
@@ -340,7 +339,6 @@ from rapidata.api_client.models.public_text_metadata_input import PublicTextMeta
|
|
|
340
339
|
from rapidata.api_client.models.query_model import QueryModel
|
|
341
340
|
from rapidata.api_client.models.query_validation_model import QueryValidationModel
|
|
342
341
|
from rapidata.api_client.models.rapid_issue import RapidIssue
|
|
343
|
-
from rapidata.api_client.models.rapid_modality import RapidModality
|
|
344
342
|
from rapidata.api_client.models.rapid_model import RapidModel
|
|
345
343
|
from rapidata.api_client.models.rapid_model_paged_result import RapidModelPagedResult
|
|
346
344
|
from rapidata.api_client.models.rapid_model_referee import RapidModelReferee
|
|
@@ -16,24 +16,21 @@ 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, StrictBytes, StrictStr
|
|
19
|
+
from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator
|
|
20
20
|
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.asset_type import AssetType
|
|
25
24
|
from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
|
|
26
25
|
from rapidata.api_client.models.create_validation_set_model import CreateValidationSetModel
|
|
27
26
|
from rapidata.api_client.models.get_available_validation_sets_result import GetAvailableValidationSetsResult
|
|
27
|
+
from rapidata.api_client.models.get_recommended_validation_set_result import GetRecommendedValidationSetResult
|
|
28
28
|
from rapidata.api_client.models.get_validation_rapids_result_paged_result import GetValidationRapidsResultPagedResult
|
|
29
29
|
from rapidata.api_client.models.get_validation_set_by_id_result import GetValidationSetByIdResult
|
|
30
30
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
31
|
-
from rapidata.api_client.models.prompt_type import PromptType
|
|
32
31
|
from rapidata.api_client.models.query_model import QueryModel
|
|
33
|
-
from rapidata.api_client.models.rapid_modality import RapidModality
|
|
34
32
|
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
35
33
|
from rapidata.api_client.models.update_should_alert_model import UpdateShouldAlertModel
|
|
36
|
-
from rapidata.api_client.models.validation_set_model import ValidationSetModel
|
|
37
34
|
from rapidata.api_client.models.validation_set_model_paged_result import ValidationSetModelPagedResult
|
|
38
35
|
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import ValidationSetZipPostRequestBlueprint
|
|
39
36
|
|
|
@@ -334,9 +331,10 @@ class ValidationSetApi:
|
|
|
334
331
|
@validate_call
|
|
335
332
|
def validation_set_recommended_get(
|
|
336
333
|
self,
|
|
337
|
-
asset_type: Annotated[Optional[
|
|
338
|
-
modality: Annotated[Optional[
|
|
339
|
-
prompt_type: Annotated[Optional[
|
|
334
|
+
asset_type: Annotated[Optional[List[StrictStr]], Field(description="The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.")] = None,
|
|
335
|
+
modality: Annotated[Optional[List[StrictStr]], Field(description="The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.")] = None,
|
|
336
|
+
prompt_type: Annotated[Optional[List[StrictStr]], Field(description="The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.")] = None,
|
|
337
|
+
instruction: Annotated[Optional[StrictStr], Field(description="An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.")] = None,
|
|
340
338
|
_request_timeout: Union[
|
|
341
339
|
None,
|
|
342
340
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -349,16 +347,19 @@ class ValidationSetApi:
|
|
|
349
347
|
_content_type: Optional[StrictStr] = None,
|
|
350
348
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
351
349
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
352
|
-
) ->
|
|
350
|
+
) -> GetRecommendedValidationSetResult:
|
|
353
351
|
"""Gets a validation set that is available to the user and best matches the provided parameters.
|
|
354
352
|
|
|
353
|
+
This is not a hard filter, instead it is used to find validation sets that have similar characteristics to the provided instruction.
|
|
355
354
|
|
|
356
355
|
:param asset_type: The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.
|
|
357
|
-
:type asset_type:
|
|
356
|
+
:type asset_type: List[str]
|
|
358
357
|
:param modality: The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.
|
|
359
|
-
:type modality:
|
|
358
|
+
:type modality: List[str]
|
|
360
359
|
:param prompt_type: The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.
|
|
361
|
-
:type prompt_type:
|
|
360
|
+
:type prompt_type: List[str]
|
|
361
|
+
:param instruction: An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.
|
|
362
|
+
:type instruction: str
|
|
362
363
|
:param _request_timeout: timeout setting for this request. If one
|
|
363
364
|
number provided, it will be total request
|
|
364
365
|
timeout. It can also be a pair (tuple) of
|
|
@@ -385,6 +386,7 @@ class ValidationSetApi:
|
|
|
385
386
|
asset_type=asset_type,
|
|
386
387
|
modality=modality,
|
|
387
388
|
prompt_type=prompt_type,
|
|
389
|
+
instruction=instruction,
|
|
388
390
|
_request_auth=_request_auth,
|
|
389
391
|
_content_type=_content_type,
|
|
390
392
|
_headers=_headers,
|
|
@@ -392,7 +394,8 @@ class ValidationSetApi:
|
|
|
392
394
|
)
|
|
393
395
|
|
|
394
396
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
395
|
-
'200': "
|
|
397
|
+
'200': "GetRecommendedValidationSetResult",
|
|
398
|
+
'404': "ProblemDetails",
|
|
396
399
|
}
|
|
397
400
|
response_data = self.api_client.call_api(
|
|
398
401
|
*_param,
|
|
@@ -408,9 +411,10 @@ class ValidationSetApi:
|
|
|
408
411
|
@validate_call
|
|
409
412
|
def validation_set_recommended_get_with_http_info(
|
|
410
413
|
self,
|
|
411
|
-
asset_type: Annotated[Optional[
|
|
412
|
-
modality: Annotated[Optional[
|
|
413
|
-
prompt_type: Annotated[Optional[
|
|
414
|
+
asset_type: Annotated[Optional[List[StrictStr]], Field(description="The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.")] = None,
|
|
415
|
+
modality: Annotated[Optional[List[StrictStr]], Field(description="The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.")] = None,
|
|
416
|
+
prompt_type: Annotated[Optional[List[StrictStr]], Field(description="The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.")] = None,
|
|
417
|
+
instruction: Annotated[Optional[StrictStr], Field(description="An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.")] = None,
|
|
414
418
|
_request_timeout: Union[
|
|
415
419
|
None,
|
|
416
420
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -423,16 +427,19 @@ class ValidationSetApi:
|
|
|
423
427
|
_content_type: Optional[StrictStr] = None,
|
|
424
428
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
425
429
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
426
|
-
) -> ApiResponse[
|
|
430
|
+
) -> ApiResponse[GetRecommendedValidationSetResult]:
|
|
427
431
|
"""Gets a validation set that is available to the user and best matches the provided parameters.
|
|
428
432
|
|
|
433
|
+
This is not a hard filter, instead it is used to find validation sets that have similar characteristics to the provided instruction.
|
|
429
434
|
|
|
430
435
|
:param asset_type: The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.
|
|
431
|
-
:type asset_type:
|
|
436
|
+
:type asset_type: List[str]
|
|
432
437
|
:param modality: The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.
|
|
433
|
-
:type modality:
|
|
438
|
+
:type modality: List[str]
|
|
434
439
|
:param prompt_type: The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.
|
|
435
|
-
:type prompt_type:
|
|
440
|
+
:type prompt_type: List[str]
|
|
441
|
+
:param instruction: An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.
|
|
442
|
+
:type instruction: str
|
|
436
443
|
:param _request_timeout: timeout setting for this request. If one
|
|
437
444
|
number provided, it will be total request
|
|
438
445
|
timeout. It can also be a pair (tuple) of
|
|
@@ -459,6 +466,7 @@ class ValidationSetApi:
|
|
|
459
466
|
asset_type=asset_type,
|
|
460
467
|
modality=modality,
|
|
461
468
|
prompt_type=prompt_type,
|
|
469
|
+
instruction=instruction,
|
|
462
470
|
_request_auth=_request_auth,
|
|
463
471
|
_content_type=_content_type,
|
|
464
472
|
_headers=_headers,
|
|
@@ -466,7 +474,8 @@ class ValidationSetApi:
|
|
|
466
474
|
)
|
|
467
475
|
|
|
468
476
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
469
|
-
'200': "
|
|
477
|
+
'200': "GetRecommendedValidationSetResult",
|
|
478
|
+
'404': "ProblemDetails",
|
|
470
479
|
}
|
|
471
480
|
response_data = self.api_client.call_api(
|
|
472
481
|
*_param,
|
|
@@ -482,9 +491,10 @@ class ValidationSetApi:
|
|
|
482
491
|
@validate_call
|
|
483
492
|
def validation_set_recommended_get_without_preload_content(
|
|
484
493
|
self,
|
|
485
|
-
asset_type: Annotated[Optional[
|
|
486
|
-
modality: Annotated[Optional[
|
|
487
|
-
prompt_type: Annotated[Optional[
|
|
494
|
+
asset_type: Annotated[Optional[List[StrictStr]], Field(description="The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.")] = None,
|
|
495
|
+
modality: Annotated[Optional[List[StrictStr]], Field(description="The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.")] = None,
|
|
496
|
+
prompt_type: Annotated[Optional[List[StrictStr]], Field(description="The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.")] = None,
|
|
497
|
+
instruction: Annotated[Optional[StrictStr], Field(description="An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.")] = None,
|
|
488
498
|
_request_timeout: Union[
|
|
489
499
|
None,
|
|
490
500
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -500,13 +510,16 @@ class ValidationSetApi:
|
|
|
500
510
|
) -> RESTResponseType:
|
|
501
511
|
"""Gets a validation set that is available to the user and best matches the provided parameters.
|
|
502
512
|
|
|
513
|
+
This is not a hard filter, instead it is used to find validation sets that have similar characteristics to the provided instruction.
|
|
503
514
|
|
|
504
515
|
:param asset_type: The types of assets that the validation set should contain. An asset type can be an image, video, audio, text, or any combination of these. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified asset types.
|
|
505
|
-
:type asset_type:
|
|
516
|
+
:type asset_type: List[str]
|
|
506
517
|
:param modality: The rapid modalities that the validation set should contain. The modality is the type of rapid such as classify, compare, locate, etc. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified modalities.
|
|
507
|
-
:type modality:
|
|
518
|
+
:type modality: List[str]
|
|
508
519
|
:param prompt_type: The prompt types that the validation set should contain. A prompt type is the additional information that is presented to the user when solving a rapid. For example, a prompt type can be either text or an asset if the context is an image or video. <para /> This parameter is a flag, meaning that it can be null or contain multiple values. If multiple values are provided, a validation set will be chosen that contains at least one of the specified prompt types.
|
|
509
|
-
:type prompt_type:
|
|
520
|
+
:type prompt_type: List[str]
|
|
521
|
+
:param instruction: An instruction that can be used to filter for validation sets that have similar instructions. An instruction is a text that is presented to the user when solving a rapid that explains how to solve the rapid.
|
|
522
|
+
:type instruction: str
|
|
510
523
|
:param _request_timeout: timeout setting for this request. If one
|
|
511
524
|
number provided, it will be total request
|
|
512
525
|
timeout. It can also be a pair (tuple) of
|
|
@@ -533,6 +546,7 @@ class ValidationSetApi:
|
|
|
533
546
|
asset_type=asset_type,
|
|
534
547
|
modality=modality,
|
|
535
548
|
prompt_type=prompt_type,
|
|
549
|
+
instruction=instruction,
|
|
536
550
|
_request_auth=_request_auth,
|
|
537
551
|
_content_type=_content_type,
|
|
538
552
|
_headers=_headers,
|
|
@@ -540,7 +554,8 @@ class ValidationSetApi:
|
|
|
540
554
|
)
|
|
541
555
|
|
|
542
556
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
543
|
-
'200': "
|
|
557
|
+
'200': "GetRecommendedValidationSetResult",
|
|
558
|
+
'404': "ProblemDetails",
|
|
544
559
|
}
|
|
545
560
|
response_data = self.api_client.call_api(
|
|
546
561
|
*_param,
|
|
@@ -554,6 +569,7 @@ class ValidationSetApi:
|
|
|
554
569
|
asset_type,
|
|
555
570
|
modality,
|
|
556
571
|
prompt_type,
|
|
572
|
+
instruction,
|
|
557
573
|
_request_auth,
|
|
558
574
|
_content_type,
|
|
559
575
|
_headers,
|
|
@@ -563,6 +579,9 @@ class ValidationSetApi:
|
|
|
563
579
|
_host = None
|
|
564
580
|
|
|
565
581
|
_collection_formats: Dict[str, str] = {
|
|
582
|
+
'assetType': 'multi',
|
|
583
|
+
'modality': 'multi',
|
|
584
|
+
'promptType': 'multi',
|
|
566
585
|
}
|
|
567
586
|
|
|
568
587
|
_path_params: Dict[str, str] = {}
|
|
@@ -578,15 +597,19 @@ class ValidationSetApi:
|
|
|
578
597
|
# process the query parameters
|
|
579
598
|
if asset_type is not None:
|
|
580
599
|
|
|
581
|
-
_query_params.append(('assetType', asset_type
|
|
600
|
+
_query_params.append(('assetType', asset_type))
|
|
582
601
|
|
|
583
602
|
if modality is not None:
|
|
584
603
|
|
|
585
|
-
_query_params.append(('modality', modality
|
|
604
|
+
_query_params.append(('modality', modality))
|
|
586
605
|
|
|
587
606
|
if prompt_type is not None:
|
|
588
607
|
|
|
589
|
-
_query_params.append(('promptType', prompt_type
|
|
608
|
+
_query_params.append(('promptType', prompt_type))
|
|
609
|
+
|
|
610
|
+
if instruction is not None:
|
|
611
|
+
|
|
612
|
+
_query_params.append(('instruction', instruction))
|
|
590
613
|
|
|
591
614
|
# process the header parameters
|
|
592
615
|
# process the form parameters
|
|
@@ -32,7 +32,6 @@ from rapidata.api_client.models.are_rapids_active_result import AreRapidsActiveR
|
|
|
32
32
|
from rapidata.api_client.models.asset_metadata import AssetMetadata
|
|
33
33
|
from rapidata.api_client.models.asset_metadata_asset import AssetMetadataAsset
|
|
34
34
|
from rapidata.api_client.models.asset_metadata_model import AssetMetadataModel
|
|
35
|
-
from rapidata.api_client.models.asset_type import AssetType
|
|
36
35
|
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
37
36
|
from rapidata.api_client.models.attach_category_result import AttachCategoryResult
|
|
38
37
|
from rapidata.api_client.models.attach_category_truth import AttachCategoryTruth
|
|
@@ -183,6 +182,7 @@ from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import
|
|
|
183
182
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
184
183
|
from rapidata.api_client.models.get_public_responses_result import GetPublicResponsesResult
|
|
185
184
|
from rapidata.api_client.models.get_rapid_responses_result import GetRapidResponsesResult
|
|
185
|
+
from rapidata.api_client.models.get_recommended_validation_set_result import GetRecommendedValidationSetResult
|
|
186
186
|
from rapidata.api_client.models.get_responses_result import GetResponsesResult
|
|
187
187
|
from rapidata.api_client.models.get_sample_by_id_result import GetSampleByIdResult
|
|
188
188
|
from rapidata.api_client.models.get_simple_workflow_results_model import GetSimpleWorkflowResultsModel
|
|
@@ -228,7 +228,6 @@ from rapidata.api_client.models.location_metadata import LocationMetadata
|
|
|
228
228
|
from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
|
|
229
229
|
from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
|
|
230
230
|
from rapidata.api_client.models.logic_operator import LogicOperator
|
|
231
|
-
from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
|
|
232
231
|
from rapidata.api_client.models.multi_asset import MultiAsset
|
|
233
232
|
from rapidata.api_client.models.multi_asset_input import MultiAssetInput
|
|
234
233
|
from rapidata.api_client.models.multi_asset_input1 import MultiAssetInput1
|
|
@@ -285,6 +284,7 @@ from rapidata.api_client.models.preview_order_model import PreviewOrderModel
|
|
|
285
284
|
from rapidata.api_client.models.private_text_metadata_input import PrivateTextMetadataInput
|
|
286
285
|
from rapidata.api_client.models.probabilistic_attach_category_referee_config import ProbabilisticAttachCategoryRefereeConfig
|
|
287
286
|
from rapidata.api_client.models.probabilistic_attach_category_referee_info import ProbabilisticAttachCategoryRefereeInfo
|
|
287
|
+
from rapidata.api_client.models.problem_details import ProblemDetails
|
|
288
288
|
from rapidata.api_client.models.prompt_asset_metadata_input import PromptAssetMetadataInput
|
|
289
289
|
from rapidata.api_client.models.prompt_asset_metadata_input_asset import PromptAssetMetadataInputAsset
|
|
290
290
|
from rapidata.api_client.models.prompt_by_benchmark_result import PromptByBenchmarkResult
|
|
@@ -292,7 +292,6 @@ from rapidata.api_client.models.prompt_by_benchmark_result_paged_result import P
|
|
|
292
292
|
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
293
293
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
294
294
|
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
295
|
-
from rapidata.api_client.models.prompt_type import PromptType
|
|
296
295
|
from rapidata.api_client.models.proxy_file_wrapper import ProxyFileWrapper
|
|
297
296
|
from rapidata.api_client.models.public_order_model import PublicOrderModel
|
|
298
297
|
from rapidata.api_client.models.public_rapid_response import PublicRapidResponse
|
|
@@ -300,7 +299,6 @@ from rapidata.api_client.models.public_text_metadata_input import PublicTextMeta
|
|
|
300
299
|
from rapidata.api_client.models.query_model import QueryModel
|
|
301
300
|
from rapidata.api_client.models.query_validation_model import QueryValidationModel
|
|
302
301
|
from rapidata.api_client.models.rapid_issue import RapidIssue
|
|
303
|
-
from rapidata.api_client.models.rapid_modality import RapidModality
|
|
304
302
|
from rapidata.api_client.models.rapid_model import RapidModel
|
|
305
303
|
from rapidata.api_client.models.rapid_model_paged_result import RapidModelPagedResult
|
|
306
304
|
from rapidata.api_client.models.rapid_model_referee import RapidModelReferee
|
|
@@ -22,6 +22,7 @@ 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
24
|
from rapidata.api_client.models.dataset_dataset_id_datapoints_post_request_metadata_inner import DatasetDatasetIdDatapointsPostRequestMetadataInner
|
|
25
|
+
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
27
28
|
|
|
@@ -34,7 +35,8 @@ class AddValidationRapidModel(BaseModel):
|
|
|
34
35
|
truth: Optional[AddValidationRapidModelTruth] = None
|
|
35
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")
|
|
36
37
|
explanation: Optional[StrictStr] = Field(default=None, description="An explanation for the users if they answer the rapid incorrectly.")
|
|
37
|
-
|
|
38
|
+
feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags to enable for the rapid.", alias="featureFlags")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["payload", "metadata", "truth", "randomCorrectProbability", "explanation", "featureFlags"]
|
|
38
40
|
|
|
39
41
|
model_config = ConfigDict(
|
|
40
42
|
populate_by_name=True,
|
|
@@ -88,6 +90,13 @@ class AddValidationRapidModel(BaseModel):
|
|
|
88
90
|
# override the default output from pydantic by calling `to_dict()` of truth
|
|
89
91
|
if self.truth:
|
|
90
92
|
_dict['truth'] = self.truth.to_dict()
|
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
94
|
+
_items = []
|
|
95
|
+
if self.feature_flags:
|
|
96
|
+
for _item_feature_flags in self.feature_flags:
|
|
97
|
+
if _item_feature_flags:
|
|
98
|
+
_items.append(_item_feature_flags.to_dict())
|
|
99
|
+
_dict['featureFlags'] = _items
|
|
91
100
|
# set to None if metadata (nullable) is None
|
|
92
101
|
# and model_fields_set contains the field
|
|
93
102
|
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
@@ -108,6 +117,11 @@ class AddValidationRapidModel(BaseModel):
|
|
|
108
117
|
if self.explanation is None and "explanation" in self.model_fields_set:
|
|
109
118
|
_dict['explanation'] = None
|
|
110
119
|
|
|
120
|
+
# set to None if feature_flags (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.feature_flags is None and "feature_flags" in self.model_fields_set:
|
|
123
|
+
_dict['featureFlags'] = None
|
|
124
|
+
|
|
111
125
|
return _dict
|
|
112
126
|
|
|
113
127
|
@classmethod
|
|
@@ -124,7 +138,8 @@ class AddValidationRapidModel(BaseModel):
|
|
|
124
138
|
"metadata": [DatasetDatasetIdDatapointsPostRequestMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
125
139
|
"truth": AddValidationRapidModelTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
126
140
|
"randomCorrectProbability": obj.get("randomCorrectProbability"),
|
|
127
|
-
"explanation": obj.get("explanation")
|
|
141
|
+
"explanation": obj.get("explanation"),
|
|
142
|
+
"featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
128
143
|
})
|
|
129
144
|
return _obj
|
|
130
145
|
|
|
@@ -28,7 +28,7 @@ class AssetMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for AssetMetadata", alias="_t")
|
|
30
30
|
asset: AssetMetadataAsset
|
|
31
|
-
visibilities: StrictStr
|
|
31
|
+
visibilities: List[StrictStr]
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "asset", "visibilities"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -38,6 +38,14 @@ class AssetMetadata(BaseModel):
|
|
|
38
38
|
raise ValueError("must be one of enum values ('AssetMetadata')")
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
+
@field_validator('visibilities')
|
|
42
|
+
def visibilities_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
for i in value:
|
|
45
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
46
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
41
49
|
model_config = ConfigDict(
|
|
42
50
|
populate_by_name=True,
|
|
43
51
|
validate_assignment=True,
|
|
@@ -17,8 +17,10 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.boost_mode import BoostMode
|
|
23
|
+
from rapidata.api_client.models.boost_status import BoostStatus
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -26,27 +28,13 @@ class BoostQueryResult(BaseModel):
|
|
|
26
28
|
"""
|
|
27
29
|
BoostQueryResult
|
|
28
30
|
""" # noqa: E501
|
|
29
|
-
status:
|
|
30
|
-
mode:
|
|
31
|
+
status: BoostStatus
|
|
32
|
+
mode: BoostMode
|
|
31
33
|
active_campaigns: List[StrictStr] = Field(alias="activeCampaigns")
|
|
32
34
|
inactive_campaigns: List[StrictStr] = Field(alias="inactiveCampaigns")
|
|
33
35
|
unknown_campaigns: List[StrictInt] = Field(alias="unknownCampaigns")
|
|
34
36
|
__properties: ClassVar[List[str]] = ["status", "mode", "activeCampaigns", "inactiveCampaigns", "unknownCampaigns"]
|
|
35
37
|
|
|
36
|
-
@field_validator('status')
|
|
37
|
-
def status_validate_enum(cls, value):
|
|
38
|
-
"""Validates the enum"""
|
|
39
|
-
if value not in set(['Active', 'Inactive', 'Partial', 'Unknown']):
|
|
40
|
-
raise ValueError("must be one of enum values ('Active', 'Inactive', 'Partial', 'Unknown')")
|
|
41
|
-
return value
|
|
42
|
-
|
|
43
|
-
@field_validator('mode')
|
|
44
|
-
def mode_validate_enum(cls, value):
|
|
45
|
-
"""Validates the enum"""
|
|
46
|
-
if value not in set(['Automatic', 'Manual']):
|
|
47
|
-
raise ValueError("must be one of enum values ('Automatic', 'Manual')")
|
|
48
|
-
return value
|
|
49
|
-
|
|
50
38
|
model_config = ConfigDict(
|
|
51
39
|
populate_by_name=True,
|
|
52
40
|
validate_assignment=True,
|
|
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from rapidata.api_client.models.campaign_status import CampaignStatus
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -30,18 +31,11 @@ class CampaignQueryResult(BaseModel):
|
|
|
30
31
|
id: StrictStr
|
|
31
32
|
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
32
33
|
name: StrictStr
|
|
33
|
-
status:
|
|
34
|
+
status: CampaignStatus
|
|
34
35
|
priority: StrictInt
|
|
35
36
|
created_at: datetime = Field(alias="createdAt")
|
|
36
37
|
__properties: ClassVar[List[str]] = ["id", "ownerMail", "name", "status", "priority", "createdAt"]
|
|
37
38
|
|
|
38
|
-
@field_validator('status')
|
|
39
|
-
def status_validate_enum(cls, value):
|
|
40
|
-
"""Validates the enum"""
|
|
41
|
-
if value not in set(['Created', 'Preview', 'Active', 'Analysis', 'Paused', 'Completed']):
|
|
42
|
-
raise ValueError("must be one of enum values ('Created', 'Preview', 'Active', 'Analysis', 'Paused', 'Completed')")
|
|
43
|
-
return value
|
|
44
|
-
|
|
45
39
|
model_config = ConfigDict(
|
|
46
40
|
populate_by_name=True,
|
|
47
41
|
validate_assignment=True,
|
|
@@ -28,7 +28,7 @@ class ClassificationMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ClassificationMetadata", alias="_t")
|
|
30
30
|
classification: StrictStr
|
|
31
|
-
visibilities: Optional[StrictStr] = None
|
|
31
|
+
visibilities: Optional[List[StrictStr]] = None
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "classification", "visibilities"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -38,6 +38,17 @@ class ClassificationMetadata(BaseModel):
|
|
|
38
38
|
raise ValueError("must be one of enum values ('ClassificationMetadata')")
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
+
@field_validator('visibilities')
|
|
42
|
+
def visibilities_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value is None:
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
for i in value:
|
|
48
|
+
if i not in set(['None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All']):
|
|
49
|
+
raise ValueError("each list item must be one of ('None', 'Users', 'Customers', 'Admins', 'Dashboard', 'All')")
|
|
50
|
+
return value
|
|
51
|
+
|
|
41
52
|
model_config = ConfigDict(
|
|
42
53
|
populate_by_name=True,
|
|
43
54
|
validate_assignment=True,
|
|
@@ -23,6 +23,7 @@ from rapidata.api_client.models.compare_workflow_config_metadata_value import Co
|
|
|
23
23
|
from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
|
|
24
24
|
from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
|
|
25
25
|
from rapidata.api_client.models.elo_config import EloConfig
|
|
26
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -32,12 +33,13 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
32
33
|
""" # noqa: E501
|
|
33
34
|
t: StrictStr = Field(description="Discriminator value for CompareWorkflowConfig", alias="_t")
|
|
34
35
|
criteria: StrictStr
|
|
35
|
-
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
36
|
-
pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
37
36
|
referee: CompareWorkflowModel1Referee
|
|
38
37
|
target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
|
|
39
38
|
metadata: Dict[str, CompareWorkflowConfigMetadataValue]
|
|
40
|
-
|
|
39
|
+
elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
|
|
40
|
+
pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
|
|
41
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "referee", "targetCountryCodes", "metadata", "eloConfig", "pairMakerConfig", "featureFlags"]
|
|
41
43
|
|
|
42
44
|
@field_validator('t')
|
|
43
45
|
def t_validate_enum(cls, value):
|
|
@@ -85,12 +87,6 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
85
87
|
exclude=excluded_fields,
|
|
86
88
|
exclude_none=True,
|
|
87
89
|
)
|
|
88
|
-
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
89
|
-
if self.elo_config:
|
|
90
|
-
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
91
|
-
# override the default output from pydantic by calling `to_dict()` of pair_maker_config
|
|
92
|
-
if self.pair_maker_config:
|
|
93
|
-
_dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
|
|
94
90
|
# override the default output from pydantic by calling `to_dict()` of referee
|
|
95
91
|
if self.referee:
|
|
96
92
|
_dict['referee'] = self.referee.to_dict()
|
|
@@ -101,6 +97,19 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
101
97
|
if self.metadata[_key_metadata]:
|
|
102
98
|
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
103
99
|
_dict['metadata'] = _field_dict
|
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of elo_config
|
|
101
|
+
if self.elo_config:
|
|
102
|
+
_dict['eloConfig'] = self.elo_config.to_dict()
|
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of pair_maker_config
|
|
104
|
+
if self.pair_maker_config:
|
|
105
|
+
_dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
107
|
+
_items = []
|
|
108
|
+
if self.feature_flags:
|
|
109
|
+
for _item_feature_flags in self.feature_flags:
|
|
110
|
+
if _item_feature_flags:
|
|
111
|
+
_items.append(_item_feature_flags.to_dict())
|
|
112
|
+
_dict['featureFlags'] = _items
|
|
104
113
|
return _dict
|
|
105
114
|
|
|
106
115
|
@classmethod
|
|
@@ -115,8 +124,6 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
115
124
|
_obj = cls.model_validate({
|
|
116
125
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowConfig',
|
|
117
126
|
"criteria": obj.get("criteria"),
|
|
118
|
-
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
119
|
-
"pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
120
127
|
"referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
121
128
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
122
129
|
"metadata": dict(
|
|
@@ -124,7 +131,10 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
124
131
|
for _k, _v in obj["metadata"].items()
|
|
125
132
|
)
|
|
126
133
|
if obj.get("metadata") is not None
|
|
127
|
-
else None
|
|
134
|
+
else None,
|
|
135
|
+
"eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
|
|
136
|
+
"pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
|
|
137
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
128
138
|
})
|
|
129
139
|
return _obj
|
|
130
140
|
|