rapidata 2.41.0__py3-none-any.whl → 2.41.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 +1 -1
- rapidata/api_client/__init__.py +4 -2
- rapidata/api_client/api/dataset_api.py +544 -0
- rapidata/api_client/api/order_api.py +1 -3
- rapidata/api_client/models/__init__.py +4 -2
- rapidata/api_client/models/compare_workflow_config.py +3 -3
- rapidata/api_client/models/compare_workflow_config_model.py +3 -3
- rapidata/api_client/models/compare_workflow_model.py +4 -4
- rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +1 -1
- rapidata/api_client/models/create_order_model_referee.py +12 -12
- rapidata/api_client/models/create_order_model_workflow.py +15 -15
- rapidata/api_client/models/early_stopping_referee_model.py +3 -3
- rapidata/api_client/models/elo_config_model.py +4 -4
- rapidata/api_client/models/evaluation_workflow_model.py +4 -4
- rapidata/api_client/models/existing_asset_input.py +100 -0
- rapidata/api_client/models/file_asset.py +3 -3
- rapidata/api_client/models/file_asset_metadata_value.py +296 -0
- rapidata/api_client/models/multi_asset.py +3 -3
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input3_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input_assets_inner.py +40 -12
- rapidata/api_client/models/naive_referee_model.py +2 -2
- rapidata/api_client/models/null_asset.py +3 -3
- rapidata/api_client/models/online_pair_maker_config_model.py +3 -3
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +40 -12
- rapidata/api_client/models/reference_asset_input.py +100 -0
- rapidata/api_client/models/simple_workflow_model.py +5 -5
- rapidata/api_client/models/submit_prompt_model_prompt_asset.py +40 -12
- rapidata/api_client/models/text_asset.py +3 -3
- rapidata/api_client/models/upload_asset_result.py +102 -0
- rapidata/api_client_README.md +6 -2
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +5 -18
- rapidata/rapidata_client/demographic/demographic_manager.py +6 -0
- rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +6 -0
- rapidata/rapidata_client/rapidata_client.py +6 -0
- rapidata/rapidata_client/selection/ab_test_selection.py +6 -0
- rapidata/rapidata_client/selection/capped_selection.py +6 -0
- rapidata/rapidata_client/selection/conditional_validation_selection.py +6 -0
- rapidata/rapidata_client/selection/demographic_selection.py +6 -0
- rapidata/rapidata_client/selection/effort_selection.py +6 -0
- rapidata/rapidata_client/selection/labeling_selection.py +6 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +6 -0
- rapidata/rapidata_client/selection/shuffling_selection.py +6 -0
- rapidata/rapidata_client/selection/static_selection.py +6 -0
- rapidata/rapidata_client/selection/validation_selection.py +6 -0
- rapidata/rapidata_client/settings/rapidata_settings.py +6 -0
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +6 -0
- rapidata/rapidata_client/validation/validation_set_manager.py +7 -1
- rapidata/rapidata_client/workflow/_classify_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_compare_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_draw_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_free_text_workflow.py +3 -3
- rapidata/rapidata_client/workflow/_locate_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_select_words_workflow.py +4 -3
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +4 -3
- rapidata/service/openapi_service.py +1 -3
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/METADATA +4 -2
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/RECORD +61 -57
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info}/WHEEL +1 -1
- {rapidata-2.41.0.dist-info → rapidata-2.41.2.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.file_asset_metadata_value import FileAssetMetadataValue
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UploadAssetResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
UploadAssetResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
file_name: StrictStr = Field(alias="fileName")
|
|
31
|
+
metadata: Dict[str, FileAssetMetadataValue]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["fileName", "metadata"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of UploadAssetResult from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
|
|
74
|
+
_field_dict = {}
|
|
75
|
+
if self.metadata:
|
|
76
|
+
for _key_metadata in self.metadata:
|
|
77
|
+
if self.metadata[_key_metadata]:
|
|
78
|
+
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
79
|
+
_dict['metadata'] = _field_dict
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of UploadAssetResult from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"fileName": obj.get("fileName"),
|
|
93
|
+
"metadata": dict(
|
|
94
|
+
(_k, FileAssetMetadataValue.from_dict(_v))
|
|
95
|
+
for _k, _v in obj["metadata"].items()
|
|
96
|
+
)
|
|
97
|
+
if obj.get("metadata") is not None
|
|
98
|
+
else None
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
rapidata/api_client_README.md
CHANGED
|
@@ -110,6 +110,8 @@ Class | Method | HTTP request | Description
|
|
|
110
110
|
*CustomerRapidApi* | [**rapids_flagged_get**](rapidata/api_client/docs/CustomerRapidApi.md#rapids_flagged_get) | **GET** /rapids/flagged | Allows querying all rapids that have been flagged.
|
|
111
111
|
*DatapointApi* | [**datapoint_datapoint_id_delete**](rapidata/api_client/docs/DatapointApi.md#datapoint_datapoint_id_delete) | **DELETE** /datapoint/{datapointId} | Deletes a datapoint by its id.
|
|
112
112
|
*DatapointApi* | [**datapoint_datapoint_id_get**](rapidata/api_client/docs/DatapointApi.md#datapoint_datapoint_id_get) | **GET** /datapoint/{datapointId} | Gets a datapoint by its id.
|
|
113
|
+
*DatasetApi* | [**dataset_asset_file_post**](rapidata/api_client/docs/DatasetApi.md#dataset_asset_file_post) | **POST** /dataset/asset/file | Uploads a single asset to S3 and returns the asset details.
|
|
114
|
+
*DatasetApi* | [**dataset_asset_url_post**](rapidata/api_client/docs/DatasetApi.md#dataset_asset_url_post) | **POST** /dataset/asset/url | Uploads a single asset to S3 and returns the asset details.
|
|
113
115
|
*DatasetApi* | [**dataset_dataset_id_datapoints_csv_post**](rapidata/api_client/docs/DatasetApi.md#dataset_dataset_id_datapoints_csv_post) | **POST** /dataset/{datasetId}/datapoints/csv | Creates multiple datapoints from a csv.
|
|
114
116
|
*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.
|
|
115
117
|
*DatasetApi* | [**dataset_dataset_id_datapoints_files_post**](rapidata/api_client/docs/DatasetApi.md#dataset_dataset_id_datapoints_files_post) | **POST** /dataset/{datasetId}/datapoints/files | Creates a single datapoint by uploading files.
|
|
@@ -258,7 +260,6 @@ Class | Method | HTTP request | Description
|
|
|
258
260
|
- [CompareResult](rapidata/api_client/docs/CompareResult.md)
|
|
259
261
|
- [CompareTruth](rapidata/api_client/docs/CompareTruth.md)
|
|
260
262
|
- [CompareWorkflowConfig](rapidata/api_client/docs/CompareWorkflowConfig.md)
|
|
261
|
-
- [CompareWorkflowConfigMetadataValue](rapidata/api_client/docs/CompareWorkflowConfigMetadataValue.md)
|
|
262
263
|
- [CompareWorkflowConfigModel](rapidata/api_client/docs/CompareWorkflowConfigModel.md)
|
|
263
264
|
- [CompareWorkflowConfigModelPairMakerConfig](rapidata/api_client/docs/CompareWorkflowConfigModelPairMakerConfig.md)
|
|
264
265
|
- [CompareWorkflowConfigPairMakerConfig](rapidata/api_client/docs/CompareWorkflowConfigPairMakerConfig.md)
|
|
@@ -330,6 +331,7 @@ Class | Method | HTTP request | Description
|
|
|
330
331
|
- [EvaluationWorkflowConfig](rapidata/api_client/docs/EvaluationWorkflowConfig.md)
|
|
331
332
|
- [EvaluationWorkflowModel](rapidata/api_client/docs/EvaluationWorkflowModel.md)
|
|
332
333
|
- [EvaluationWorkflowModel1](rapidata/api_client/docs/EvaluationWorkflowModel1.md)
|
|
334
|
+
- [ExistingAssetInput](rapidata/api_client/docs/ExistingAssetInput.md)
|
|
333
335
|
- [FeatureFlag](rapidata/api_client/docs/FeatureFlag.md)
|
|
334
336
|
- [FeatureFlagModel](rapidata/api_client/docs/FeatureFlagModel.md)
|
|
335
337
|
- [FeedbackModel](rapidata/api_client/docs/FeedbackModel.md)
|
|
@@ -341,6 +343,7 @@ Class | Method | HTTP request | Description
|
|
|
341
343
|
- [FileAssetInput2](rapidata/api_client/docs/FileAssetInput2.md)
|
|
342
344
|
- [FileAssetInput3](rapidata/api_client/docs/FileAssetInput3.md)
|
|
343
345
|
- [FileAssetInputFile](rapidata/api_client/docs/FileAssetInputFile.md)
|
|
346
|
+
- [FileAssetMetadataValue](rapidata/api_client/docs/FileAssetMetadataValue.md)
|
|
344
347
|
- [FileAssetModel](rapidata/api_client/docs/FileAssetModel.md)
|
|
345
348
|
- [FileAssetModelMetadataValue](rapidata/api_client/docs/FileAssetModelMetadataValue.md)
|
|
346
349
|
- [FileType](rapidata/api_client/docs/FileType.md)
|
|
@@ -499,6 +502,7 @@ Class | Method | HTTP request | Description
|
|
|
499
502
|
- [RapidSkippedModel](rapidata/api_client/docs/RapidSkippedModel.md)
|
|
500
503
|
- [RapidState](rapidata/api_client/docs/RapidState.md)
|
|
501
504
|
- [ReadBridgeTokenKeysResult](rapidata/api_client/docs/ReadBridgeTokenKeysResult.md)
|
|
505
|
+
- [ReferenceAssetInput](rapidata/api_client/docs/ReferenceAssetInput.md)
|
|
502
506
|
- [ReportModel](rapidata/api_client/docs/ReportModel.md)
|
|
503
507
|
- [ResponseCountFilter](rapidata/api_client/docs/ResponseCountFilter.md)
|
|
504
508
|
- [ResponseCountUserFilterModel](rapidata/api_client/docs/ResponseCountUserFilterModel.md)
|
|
@@ -524,7 +528,6 @@ Class | Method | HTTP request | Description
|
|
|
524
528
|
- [SimpleWorkflowConfigModelBlueprint](rapidata/api_client/docs/SimpleWorkflowConfigModelBlueprint.md)
|
|
525
529
|
- [SimpleWorkflowModel](rapidata/api_client/docs/SimpleWorkflowModel.md)
|
|
526
530
|
- [SimpleWorkflowModel1](rapidata/api_client/docs/SimpleWorkflowModel1.md)
|
|
527
|
-
- [SimpleWorkflowModelBlueprint](rapidata/api_client/docs/SimpleWorkflowModelBlueprint.md)
|
|
528
531
|
- [SkipResult](rapidata/api_client/docs/SkipResult.md)
|
|
529
532
|
- [SkipTruth](rapidata/api_client/docs/SkipTruth.md)
|
|
530
533
|
- [SortCriterion](rapidata/api_client/docs/SortCriterion.md)
|
|
@@ -581,6 +584,7 @@ Class | Method | HTTP request | Description
|
|
|
581
584
|
- [UpdateValidationRapidModel](rapidata/api_client/docs/UpdateValidationRapidModel.md)
|
|
582
585
|
- [UpdateValidationRapidModelTruth](rapidata/api_client/docs/UpdateValidationRapidModelTruth.md)
|
|
583
586
|
- [UpdateValidationSetModel](rapidata/api_client/docs/UpdateValidationSetModel.md)
|
|
587
|
+
- [UploadAssetResult](rapidata/api_client/docs/UploadAssetResult.md)
|
|
584
588
|
- [UploadCocoResult](rapidata/api_client/docs/UploadCocoResult.md)
|
|
585
589
|
- [UploadFromS3Result](rapidata/api_client/docs/UploadFromS3Result.md)
|
|
586
590
|
- [UrlAssetInput](rapidata/api_client/docs/UrlAssetInput.md)
|
|
@@ -11,12 +11,9 @@ from rapidata.api_client.models.create_benchmark_participant_model import (
|
|
|
11
11
|
CreateBenchmarkParticipantModel,
|
|
12
12
|
)
|
|
13
13
|
from rapidata.api_client.models.create_leaderboard_model import CreateLeaderboardModel
|
|
14
|
-
from rapidata.api_client.models.filter import Filter
|
|
15
|
-
from rapidata.api_client.models.filter_operator import FilterOperator
|
|
16
14
|
from rapidata.api_client.models.file_asset_model import FileAssetModel
|
|
17
15
|
from rapidata.api_client.models.query_model import QueryModel
|
|
18
16
|
from rapidata.api_client.models.page_info import PageInfo
|
|
19
|
-
from rapidata.api_client.models.root_filter import RootFilter
|
|
20
17
|
from rapidata.api_client.models.source_url_metadata_model import SourceUrlMetadataModel
|
|
21
18
|
from rapidata.api_client.models.submit_prompt_model import SubmitPromptModel
|
|
22
19
|
from rapidata.api_client.models.submit_prompt_model_prompt_asset import (
|
|
@@ -155,21 +152,11 @@ class RapidataBenchmark:
|
|
|
155
152
|
total_pages = None
|
|
156
153
|
|
|
157
154
|
while True:
|
|
158
|
-
leaderboards_result = (
|
|
159
|
-
self.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Filter(
|
|
164
|
-
field="BenchmarkId",
|
|
165
|
-
operator=FilterOperator.EQ,
|
|
166
|
-
value=self.id,
|
|
167
|
-
)
|
|
168
|
-
]
|
|
169
|
-
),
|
|
170
|
-
page=PageInfo(index=current_page, size=100),
|
|
171
|
-
)
|
|
172
|
-
)
|
|
155
|
+
leaderboards_result = self.__openapi_service.benchmark_api.benchmark_benchmark_id_leaderboards_get(
|
|
156
|
+
benchmark_id=self.id,
|
|
157
|
+
request=QueryModel(
|
|
158
|
+
page=PageInfo(index=current_page, size=100),
|
|
159
|
+
),
|
|
173
160
|
)
|
|
174
161
|
|
|
175
162
|
if leaderboards_result.total_pages is None:
|
|
@@ -203,8 +203,10 @@ class RapidataOrderBuilder:
|
|
|
203
203
|
Returns:
|
|
204
204
|
RapidataOrder: The created RapidataOrder instance.
|
|
205
205
|
"""
|
|
206
|
-
if
|
|
207
|
-
|
|
206
|
+
if (
|
|
207
|
+
rapidata_config.order.autoValidationSetCreation
|
|
208
|
+
and not isinstance(self.__workflow, FreeTextWorkflow)
|
|
209
|
+
and not self.__selections
|
|
208
210
|
):
|
|
209
211
|
new_validation_set = self._set_validation_set_id()
|
|
210
212
|
else:
|
|
@@ -131,3 +131,9 @@ Your current version is: {__version__}"""
|
|
|
131
131
|
)
|
|
132
132
|
except Exception as e:
|
|
133
133
|
logger.debug("Failed to check for updates: %s", e)
|
|
134
|
+
|
|
135
|
+
def __str__(self) -> str:
|
|
136
|
+
return f"RapidataClient(environment={self._openapi_service.environment})"
|
|
137
|
+
|
|
138
|
+
def __repr__(self) -> str:
|
|
139
|
+
return self.__str__()
|
|
@@ -40,3 +40,9 @@ class AbTestSelection(RapidataSelection):
|
|
|
40
40
|
for selection in self.b_selections
|
|
41
41
|
],
|
|
42
42
|
)
|
|
43
|
+
|
|
44
|
+
def __str__(self) -> str:
|
|
45
|
+
return f"AbTestSelection(a_selections={self.a_selections}, b_selections={self.b_selections})"
|
|
46
|
+
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
return self.__str__()
|
|
@@ -33,3 +33,9 @@ class CappedSelection(RapidataSelection):
|
|
|
33
33
|
],
|
|
34
34
|
maxRapids=self.max_rapids,
|
|
35
35
|
)
|
|
36
|
+
|
|
37
|
+
def __str__(self) -> str:
|
|
38
|
+
return f"CappedSelection(selections={self.selections}, max_rapids={self.max_rapids})"
|
|
39
|
+
|
|
40
|
+
def __repr__(self) -> str:
|
|
41
|
+
return self.__str__()
|
|
@@ -72,3 +72,9 @@ class ConditionalValidationSelection(RapidataSelection):
|
|
|
72
72
|
],
|
|
73
73
|
dimensions=self.dimensions,
|
|
74
74
|
)
|
|
75
|
+
|
|
76
|
+
def __str__(self) -> str:
|
|
77
|
+
return f"ConditionalValidationSelection(validation_set_id={self.validation_set_id}, thresholds={self.thresholds}, chances={self.chances}, rapid_counts={self.rapid_counts}, dimensions={self.dimensions})"
|
|
78
|
+
|
|
79
|
+
def __repr__(self) -> str:
|
|
80
|
+
return self.__str__()
|
|
@@ -34,3 +34,9 @@ class DemographicSelection(RapidataSelection):
|
|
|
34
34
|
return DemographicSelectionModel(
|
|
35
35
|
_t="DemographicSelection", keys=self.keys, maxRapids=self.max_rapids
|
|
36
36
|
)
|
|
37
|
+
|
|
38
|
+
def __str__(self) -> str:
|
|
39
|
+
return f"DemographicSelection(keys={self.keys}, max_rapids={self.max_rapids})"
|
|
40
|
+
|
|
41
|
+
def __repr__(self) -> str:
|
|
42
|
+
return self.__str__()
|
|
@@ -35,3 +35,9 @@ class EffortSelection(RapidataSelection):
|
|
|
35
35
|
retrievalMode=self.retrieval_mode.value,
|
|
36
36
|
maxIterations=self.max_iterations,
|
|
37
37
|
)
|
|
38
|
+
|
|
39
|
+
def __str__(self) -> str:
|
|
40
|
+
return f"EffortSelection(effort_budget={self.effort_budget}, retrieval_mode={self.retrieval_mode}, max_iterations={self.max_iterations})"
|
|
41
|
+
|
|
42
|
+
def __repr__(self) -> str:
|
|
43
|
+
return self.__str__()
|
|
@@ -38,3 +38,9 @@ class LabelingSelection(RapidataSelection):
|
|
|
38
38
|
retrievalMode=self.retrieval_mode.value,
|
|
39
39
|
maxIterations=self.max_iterations,
|
|
40
40
|
)
|
|
41
|
+
|
|
42
|
+
def __str__(self) -> str:
|
|
43
|
+
return f"LabelingSelection(amount={self.amount}, retrieval_mode={self.retrieval_mode}, max_iterations={self.max_iterations})"
|
|
44
|
+
|
|
45
|
+
def __repr__(self) -> str:
|
|
46
|
+
return self.__str__()
|
|
@@ -39,3 +39,9 @@ class RapidataSelections:
|
|
|
39
39
|
demographic = DemographicSelection
|
|
40
40
|
capped = CappedSelection
|
|
41
41
|
shuffling = ShufflingSelection
|
|
42
|
+
|
|
43
|
+
def __str__(self) -> str:
|
|
44
|
+
return f"RapidataSelections(labeling={self.labeling}, validation={self.validation}, conditional_validation={self.conditional_validation}, demographic={self.demographic}, capped={self.capped}, shuffling={self.shuffling})"
|
|
45
|
+
|
|
46
|
+
def __repr__(self) -> str:
|
|
47
|
+
return self.__str__()
|
|
@@ -15,3 +15,9 @@ class StaticSelection(RapidataSelection):
|
|
|
15
15
|
|
|
16
16
|
def __init__(self, rapid_ids: list[str]):
|
|
17
17
|
self.rapid_ids = rapid_ids
|
|
18
|
+
|
|
19
|
+
def __str__(self) -> str:
|
|
20
|
+
return f"StaticSelection(rapid_ids={self.rapid_ids})"
|
|
21
|
+
|
|
22
|
+
def __repr__(self) -> str:
|
|
23
|
+
return self.__str__()
|
|
@@ -24,3 +24,9 @@ class ValidationSelection(RapidataSelection):
|
|
|
24
24
|
validationSetId=self.validation_set_id,
|
|
25
25
|
amount=self.amount,
|
|
26
26
|
)
|
|
27
|
+
|
|
28
|
+
def __str__(self) -> str:
|
|
29
|
+
return f"ValidationSelection(validation_set_id={self.validation_set_id}, amount={self.amount})"
|
|
30
|
+
|
|
31
|
+
def __repr__(self) -> str:
|
|
32
|
+
return self.__str__()
|
|
@@ -40,3 +40,9 @@ class RapidataSettings:
|
|
|
40
40
|
play_video_until_the_end = PlayVideoUntilTheEnd
|
|
41
41
|
allow_neither_both = AllowNeitherBoth
|
|
42
42
|
swap_context_instruction = SwapContextInstruction
|
|
43
|
+
|
|
44
|
+
def __str__(self) -> str:
|
|
45
|
+
return f"RapidataSettings(alert_on_fast_response={self.alert_on_fast_response}, translation_behaviour={self.translation_behaviour}, free_text_minimum_characters={self.free_text_minimum_characters}, no_shuffle={self.no_shuffle}, play_video_until_the_end={self.play_video_until_the_end}, allow_neither_both={self.allow_neither_both}, swap_context_instruction={self.swap_context_instruction})"
|
|
46
|
+
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
return self.__str__()
|
|
@@ -392,3 +392,9 @@ class RapidsManager:
|
|
|
392
392
|
total_coverage = sum(end - start for start, end in merged_ranges)
|
|
393
393
|
|
|
394
394
|
return total_coverage / total_duration
|
|
395
|
+
|
|
396
|
+
def __str__(self) -> str:
|
|
397
|
+
return "RapidsManager"
|
|
398
|
+
|
|
399
|
+
def __repr__(self) -> str:
|
|
400
|
+
return self.__str__()
|
|
@@ -70,7 +70,7 @@ class ValidationSetManager:
|
|
|
70
70
|
settings=settings,
|
|
71
71
|
)
|
|
72
72
|
)
|
|
73
|
-
return self._submit(name=order_name, rapids=rapids, dimensions=
|
|
73
|
+
return self._submit(name=order_name, rapids=rapids, dimensions=None)
|
|
74
74
|
|
|
75
75
|
def create_classification_set(
|
|
76
76
|
self,
|
|
@@ -709,3 +709,9 @@ class ValidationSetManager:
|
|
|
709
709
|
for validation_set in validation_page_result.items
|
|
710
710
|
]
|
|
711
711
|
return validation_sets
|
|
712
|
+
|
|
713
|
+
def __str__(self) -> str:
|
|
714
|
+
return "ValidationSetManager"
|
|
715
|
+
|
|
716
|
+
def __repr__(self) -> str:
|
|
717
|
+
return self.__str__()
|
|
@@ -3,8 +3,8 @@ from rapidata.api_client.models.attach_category_rapid_blueprint import (
|
|
|
3
3
|
AttachCategoryRapidBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
6
|
-
from rapidata.api_client.models.
|
|
7
|
-
|
|
6
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
7
|
+
ValidationSetZipPostRequestBlueprint,
|
|
8
8
|
)
|
|
9
9
|
from rapidata.rapidata_client.workflow import Workflow
|
|
10
10
|
from rapidata.api_client import ClassifyPayload
|
|
@@ -54,7 +54,7 @@ class ClassifyWorkflow(Workflow):
|
|
|
54
54
|
|
|
55
55
|
return SimpleWorkflowModel(
|
|
56
56
|
_t="SimpleWorkflow",
|
|
57
|
-
blueprint=
|
|
57
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
58
58
|
)
|
|
59
59
|
|
|
60
60
|
def _to_payload(self, datapoint: Datapoint) -> ClassifyPayload:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Any
|
|
2
|
-
from rapidata.api_client.models.
|
|
3
|
-
|
|
2
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
3
|
+
ValidationSetZipPostRequestBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.rapidata_client.workflow import Workflow
|
|
6
6
|
from rapidata.api_client.models.compare_rapid_blueprint import CompareRapidBlueprint
|
|
@@ -47,7 +47,7 @@ class CompareWorkflow(Workflow):
|
|
|
47
47
|
|
|
48
48
|
return SimpleWorkflowModel(
|
|
49
49
|
_t="SimpleWorkflow",
|
|
50
|
-
blueprint=
|
|
50
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
def _to_payload(self, datapoint: Datapoint) -> ComparePayload:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
2
|
-
from rapidata.api_client.models.
|
|
3
|
-
|
|
2
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
3
|
+
ValidationSetZipPostRequestBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.api_client.models.line_rapid_blueprint import LineRapidBlueprint
|
|
6
6
|
from rapidata.rapidata_client.workflow._base_workflow import Workflow
|
|
@@ -20,7 +20,8 @@ class DrawWorkflow(Workflow):
|
|
|
20
20
|
blueprint = LineRapidBlueprint(_t="LineBlueprint", target=self._target)
|
|
21
21
|
|
|
22
22
|
return SimpleWorkflowModel(
|
|
23
|
-
_t="SimpleWorkflow",
|
|
23
|
+
_t="SimpleWorkflow",
|
|
24
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
24
25
|
)
|
|
25
26
|
|
|
26
27
|
def _to_payload(self, datapoint: Datapoint) -> LinePayload:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
3
|
-
from rapidata.api_client.models.
|
|
4
|
-
|
|
3
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
4
|
+
ValidationSetZipPostRequestBlueprint,
|
|
5
5
|
)
|
|
6
6
|
from rapidata.rapidata_client.workflow import Workflow
|
|
7
7
|
from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBlueprint
|
|
@@ -52,7 +52,7 @@ class FreeTextWorkflow(Workflow):
|
|
|
52
52
|
|
|
53
53
|
return SimpleWorkflowModel(
|
|
54
54
|
_t="SimpleWorkflow",
|
|
55
|
-
blueprint=
|
|
55
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
def _to_payload(self, datapoint: Datapoint) -> FreeTextPayload:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
2
|
-
from rapidata.api_client.models.
|
|
3
|
-
|
|
2
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
3
|
+
ValidationSetZipPostRequestBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBlueprint
|
|
6
6
|
from rapidata.rapidata_client.workflow._base_workflow import Workflow
|
|
@@ -20,7 +20,8 @@ class LocateWorkflow(Workflow):
|
|
|
20
20
|
blueprint = LocateRapidBlueprint(_t="LocateBlueprint", target=self._target)
|
|
21
21
|
|
|
22
22
|
return SimpleWorkflowModel(
|
|
23
|
-
_t="SimpleWorkflow",
|
|
23
|
+
_t="SimpleWorkflow",
|
|
24
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
24
25
|
)
|
|
25
26
|
|
|
26
27
|
def _to_payload(self, datapoint: Datapoint) -> LocatePayload:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
2
|
-
from rapidata.api_client.models.
|
|
3
|
-
|
|
2
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
3
|
+
ValidationSetZipPostRequestBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.api_client.models.transcription_rapid_blueprint import (
|
|
6
6
|
TranscriptionRapidBlueprint,
|
|
@@ -40,7 +40,8 @@ class SelectWordsWorkflow(Workflow):
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
return SimpleWorkflowModel(
|
|
43
|
-
_t="SimpleWorkflow",
|
|
43
|
+
_t="SimpleWorkflow",
|
|
44
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
44
45
|
)
|
|
45
46
|
|
|
46
47
|
def _to_payload(self, datapoint: Datapoint) -> TranscriptionPayload:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
2
|
-
from rapidata.api_client.models.
|
|
3
|
-
|
|
2
|
+
from rapidata.api_client.models.validation_set_zip_post_request_blueprint import (
|
|
3
|
+
ValidationSetZipPostRequestBlueprint,
|
|
4
4
|
)
|
|
5
5
|
from rapidata.api_client.models.scrub_rapid_blueprint import ScrubRapidBlueprint
|
|
6
6
|
from rapidata.rapidata_client.workflow._base_workflow import Workflow
|
|
@@ -33,7 +33,8 @@ class TimestampWorkflow(Workflow):
|
|
|
33
33
|
blueprint = ScrubRapidBlueprint(_t="ScrubBlueprint", target=self._instruction)
|
|
34
34
|
|
|
35
35
|
return SimpleWorkflowModel(
|
|
36
|
-
_t="SimpleWorkflow",
|
|
36
|
+
_t="SimpleWorkflow",
|
|
37
|
+
blueprint=ValidationSetZipPostRequestBlueprint(blueprint),
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
def _to_payload(self, datapoint: Datapoint) -> ScrubPayload:
|
|
@@ -36,12 +36,10 @@ class OpenAPIService:
|
|
|
36
36
|
cert_path = _get_local_certificate()
|
|
37
37
|
|
|
38
38
|
logger.debug(
|
|
39
|
-
"Using cert_path: %s environment: %s
|
|
39
|
+
"Using cert_path: %s environment: %s client_id: %s",
|
|
40
40
|
cert_path,
|
|
41
41
|
environment,
|
|
42
|
-
token,
|
|
43
42
|
client_id,
|
|
44
|
-
client_secret,
|
|
45
43
|
)
|
|
46
44
|
logger.debug("Initializing OpenAPIService")
|
|
47
45
|
self.credential_manager = CredentialManager(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rapidata
|
|
3
|
-
Version: 2.41.
|
|
3
|
+
Version: 2.41.2
|
|
4
4
|
Summary: Rapidata package containing the Rapidata Python Client to interact with the Rapidata Web API in an easy way.
|
|
5
5
|
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: Rapidata AG
|
|
7
8
|
Author-email: info@rapidata.ai
|
|
8
9
|
Requires-Python: >=3.10,<4.0
|
|
@@ -12,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
17
|
Requires-Dist: authlib (>=1.5.1,<2.0.0)
|
|
16
18
|
Requires-Dist: colorama (==0.4.6)
|
|
17
19
|
Requires-Dist: deprecated (>=1.2.14,<2.0.0)
|