rapidata 2.13.1__py3-none-any.whl → 2.14.1__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/api_client/__init__.py +18 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/dataset_api.py +265 -0
- rapidata/api_client/api/rapid_api.py +262 -0
- rapidata/api_client/api/workflow_api.py +298 -1
- rapidata/api_client/models/__init__.py +17 -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/classification_metadata.py +2 -4
- rapidata/api_client/models/compare_workflow_config.py +17 -2
- rapidata/api_client/models/compare_workflow_config_metadata_value.py +238 -0
- rapidata/api_client/models/compare_workflow_config_model.py +17 -2
- rapidata/api_client/models/compare_workflow_model.py +17 -2
- rapidata/api_client/models/count_metadata.py +1 -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/early_stopping_referee_model.py +1 -1
- 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_rapid_responses_result.py +112 -0
- rapidata/api_client/models/get_responses_result.py +95 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +10 -4
- rapidata/api_client/models/image_dimension_metadata.py +1 -3
- rapidata/api_client/models/location_metadata.py +2 -4
- rapidata/api_client/models/metadata_visibilities.py +1 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/original_filename_metadata.py +2 -4
- rapidata/api_client/models/prompt_metadata.py +1 -3
- rapidata/api_client/models/scrub_result.py +4 -4
- rapidata/api_client/models/source_url_metadata.py +98 -0
- rapidata/api_client/models/text_metadata.py +3 -5
- rapidata/api_client/models/transcription_metadata.py +1 -3
- rapidata/api_client/models/upload_text_sources_to_dataset_model.py +17 -2
- rapidata/api_client_README.md +21 -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/filter/rapidata_filters.py +10 -2
- rapidata/rapidata_client/order/_rapidata_dataset.py +311 -108
- rapidata/rapidata_client/order/_rapidata_order_builder.py +5 -5
- rapidata/rapidata_client/order/rapidata_order.py +2 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +55 -6
- rapidata/rapidata_client/order/rapidata_results.py +2 -1
- rapidata/rapidata_client/rapidata_client.py +4 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +10 -9
- rapidata/rapidata_client/settings/no_shuffle.py +2 -2
- rapidata/rapidata_client/settings/rapidata_settings.py +8 -0
- rapidata/rapidata_client/validation/rapids/rapids.py +4 -5
- rapidata/rapidata_client/workflow/__init__.py +1 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +51 -0
- rapidata/service/credential_manager.py +7 -0
- rapidata/service/openapi_service.py +6 -6
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/METADATA +1 -1
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/RECORD +63 -56
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/LICENSE +0 -0
- {rapidata-2.13.1.dist-info → rapidata-2.14.1.dist-info}/WHEEL +0 -0
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
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
|
|
|
@@ -29,7 +30,8 @@ class UploadTextSourcesToDatasetModel(BaseModel):
|
|
|
29
30
|
dataset_id: StrictStr = Field(description="The id of the dataset to upload the text sources to.", alias="datasetId")
|
|
30
31
|
text_sources: List[StrictStr] = Field(description="The text sources to upload.", alias="textSources")
|
|
31
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")
|
|
32
|
-
|
|
33
|
+
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.")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["datasetId", "textSources", "sortIndex", "metadata"]
|
|
33
35
|
|
|
34
36
|
model_config = ConfigDict(
|
|
35
37
|
populate_by_name=True,
|
|
@@ -70,11 +72,23 @@ class UploadTextSourcesToDatasetModel(BaseModel):
|
|
|
70
72
|
exclude=excluded_fields,
|
|
71
73
|
exclude_none=True,
|
|
72
74
|
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.metadata:
|
|
78
|
+
for _item_metadata in self.metadata:
|
|
79
|
+
if _item_metadata:
|
|
80
|
+
_items.append(_item_metadata.to_dict())
|
|
81
|
+
_dict['metadata'] = _items
|
|
73
82
|
# set to None if sort_index (nullable) is None
|
|
74
83
|
# and model_fields_set contains the field
|
|
75
84
|
if self.sort_index is None and "sort_index" in self.model_fields_set:
|
|
76
85
|
_dict['sortIndex'] = None
|
|
77
86
|
|
|
87
|
+
# set to None if metadata (nullable) is None
|
|
88
|
+
# and model_fields_set contains the field
|
|
89
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
90
|
+
_dict['metadata'] = None
|
|
91
|
+
|
|
78
92
|
return _dict
|
|
79
93
|
|
|
80
94
|
@classmethod
|
|
@@ -89,7 +103,8 @@ class UploadTextSourcesToDatasetModel(BaseModel):
|
|
|
89
103
|
_obj = cls.model_validate({
|
|
90
104
|
"datasetId": obj.get("datasetId"),
|
|
91
105
|
"textSources": obj.get("textSources"),
|
|
92
|
-
"sortIndex": obj.get("sortIndex")
|
|
106
|
+
"sortIndex": obj.get("sortIndex"),
|
|
107
|
+
"metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None
|
|
93
108
|
})
|
|
94
109
|
return _obj
|
|
95
110
|
|
rapidata/api_client_README.md
CHANGED
|
@@ -87,6 +87,7 @@ Class | Method | HTTP request | Description
|
|
|
87
87
|
*DatapointApi* | [**datapoint_get_by_id_get**](rapidata/api_client/docs/DatapointApi.md#datapoint_get_by_id_get) | **GET** /Datapoint/GetById | Get a datapoint by its id.
|
|
88
88
|
*DatasetApi* | [**dataset_creat_text_datapoint_post**](rapidata/api_client/docs/DatasetApi.md#dataset_creat_text_datapoint_post) | **POST** /Dataset/CreatTextDatapoint | Creates new datapoints from text sources.
|
|
89
89
|
*DatasetApi* | [**dataset_create_datapoint_post**](rapidata/api_client/docs/DatasetApi.md#dataset_create_datapoint_post) | **POST** /Dataset/CreateDatapoint | Creates a single datapoint.
|
|
90
|
+
*DatasetApi* | [**dataset_dataset_id_datapoints_failed_get**](rapidata/api_client/docs/DatasetApi.md#dataset_dataset_id_datapoints_failed_get) | **GET** /dataset/{datasetId}/datapoints/failed | Gets a list of all datapoints that failed to upload.
|
|
90
91
|
*DatasetApi* | [**dataset_dataset_id_datapoints_urls_post**](rapidata/api_client/docs/DatasetApi.md#dataset_dataset_id_datapoints_urls_post) | **POST** /dataset/{datasetId}/datapoints/urls | Creates new datapoint where the assets are fetched from the specified urls.
|
|
91
92
|
*DatasetApi* | [**dataset_dataset_id_progress_get**](rapidata/api_client/docs/DatasetApi.md#dataset_dataset_id_progress_get) | **GET** /dataset/{datasetId}/progress | Gets the upload progress of a dataset.
|
|
92
93
|
*DatasetApi* | [**dataset_get_by_id_get**](rapidata/api_client/docs/DatasetApi.md#dataset_get_by_id_get) | **GET** /Dataset/GetById | Gets a dataset by its id.
|
|
@@ -130,11 +131,13 @@ Class | Method | HTTP request | Description
|
|
|
130
131
|
*RapidApi* | [**rapid_create_demographic_rapid_post**](rapidata/api_client/docs/RapidApi.md#rapid_create_demographic_rapid_post) | **POST** /Rapid/CreateDemographicRapid | Creates a new Demographic Rapid.
|
|
131
132
|
*RapidApi* | [**rapid_query_validation_rapids_get**](rapidata/api_client/docs/RapidApi.md#rapid_query_validation_rapids_get) | **GET** /Rapid/QueryValidationRapids | Queries the validation rapids for a specific validation set.
|
|
132
133
|
*RapidApi* | [**rapid_rapid_id_delete**](rapidata/api_client/docs/RapidApi.md#rapid_rapid_id_delete) | **DELETE** /rapid/{rapidId} | Deletes a rapid.
|
|
134
|
+
*RapidApi* | [**rapid_rapid_id_responses_get**](rapidata/api_client/docs/RapidApi.md#rapid_rapid_id_responses_get) | **GET** /rapid/{rapidId}/responses | Gets all responses for a given rapid.
|
|
133
135
|
*RapidApi* | [**rapid_report_id_get**](rapidata/api_client/docs/RapidApi.md#rapid_report_id_get) | **GET** /rapid/report/{id} | Inspects a report's dump. can be used to restore zustand state or anything alike.
|
|
134
136
|
*RapidApi* | [**rapid_report_post**](rapidata/api_client/docs/RapidApi.md#rapid_report_post) | **POST** /Rapid/Report | Used to report an issue with a rapid.
|
|
135
137
|
*RapidApi* | [**rapid_skip_user_guess_post**](rapidata/api_client/docs/RapidApi.md#rapid_skip_user_guess_post) | **POST** /Rapid/SkipUserGuess | Skips a Rapid for the user.
|
|
136
138
|
*RapidApi* | [**rapid_validate_current_rapid_bag_get**](rapidata/api_client/docs/RapidApi.md#rapid_validate_current_rapid_bag_get) | **GET** /Rapid/ValidateCurrentRapidBag | Validates that the rapids associated with the current user are active.
|
|
137
139
|
*RapidApi* | [**rapid_validation_rapid_id_put**](rapidata/api_client/docs/RapidApi.md#rapid_validation_rapid_id_put) | **PUT** /rapid/validation/{rapidId} | Updates the validation information of a rapid.
|
|
140
|
+
*RapidataIdentityAPIApi* | [**root_get**](rapidata/api_client/docs/RapidataIdentityAPIApi.md#root_get) | **GET** / |
|
|
138
141
|
*SimpleWorkflowApi* | [**workflow_simple_id_results_get**](rapidata/api_client/docs/SimpleWorkflowApi.md#workflow_simple_id_results_get) | **GET** /workflow/simple/{id}/results | Get the result overview for a simple workflow.
|
|
139
142
|
*UserInfoApi* | [**connect_userinfo_get**](rapidata/api_client/docs/UserInfoApi.md#connect_userinfo_get) | **GET** /connect/userinfo | Retrieves information about the authenticated user.
|
|
140
143
|
*ValidationApi* | [**validation_add_validation_rapid_post**](rapidata/api_client/docs/ValidationApi.md#validation_add_validation_rapid_post) | **POST** /Validation/AddValidationRapid | Adds a new validation rapid to the specified validation set.
|
|
@@ -149,6 +152,7 @@ Class | Method | HTTP request | Description
|
|
|
149
152
|
*WorkflowApi* | [**workflow_get_by_id_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_get_by_id_get) | **GET** /Workflow/GetById | Get a workflow by its ID.
|
|
150
153
|
*WorkflowApi* | [**workflow_get_progress_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_get_progress_get) | **GET** /Workflow/GetProgress | Get the progress of a workflow.
|
|
151
154
|
*WorkflowApi* | [**workflow_id_compare_ab_summary_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_id_compare_ab_summary_get) | **GET** /workflow/{id}/compare-ab-summary | Calculates a summary of the results for a simple compare workflow. The summary includes the number of times an asset at each index was the winner.
|
|
155
|
+
*WorkflowApi* | [**workflow_id_responses_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_id_responses_get) | **GET** /workflow/{id}/responses | 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.
|
|
152
156
|
*WorkflowApi* | [**workflow_query_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_query_get) | **GET** /Workflow/Query | Queries workflows based on the provided filter, page, and sort criteria.
|
|
153
157
|
|
|
154
158
|
|
|
@@ -158,7 +162,6 @@ Class | Method | HTTP request | Description
|
|
|
158
162
|
- [AbTestSelectionAInner](rapidata/api_client/docs/AbTestSelectionAInner.md)
|
|
159
163
|
- [AddCampaignArtifactResult](rapidata/api_client/docs/AddCampaignArtifactResult.md)
|
|
160
164
|
- [AddCampaignModel](rapidata/api_client/docs/AddCampaignModel.md)
|
|
161
|
-
- [AddCampaignModelUserFiltersInner](rapidata/api_client/docs/AddCampaignModelUserFiltersInner.md)
|
|
162
165
|
- [AddValidationRapidModel](rapidata/api_client/docs/AddValidationRapidModel.md)
|
|
163
166
|
- [AddValidationRapidModelPayload](rapidata/api_client/docs/AddValidationRapidModelPayload.md)
|
|
164
167
|
- [AddValidationRapidModelTruth](rapidata/api_client/docs/AddValidationRapidModelTruth.md)
|
|
@@ -182,6 +185,7 @@ Class | Method | HTTP request | Description
|
|
|
182
185
|
- [CampaignStatus](rapidata/api_client/docs/CampaignStatus.md)
|
|
183
186
|
- [CampaignUserFilterModel](rapidata/api_client/docs/CampaignUserFilterModel.md)
|
|
184
187
|
- [CappedSelection](rapidata/api_client/docs/CappedSelection.md)
|
|
188
|
+
- [ClassificationMetadata](rapidata/api_client/docs/ClassificationMetadata.md)
|
|
185
189
|
- [ClassificationMetadataFilterConfig](rapidata/api_client/docs/ClassificationMetadataFilterConfig.md)
|
|
186
190
|
- [ClassificationMetadataModel](rapidata/api_client/docs/ClassificationMetadataModel.md)
|
|
187
191
|
- [ClassifyPayload](rapidata/api_client/docs/ClassifyPayload.md)
|
|
@@ -195,6 +199,7 @@ Class | Method | HTTP request | Description
|
|
|
195
199
|
- [CompareResult](rapidata/api_client/docs/CompareResult.md)
|
|
196
200
|
- [CompareTruth](rapidata/api_client/docs/CompareTruth.md)
|
|
197
201
|
- [CompareWorkflowConfig](rapidata/api_client/docs/CompareWorkflowConfig.md)
|
|
202
|
+
- [CompareWorkflowConfigMetadataValue](rapidata/api_client/docs/CompareWorkflowConfigMetadataValue.md)
|
|
198
203
|
- [CompareWorkflowConfigModel](rapidata/api_client/docs/CompareWorkflowConfigModel.md)
|
|
199
204
|
- [CompareWorkflowConfigModelPairMakerConfig](rapidata/api_client/docs/CompareWorkflowConfigModelPairMakerConfig.md)
|
|
200
205
|
- [CompareWorkflowConfigPairMakerConfig](rapidata/api_client/docs/CompareWorkflowConfigPairMakerConfig.md)
|
|
@@ -206,6 +211,7 @@ Class | Method | HTTP request | Description
|
|
|
206
211
|
- [ConditionalValidationSelection](rapidata/api_client/docs/ConditionalValidationSelection.md)
|
|
207
212
|
- [Coordinate](rapidata/api_client/docs/Coordinate.md)
|
|
208
213
|
- [CountClassificationMetadataFilterConfig](rapidata/api_client/docs/CountClassificationMetadataFilterConfig.md)
|
|
214
|
+
- [CountMetadata](rapidata/api_client/docs/CountMetadata.md)
|
|
209
215
|
- [CountMetadataModel](rapidata/api_client/docs/CountMetadataModel.md)
|
|
210
216
|
- [CountryUserFilterModel](rapidata/api_client/docs/CountryUserFilterModel.md)
|
|
211
217
|
- [CreateBridgeTokenResult](rapidata/api_client/docs/CreateBridgeTokenResult.md)
|
|
@@ -215,6 +221,7 @@ Class | Method | HTTP request | Description
|
|
|
215
221
|
- [CreateComplexOrderModelPipeline](rapidata/api_client/docs/CreateComplexOrderModelPipeline.md)
|
|
216
222
|
- [CreateComplexOrderResult](rapidata/api_client/docs/CreateComplexOrderResult.md)
|
|
217
223
|
- [CreateDatapointFromUrlsModel](rapidata/api_client/docs/CreateDatapointFromUrlsModel.md)
|
|
224
|
+
- [CreateDatapointFromUrlsModelMetadataInner](rapidata/api_client/docs/CreateDatapointFromUrlsModelMetadataInner.md)
|
|
218
225
|
- [CreateDatapointResult](rapidata/api_client/docs/CreateDatapointResult.md)
|
|
219
226
|
- [CreateDatasetArtifactModel](rapidata/api_client/docs/CreateDatasetArtifactModel.md)
|
|
220
227
|
- [CreateDatasetArtifactModelDataset](rapidata/api_client/docs/CreateDatasetArtifactModelDataset.md)
|
|
@@ -230,10 +237,10 @@ Class | Method | HTTP request | Description
|
|
|
230
237
|
- [CreateSimplePipelineModelPipelineStepsInner](rapidata/api_client/docs/CreateSimplePipelineModelPipelineStepsInner.md)
|
|
231
238
|
- [CreateUnsupportedOrderModel](rapidata/api_client/docs/CreateUnsupportedOrderModel.md)
|
|
232
239
|
- [CustomUserFilterModel](rapidata/api_client/docs/CustomUserFilterModel.md)
|
|
240
|
+
- [Datapoint](rapidata/api_client/docs/Datapoint.md)
|
|
241
|
+
- [DatapointAsset](rapidata/api_client/docs/DatapointAsset.md)
|
|
233
242
|
- [DatapointMetadataModel](rapidata/api_client/docs/DatapointMetadataModel.md)
|
|
234
|
-
- [DatapointMetadataModelMetadataInner](rapidata/api_client/docs/DatapointMetadataModelMetadataInner.md)
|
|
235
243
|
- [DatapointModel](rapidata/api_client/docs/DatapointModel.md)
|
|
236
|
-
- [DatapointModelAsset](rapidata/api_client/docs/DatapointModelAsset.md)
|
|
237
244
|
- [DatapointState](rapidata/api_client/docs/DatapointState.md)
|
|
238
245
|
- [DatasetArtifactModel](rapidata/api_client/docs/DatasetArtifactModel.md)
|
|
239
246
|
- [DatasetEvaluationStepModel](rapidata/api_client/docs/DatasetEvaluationStepModel.md)
|
|
@@ -268,10 +275,13 @@ Class | Method | HTTP request | Description
|
|
|
268
275
|
- [GetDatapointsByDatasetIdResult](rapidata/api_client/docs/GetDatapointsByDatasetIdResult.md)
|
|
269
276
|
- [GetDatasetByIdResult](rapidata/api_client/docs/GetDatasetByIdResult.md)
|
|
270
277
|
- [GetDatasetProgressResult](rapidata/api_client/docs/GetDatasetProgressResult.md)
|
|
278
|
+
- [GetFailedDatapointsResult](rapidata/api_client/docs/GetFailedDatapointsResult.md)
|
|
271
279
|
- [GetOrderByIdResult](rapidata/api_client/docs/GetOrderByIdResult.md)
|
|
272
280
|
- [GetPipelineByIdResult](rapidata/api_client/docs/GetPipelineByIdResult.md)
|
|
273
281
|
- [GetPipelineByIdResultArtifactsValue](rapidata/api_client/docs/GetPipelineByIdResultArtifactsValue.md)
|
|
274
282
|
- [GetPublicOrdersResult](rapidata/api_client/docs/GetPublicOrdersResult.md)
|
|
283
|
+
- [GetRapidResponsesResult](rapidata/api_client/docs/GetRapidResponsesResult.md)
|
|
284
|
+
- [GetResponsesResult](rapidata/api_client/docs/GetResponsesResult.md)
|
|
275
285
|
- [GetSimpleWorkflowResultsModel](rapidata/api_client/docs/GetSimpleWorkflowResultsModel.md)
|
|
276
286
|
- [GetSimpleWorkflowResultsResult](rapidata/api_client/docs/GetSimpleWorkflowResultsResult.md)
|
|
277
287
|
- [GetSimpleWorkflowResultsResultPagedResult](rapidata/api_client/docs/GetSimpleWorkflowResultsResultPagedResult.md)
|
|
@@ -281,6 +291,7 @@ Class | Method | HTTP request | Description
|
|
|
281
291
|
- [GetWorkflowProgressResult](rapidata/api_client/docs/GetWorkflowProgressResult.md)
|
|
282
292
|
- [IWorkflowModelPagedResult](rapidata/api_client/docs/IWorkflowModelPagedResult.md)
|
|
283
293
|
- [IdentityReadBridgeTokenGet202Response](rapidata/api_client/docs/IdentityReadBridgeTokenGet202Response.md)
|
|
294
|
+
- [ImageDimensionMetadata](rapidata/api_client/docs/ImageDimensionMetadata.md)
|
|
284
295
|
- [ImageDimensionMetadataModel](rapidata/api_client/docs/ImageDimensionMetadataModel.md)
|
|
285
296
|
- [ImportFromFileResult](rapidata/api_client/docs/ImportFromFileResult.md)
|
|
286
297
|
- [ImportValidationSetFromFileResult](rapidata/api_client/docs/ImportValidationSetFromFileResult.md)
|
|
@@ -298,9 +309,11 @@ Class | Method | HTTP request | Description
|
|
|
298
309
|
- [LocatePayload](rapidata/api_client/docs/LocatePayload.md)
|
|
299
310
|
- [LocateRapidBlueprint](rapidata/api_client/docs/LocateRapidBlueprint.md)
|
|
300
311
|
- [LocateResult](rapidata/api_client/docs/LocateResult.md)
|
|
312
|
+
- [LocationMetadata](rapidata/api_client/docs/LocationMetadata.md)
|
|
301
313
|
- [LocationMetadataExistsFilterConfig](rapidata/api_client/docs/LocationMetadataExistsFilterConfig.md)
|
|
302
314
|
- [LocationMetadataModel](rapidata/api_client/docs/LocationMetadataModel.md)
|
|
303
315
|
- [LogicOperator](rapidata/api_client/docs/LogicOperator.md)
|
|
316
|
+
- [MetadataVisibilities](rapidata/api_client/docs/MetadataVisibilities.md)
|
|
304
317
|
- [MultiAssetModel](rapidata/api_client/docs/MultiAssetModel.md)
|
|
305
318
|
- [NaiveRefereeConfig](rapidata/api_client/docs/NaiveRefereeConfig.md)
|
|
306
319
|
- [NaiveRefereeModel](rapidata/api_client/docs/NaiveRefereeModel.md)
|
|
@@ -311,7 +324,6 @@ Class | Method | HTTP request | Description
|
|
|
311
324
|
- [NamedEntityTruth](rapidata/api_client/docs/NamedEntityTruth.md)
|
|
312
325
|
- [NeverEndingRefereeConfig](rapidata/api_client/docs/NeverEndingRefereeConfig.md)
|
|
313
326
|
- [NewUserFilterModel](rapidata/api_client/docs/NewUserFilterModel.md)
|
|
314
|
-
- [NewUserFilterModel1](rapidata/api_client/docs/NewUserFilterModel1.md)
|
|
315
327
|
- [NewsletterModel](rapidata/api_client/docs/NewsletterModel.md)
|
|
316
328
|
- [NotAvailableYetResult](rapidata/api_client/docs/NotAvailableYetResult.md)
|
|
317
329
|
- [NullAssetModel](rapidata/api_client/docs/NullAssetModel.md)
|
|
@@ -321,6 +333,7 @@ Class | Method | HTTP request | Description
|
|
|
321
333
|
- [OrderModel](rapidata/api_client/docs/OrderModel.md)
|
|
322
334
|
- [OrderModelPagedResult](rapidata/api_client/docs/OrderModelPagedResult.md)
|
|
323
335
|
- [OrderState](rapidata/api_client/docs/OrderState.md)
|
|
336
|
+
- [OriginalFilenameMetadata](rapidata/api_client/docs/OriginalFilenameMetadata.md)
|
|
324
337
|
- [OriginalFilenameMetadataModel](rapidata/api_client/docs/OriginalFilenameMetadataModel.md)
|
|
325
338
|
- [PageInfo](rapidata/api_client/docs/PageInfo.md)
|
|
326
339
|
- [PipelineIdWorkflowPutRequest](rapidata/api_client/docs/PipelineIdWorkflowPutRequest.md)
|
|
@@ -333,6 +346,7 @@ Class | Method | HTTP request | Description
|
|
|
333
346
|
- [PrivateTextMetadataInput](rapidata/api_client/docs/PrivateTextMetadataInput.md)
|
|
334
347
|
- [ProbabilisticAttachCategoryRefereeConfig](rapidata/api_client/docs/ProbabilisticAttachCategoryRefereeConfig.md)
|
|
335
348
|
- [ProblemDetails](rapidata/api_client/docs/ProblemDetails.md)
|
|
349
|
+
- [PromptMetadata](rapidata/api_client/docs/PromptMetadata.md)
|
|
336
350
|
- [PromptMetadataInput](rapidata/api_client/docs/PromptMetadataInput.md)
|
|
337
351
|
- [PromptMetadataModel](rapidata/api_client/docs/PromptMetadataModel.md)
|
|
338
352
|
- [PublicOrderModel](rapidata/api_client/docs/PublicOrderModel.md)
|
|
@@ -372,12 +386,15 @@ Class | Method | HTTP request | Description
|
|
|
372
386
|
- [SkipResult](rapidata/api_client/docs/SkipResult.md)
|
|
373
387
|
- [SortCriterion](rapidata/api_client/docs/SortCriterion.md)
|
|
374
388
|
- [SortDirection](rapidata/api_client/docs/SortDirection.md)
|
|
389
|
+
- [SourceUrlMetadata](rapidata/api_client/docs/SourceUrlMetadata.md)
|
|
375
390
|
- [SourceUrlMetadataModel](rapidata/api_client/docs/SourceUrlMetadataModel.md)
|
|
376
391
|
- [StaticSelection](rapidata/api_client/docs/StaticSelection.md)
|
|
377
392
|
- [SubmitCocoModel](rapidata/api_client/docs/SubmitCocoModel.md)
|
|
378
393
|
- [SubmitCocoResult](rapidata/api_client/docs/SubmitCocoResult.md)
|
|
379
394
|
- [TextAssetModel](rapidata/api_client/docs/TextAssetModel.md)
|
|
395
|
+
- [TextMetadata](rapidata/api_client/docs/TextMetadata.md)
|
|
380
396
|
- [TextMetadataModel](rapidata/api_client/docs/TextMetadataModel.md)
|
|
397
|
+
- [TranscriptionMetadata](rapidata/api_client/docs/TranscriptionMetadata.md)
|
|
381
398
|
- [TranscriptionMetadataInput](rapidata/api_client/docs/TranscriptionMetadataInput.md)
|
|
382
399
|
- [TranscriptionMetadataModel](rapidata/api_client/docs/TranscriptionMetadataModel.md)
|
|
383
400
|
- [TranscriptionPayload](rapidata/api_client/docs/TranscriptionPayload.md)
|
|
@@ -84,7 +84,7 @@ class MediaAsset(BaseAsset):
|
|
|
84
84
|
self._url = path
|
|
85
85
|
self.name = path.split('/')[-1]
|
|
86
86
|
self.name = self.__check_name_ending(self.name)
|
|
87
|
-
self.path =
|
|
87
|
+
self.path = path
|
|
88
88
|
return
|
|
89
89
|
|
|
90
90
|
if not os.path.exists(path):
|
|
@@ -287,6 +287,10 @@ class MediaAsset(BaseAsset):
|
|
|
287
287
|
self._logger.error(error_msg)
|
|
288
288
|
raise ValueError(error_msg)
|
|
289
289
|
|
|
290
|
+
def is_local(self) -> bool:
|
|
291
|
+
"""Check if the media asset is a local file."""
|
|
292
|
+
return self._url is None
|
|
293
|
+
|
|
290
294
|
def to_file(self) -> StrictStr | tuple[StrictStr, StrictBytes] | StrictBytes:
|
|
291
295
|
"""Convert the media asset to a file representation."""
|
|
292
296
|
if self._url is None:
|
|
@@ -5,7 +5,7 @@ Defines the MultiAsset class for handling multiple BaseAsset instances.
|
|
|
5
5
|
|
|
6
6
|
from rapidata.rapidata_client.assets._base_asset import BaseAsset
|
|
7
7
|
from rapidata.rapidata_client.assets import MediaAsset, TextAsset
|
|
8
|
-
from typing import Iterator, Sequence
|
|
8
|
+
from typing import Iterator, Sequence, cast
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class MultiAsset(BaseAsset):
|
|
@@ -34,6 +34,11 @@ class MultiAsset(BaseAsset):
|
|
|
34
34
|
if not all(isinstance(asset, type(assets[0])) for asset in assets):
|
|
35
35
|
raise ValueError("All assets must be of the same type.")
|
|
36
36
|
|
|
37
|
+
if isinstance(assets[0], MediaAsset):
|
|
38
|
+
local = [asset.is_local() for asset in cast(Sequence[MediaAsset], assets)]
|
|
39
|
+
if not all(loc == local[0] for loc in local):
|
|
40
|
+
raise ValueError("A datapoint with multiple assets can either have both assets be local paths or both be URLs. not a mix of both.")
|
|
41
|
+
|
|
37
42
|
self.assets = assets
|
|
38
43
|
|
|
39
44
|
def __len__(self) -> int:
|
|
@@ -9,7 +9,7 @@ class CountryFilter(RapidataFilter):
|
|
|
9
9
|
Can be used to filter who to target based on country codes.
|
|
10
10
|
|
|
11
11
|
Args:
|
|
12
|
-
country_codes (list[str]): List of country codes (
|
|
12
|
+
country_codes (list[str]): List of country codes (capitalized) to filter by.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
def __init__(self, country_codes: list[str]):
|
|
@@ -14,17 +14,25 @@ class RapidataFilters:
|
|
|
14
14
|
|
|
15
15
|
Note that adding multiple filters to the same order will result in a logical AND operation between the filters.
|
|
16
16
|
|
|
17
|
-
Warning:
|
|
17
|
+
Warning:
|
|
18
|
+
This might significantly slow down the number of responses you receive.
|
|
18
19
|
|
|
19
20
|
Attributes:
|
|
20
21
|
user_score (UserScoreFilter): The UserScoreFilter instance.
|
|
21
22
|
age (AgeFilter): The AgeFilter instance.
|
|
22
23
|
campaign (CampaignFilter): The CampaignFilter instance.
|
|
23
24
|
country (CountryFilter): The CountryFilter instance.
|
|
24
|
-
campaign (CampaignFilter): The CampaignFilter instance
|
|
25
25
|
gender (GenderFilter): The GenderFilter instance.
|
|
26
26
|
language (LanguageFilter): The LanguageFilter instance.
|
|
27
27
|
custom_filter (CustomFilter): The CustomFilter instance.
|
|
28
|
+
|
|
29
|
+
Example:
|
|
30
|
+
```python
|
|
31
|
+
from rapidata import CountryFilter, LanguageFilter
|
|
32
|
+
filters=[CountryFilter(["US", "DE"]), LanguageFilter(["en"])]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This ensures the order is only shown to users in the US and Germany whose phones are set to English.
|
|
28
36
|
"""
|
|
29
37
|
user_score = UserScoreFilter
|
|
30
38
|
age = AgeFilter
|