rapidata 1.2.0__py3-none-any.whl → 1.2.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.
- rapidata/api_client/__init__.py +25 -5
- rapidata/api_client/api/dataset_api.py +388 -388
- rapidata/api_client/api/workflow_api.py +18 -1064
- rapidata/api_client/models/__init__.py +25 -5
- rapidata/api_client/models/classification_metadata_model.py +98 -0
- 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_model1.py +4 -18
- rapidata/api_client/models/compare_workflow_model1_referee.py +154 -0
- rapidata/api_client/models/completed_rapid_model.py +3 -3
- rapidata/api_client/models/completed_rapid_model_asset.py +170 -0
- rapidata/api_client/models/count_metadata_model.py +98 -0
- rapidata/api_client/models/demographic_metadata_model.py +100 -0
- rapidata/api_client/models/file_asset_model.py +3 -3
- rapidata/api_client/models/file_asset_model1.py +108 -0
- rapidata/api_client/models/file_asset_model1_metadata_inner.py +252 -0
- rapidata/api_client/models/file_asset_model2.py +108 -0
- rapidata/api_client/models/file_asset_model_metadata_inner.py +252 -0
- rapidata/api_client/models/image_dimension_metadata_model.py +100 -0
- rapidata/api_client/models/in_progress_rapid_model.py +3 -3
- rapidata/api_client/models/location_metadata_model.py +100 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/multi_asset_model1.py +118 -0
- rapidata/api_client/models/multi_asset_model1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_model2.py +118 -0
- rapidata/api_client/models/not_started_rapid_model.py +3 -3
- rapidata/api_client/models/null_asset_model.py +3 -3
- rapidata/api_client/models/null_asset_model1.py +106 -0
- rapidata/api_client/models/null_asset_model2.py +106 -0
- rapidata/api_client/models/original_filename_metadata_model.py +98 -0
- rapidata/api_client/models/prompt_metadata_model.py +98 -0
- rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
- rapidata/api_client/models/ranked_datapoint_model.py +3 -3
- rapidata/api_client/models/simple_workflow_config.py +6 -6
- rapidata/api_client/models/simple_workflow_config_model.py +3 -3
- rapidata/api_client/models/simple_workflow_model1.py +7 -21
- rapidata/api_client/models/simple_workflow_model1_blueprint.py +238 -0
- rapidata/api_client/models/text_asset_model.py +3 -3
- rapidata/api_client/models/text_asset_model1.py +108 -0
- rapidata/api_client/models/text_asset_model2.py +108 -0
- rapidata/api_client/models/text_metadata_model.py +98 -0
- rapidata/api_client/models/transcription_metadata_model.py +98 -0
- rapidata/api_client/models/translated_prompt_metadata_model.py +102 -0
- rapidata/api_client/models/translated_string.py +93 -0
- rapidata/api_client_README.md +26 -10
- rapidata/rapidata_client/assets/media_asset.py +1 -1
- rapidata/rapidata_client/assets/multi_asset.py +12 -3
- rapidata/rapidata_client/dataset/rapidata_dataset.py +43 -9
- rapidata/rapidata_client/order/rapidata_order_builder.py +85 -16
- rapidata/rapidata_client/selection/demographic_selection.py +3 -2
- {rapidata-1.2.0.dist-info → rapidata-1.2.1.dist-info}/METADATA +1 -1
- {rapidata-1.2.0.dist-info → rapidata-1.2.1.dist-info}/RECORD +54 -29
- {rapidata-1.2.0.dist-info → rapidata-1.2.1.dist-info}/LICENSE +0 -0
- {rapidata-1.2.0.dist-info → rapidata-1.2.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class TranscriptionMetadataModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
TranscriptionMetadataModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for TranscriptionMetadataModel", alias="_t")
|
|
30
|
+
identifier: StrictStr
|
|
31
|
+
transcription: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "identifier", "transcription"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['TranscriptionMetadataModel']):
|
|
38
|
+
raise ValueError("must be one of enum values ('TranscriptionMetadataModel')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of TranscriptionMetadataModel from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of TranscriptionMetadataModel 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
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadataModel',
|
|
93
|
+
"identifier": obj.get("identifier"),
|
|
94
|
+
"transcription": obj.get("transcription")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.translated_string import TranslatedString
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TranslatedPromptMetadataModel(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TranslatedPromptMetadataModel
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for TranslatedPromptMetadata", alias="_t")
|
|
31
|
+
prompt: TranslatedString
|
|
32
|
+
identifier: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "prompt", "identifier"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['TranslatedPromptMetadata']):
|
|
39
|
+
raise ValueError("must be one of enum values ('TranslatedPromptMetadata')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of TranslatedPromptMetadataModel from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of prompt
|
|
82
|
+
if self.prompt:
|
|
83
|
+
_dict['prompt'] = self.prompt.to_dict()
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of TranslatedPromptMetadataModel from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranslatedPromptMetadata',
|
|
97
|
+
"prompt": TranslatedString.from_dict(obj["prompt"]) if obj.get("prompt") is not None else None,
|
|
98
|
+
"identifier": obj.get("identifier")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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, StrictBool, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class TranslatedString(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
TranslatedString
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
was_translated: StrictBool = Field(alias="wasTranslated")
|
|
30
|
+
english_text: StrictStr = Field(alias="englishText")
|
|
31
|
+
text: StrictStr
|
|
32
|
+
target_language: StrictStr = Field(alias="targetLanguage")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["wasTranslated", "englishText", "text", "targetLanguage"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of TranslatedString from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of TranslatedString from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"wasTranslated": obj.get("wasTranslated"),
|
|
87
|
+
"englishText": obj.get("englishText"),
|
|
88
|
+
"text": obj.get("text"),
|
|
89
|
+
"targetLanguage": obj.get("targetLanguage")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
rapidata/api_client_README.md
CHANGED
|
@@ -81,6 +81,7 @@ Class | Method | HTTP request | Description
|
|
|
81
81
|
*DatapointApi* | [**datapoint_delete_delete**](rapidata/api_client/docs/DatapointApi.md#datapoint_delete_delete) | **DELETE** /Datapoint/Delete | Delete a datapoint.
|
|
82
82
|
*DatapointApi* | [**datapoint_get_all_datapoints_by_dataset_id_get**](rapidata/api_client/docs/DatapointApi.md#datapoint_get_all_datapoints_by_dataset_id_get) | **GET** /Datapoint/GetAllDatapointsByDatasetId | Get all datapoints of a dataset.
|
|
83
83
|
*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.
|
|
84
|
+
*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.
|
|
84
85
|
*DatasetApi* | [**dataset_create_datapoint_post**](rapidata/api_client/docs/DatasetApi.md#dataset_create_datapoint_post) | **POST** /Dataset/CreateDatapoint | Creates a single datapoint.
|
|
85
86
|
*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.
|
|
86
87
|
*DatasetApi* | [**dataset_import_post**](rapidata/api_client/docs/DatasetApi.md#dataset_import_post) | **POST** /Dataset/Import | Imports datapoints from a csv file.
|
|
@@ -88,7 +89,6 @@ Class | Method | HTTP request | Description
|
|
|
88
89
|
*DatasetApi* | [**dataset_upload_datapoint_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_datapoint_post) | **POST** /Dataset/UploadDatapoint | Creates a new multi asset datapoint.
|
|
89
90
|
*DatasetApi* | [**dataset_upload_files_from_s3_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_files_from_s3_post) | **POST** /Dataset/UploadFilesFromS3 | Uploads files from an S3 bucket to a dataset.
|
|
90
91
|
*DatasetApi* | [**dataset_upload_images_to_dataset_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_images_to_dataset_post) | **POST** /Dataset/UploadImagesToDataset | Uploads images to a dataset.
|
|
91
|
-
*DatasetApi* | [**dataset_upload_text_sources_to_dataset_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_text_sources_to_dataset_post) | **POST** /Dataset/UploadTextSourcesToDataset | Creates new datapoints from text sources.
|
|
92
92
|
*IdentityApi* | [**identity_confirm_get**](rapidata/api_client/docs/IdentityApi.md#identity_confirm_get) | **GET** /Identity/Confirm | Confirms a user's signup by a token.
|
|
93
93
|
*IdentityApi* | [**identity_create_client_post**](rapidata/api_client/docs/IdentityApi.md#identity_create_client_post) | **POST** /Identity/CreateClient | Creates a new client for a customer.
|
|
94
94
|
*IdentityApi* | [**identity_external_login_callback_get**](rapidata/api_client/docs/IdentityApi.md#identity_external_login_callback_get) | **GET** /Identity/ExternalLoginCallback | Logs in a user using after receiving a grant from an external provider.
|
|
@@ -142,15 +142,11 @@ Class | Method | HTTP request | Description
|
|
|
142
142
|
*ValidationApi* | [**validation_import_compare_post**](rapidata/api_client/docs/ValidationApi.md#validation_import_compare_post) | **POST** /Validation/ImportCompare | Imports a compare validation set from a zip file.
|
|
143
143
|
*ValidationApi* | [**validation_import_post**](rapidata/api_client/docs/ValidationApi.md#validation_import_post) | **POST** /Validation/Import | Imports a validation set from a zip file.
|
|
144
144
|
*ValidationApi* | [**validation_query_validation_sets_get**](rapidata/api_client/docs/ValidationApi.md#validation_query_validation_sets_get) | **GET** /Validation/QueryValidationSets | Queries validation sets based on the provided filter, paging and sorting criteria.
|
|
145
|
-
*WorkflowApi* | [**workflow_create_independent_post**](rapidata/api_client/docs/WorkflowApi.md#workflow_create_independent_post) | **POST** /Workflow/CreateIndependent | Creates an independent workflow.
|
|
146
145
|
*WorkflowApi* | [**workflow_delete_delete**](rapidata/api_client/docs/WorkflowApi.md#workflow_delete_delete) | **DELETE** /Workflow/Delete | Deletes a workflow.
|
|
147
146
|
*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.
|
|
148
147
|
*WorkflowApi* | [**workflow_get_progress_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_get_progress_get) | **GET** /Workflow/GetProgress | Get the progress of a workflow.
|
|
149
148
|
*WorkflowApi* | [**workflow_get_result_overview_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_get_result_overview_get) | **GET** /Workflow/GetResultOverview | Get the result overview for a workflow.
|
|
150
|
-
*WorkflowApi* | [**workflow_pause_post**](rapidata/api_client/docs/WorkflowApi.md#workflow_pause_post) | **POST** /Workflow/Pause | Pauses a running workflow.
|
|
151
149
|
*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.
|
|
152
|
-
*WorkflowApi* | [**workflow_resume_post**](rapidata/api_client/docs/WorkflowApi.md#workflow_resume_post) | **POST** /Workflow/Resume | Resumes a paused workflow.
|
|
153
|
-
*WorkflowApi* | [**workflow_start_independent_post**](rapidata/api_client/docs/WorkflowApi.md#workflow_start_independent_post) | **POST** /Workflow/StartIndependent | Starts an independent workflow.
|
|
154
150
|
|
|
155
151
|
|
|
156
152
|
## Documentation For Models
|
|
@@ -185,6 +181,7 @@ Class | Method | HTTP request | Description
|
|
|
185
181
|
- [CappedSelectionSelectionsInner](rapidata/api_client/docs/CappedSelectionSelectionsInner.md)
|
|
186
182
|
- [ClassificationMetadata](rapidata/api_client/docs/ClassificationMetadata.md)
|
|
187
183
|
- [ClassificationMetadataFilterConfig](rapidata/api_client/docs/ClassificationMetadataFilterConfig.md)
|
|
184
|
+
- [ClassificationMetadataModel](rapidata/api_client/docs/ClassificationMetadataModel.md)
|
|
188
185
|
- [ClassifyPayload](rapidata/api_client/docs/ClassifyPayload.md)
|
|
189
186
|
- [CloneDatasetModel](rapidata/api_client/docs/CloneDatasetModel.md)
|
|
190
187
|
- [CloneOrderModel](rapidata/api_client/docs/CloneOrderModel.md)
|
|
@@ -195,15 +192,17 @@ Class | Method | HTTP request | Description
|
|
|
195
192
|
- [CompareTruth](rapidata/api_client/docs/CompareTruth.md)
|
|
196
193
|
- [CompareWorkflowConfig](rapidata/api_client/docs/CompareWorkflowConfig.md)
|
|
197
194
|
- [CompareWorkflowConfigModel](rapidata/api_client/docs/CompareWorkflowConfigModel.md)
|
|
198
|
-
- [CompareWorkflowConfigReferee](rapidata/api_client/docs/CompareWorkflowConfigReferee.md)
|
|
199
195
|
- [CompareWorkflowGetResultOverviewGet200Response](rapidata/api_client/docs/CompareWorkflowGetResultOverviewGet200Response.md)
|
|
200
196
|
- [CompareWorkflowModel](rapidata/api_client/docs/CompareWorkflowModel.md)
|
|
201
197
|
- [CompareWorkflowModel1](rapidata/api_client/docs/CompareWorkflowModel1.md)
|
|
198
|
+
- [CompareWorkflowModel1Referee](rapidata/api_client/docs/CompareWorkflowModel1Referee.md)
|
|
202
199
|
- [CompletedRapidModel](rapidata/api_client/docs/CompletedRapidModel.md)
|
|
200
|
+
- [CompletedRapidModelAsset](rapidata/api_client/docs/CompletedRapidModelAsset.md)
|
|
203
201
|
- [ConditionalValidationSelection](rapidata/api_client/docs/ConditionalValidationSelection.md)
|
|
204
202
|
- [Coordinate](rapidata/api_client/docs/Coordinate.md)
|
|
205
203
|
- [CountClassificationMetadataFilterConfig](rapidata/api_client/docs/CountClassificationMetadataFilterConfig.md)
|
|
206
204
|
- [CountMetadata](rapidata/api_client/docs/CountMetadata.md)
|
|
205
|
+
- [CountMetadataModel](rapidata/api_client/docs/CountMetadataModel.md)
|
|
207
206
|
- [CountryUserFilterModel](rapidata/api_client/docs/CountryUserFilterModel.md)
|
|
208
207
|
- [CreateClientModel](rapidata/api_client/docs/CreateClientModel.md)
|
|
209
208
|
- [CreateComplexOrderModel](rapidata/api_client/docs/CreateComplexOrderModel.md)
|
|
@@ -213,9 +212,6 @@ Class | Method | HTTP request | Description
|
|
|
213
212
|
- [CreateDatasetArtifactModelDataset](rapidata/api_client/docs/CreateDatasetArtifactModelDataset.md)
|
|
214
213
|
- [CreateDemographicRapidModel](rapidata/api_client/docs/CreateDemographicRapidModel.md)
|
|
215
214
|
- [CreateEmptyValidationSetResult](rapidata/api_client/docs/CreateEmptyValidationSetResult.md)
|
|
216
|
-
- [CreateIndependentWorkflowModel](rapidata/api_client/docs/CreateIndependentWorkflowModel.md)
|
|
217
|
-
- [CreateIndependentWorkflowModelWorkflowConfig](rapidata/api_client/docs/CreateIndependentWorkflowModelWorkflowConfig.md)
|
|
218
|
-
- [CreateIndependentWorkflowResult](rapidata/api_client/docs/CreateIndependentWorkflowResult.md)
|
|
219
215
|
- [CreateOrderModel](rapidata/api_client/docs/CreateOrderModel.md)
|
|
220
216
|
- [CreateOrderModelReferee](rapidata/api_client/docs/CreateOrderModelReferee.md)
|
|
221
217
|
- [CreateOrderModelUserFiltersInner](rapidata/api_client/docs/CreateOrderModelUserFiltersInner.md)
|
|
@@ -236,6 +232,7 @@ Class | Method | HTTP request | Description
|
|
|
236
232
|
- [DatapointModelAsset](rapidata/api_client/docs/DatapointModelAsset.md)
|
|
237
233
|
- [DatasetArtifactModel](rapidata/api_client/docs/DatasetArtifactModel.md)
|
|
238
234
|
- [DatasetEvaluationStepModel](rapidata/api_client/docs/DatasetEvaluationStepModel.md)
|
|
235
|
+
- [DemographicMetadataModel](rapidata/api_client/docs/DemographicMetadataModel.md)
|
|
239
236
|
- [DemographicSelection](rapidata/api_client/docs/DemographicSelection.md)
|
|
240
237
|
- [EarlyStoppingRefereeModel](rapidata/api_client/docs/EarlyStoppingRefereeModel.md)
|
|
241
238
|
- [EmptyValidationTruth](rapidata/api_client/docs/EmptyValidationTruth.md)
|
|
@@ -247,6 +244,10 @@ Class | Method | HTTP request | Description
|
|
|
247
244
|
- [FileAsset](rapidata/api_client/docs/FileAsset.md)
|
|
248
245
|
- [FileAssetMetadataInner](rapidata/api_client/docs/FileAssetMetadataInner.md)
|
|
249
246
|
- [FileAssetModel](rapidata/api_client/docs/FileAssetModel.md)
|
|
247
|
+
- [FileAssetModel1](rapidata/api_client/docs/FileAssetModel1.md)
|
|
248
|
+
- [FileAssetModel1MetadataInner](rapidata/api_client/docs/FileAssetModel1MetadataInner.md)
|
|
249
|
+
- [FileAssetModel2](rapidata/api_client/docs/FileAssetModel2.md)
|
|
250
|
+
- [FileAssetModelMetadataInner](rapidata/api_client/docs/FileAssetModelMetadataInner.md)
|
|
250
251
|
- [Filter](rapidata/api_client/docs/Filter.md)
|
|
251
252
|
- [FilterOperator](rapidata/api_client/docs/FilterOperator.md)
|
|
252
253
|
- [FreeTextPayload](rapidata/api_client/docs/FreeTextPayload.md)
|
|
@@ -272,6 +273,7 @@ Class | Method | HTTP request | Description
|
|
|
272
273
|
- [GetWorkflowResultOverviewResult](rapidata/api_client/docs/GetWorkflowResultOverviewResult.md)
|
|
273
274
|
- [IWorkflowModelPagedResult](rapidata/api_client/docs/IWorkflowModelPagedResult.md)
|
|
274
275
|
- [ImageDimensionMetadata](rapidata/api_client/docs/ImageDimensionMetadata.md)
|
|
276
|
+
- [ImageDimensionMetadataModel](rapidata/api_client/docs/ImageDimensionMetadataModel.md)
|
|
275
277
|
- [ImportFromFileResult](rapidata/api_client/docs/ImportFromFileResult.md)
|
|
276
278
|
- [ImportValidationSetFromFileResult](rapidata/api_client/docs/ImportValidationSetFromFileResult.md)
|
|
277
279
|
- [InProgressRapidModel](rapidata/api_client/docs/InProgressRapidModel.md)
|
|
@@ -294,11 +296,15 @@ Class | Method | HTTP request | Description
|
|
|
294
296
|
- [LocateResult](rapidata/api_client/docs/LocateResult.md)
|
|
295
297
|
- [LocationMetadata](rapidata/api_client/docs/LocationMetadata.md)
|
|
296
298
|
- [LocationMetadataExistsFilterConfig](rapidata/api_client/docs/LocationMetadataExistsFilterConfig.md)
|
|
299
|
+
- [LocationMetadataModel](rapidata/api_client/docs/LocationMetadataModel.md)
|
|
297
300
|
- [LogicOperator](rapidata/api_client/docs/LogicOperator.md)
|
|
298
301
|
- [LoginModel](rapidata/api_client/docs/LoginModel.md)
|
|
299
302
|
- [MetadataVisibilities](rapidata/api_client/docs/MetadataVisibilities.md)
|
|
300
303
|
- [MultiAsset](rapidata/api_client/docs/MultiAsset.md)
|
|
301
304
|
- [MultiAssetModel](rapidata/api_client/docs/MultiAssetModel.md)
|
|
305
|
+
- [MultiAssetModel1](rapidata/api_client/docs/MultiAssetModel1.md)
|
|
306
|
+
- [MultiAssetModel1AssetsInner](rapidata/api_client/docs/MultiAssetModel1AssetsInner.md)
|
|
307
|
+
- [MultiAssetModel2](rapidata/api_client/docs/MultiAssetModel2.md)
|
|
302
308
|
- [NaiveRefereeConfig](rapidata/api_client/docs/NaiveRefereeConfig.md)
|
|
303
309
|
- [NaiveRefereeModel](rapidata/api_client/docs/NaiveRefereeModel.md)
|
|
304
310
|
- [NamedClassification](rapidata/api_client/docs/NamedClassification.md)
|
|
@@ -311,10 +317,13 @@ Class | Method | HTTP request | Description
|
|
|
311
317
|
- [NotStartedRapidModel](rapidata/api_client/docs/NotStartedRapidModel.md)
|
|
312
318
|
- [NullAsset](rapidata/api_client/docs/NullAsset.md)
|
|
313
319
|
- [NullAssetModel](rapidata/api_client/docs/NullAssetModel.md)
|
|
320
|
+
- [NullAssetModel1](rapidata/api_client/docs/NullAssetModel1.md)
|
|
321
|
+
- [NullAssetModel2](rapidata/api_client/docs/NullAssetModel2.md)
|
|
314
322
|
- [OrderModel](rapidata/api_client/docs/OrderModel.md)
|
|
315
323
|
- [OrderQueryGet200Response](rapidata/api_client/docs/OrderQueryGet200Response.md)
|
|
316
324
|
- [OrderState](rapidata/api_client/docs/OrderState.md)
|
|
317
325
|
- [OriginalFilenameMetadata](rapidata/api_client/docs/OriginalFilenameMetadata.md)
|
|
326
|
+
- [OriginalFilenameMetadataModel](rapidata/api_client/docs/OriginalFilenameMetadataModel.md)
|
|
318
327
|
- [PageInfo](rapidata/api_client/docs/PageInfo.md)
|
|
319
328
|
- [PolygonPayload](rapidata/api_client/docs/PolygonPayload.md)
|
|
320
329
|
- [PolygonRapidBlueprint](rapidata/api_client/docs/PolygonRapidBlueprint.md)
|
|
@@ -324,6 +333,7 @@ Class | Method | HTTP request | Description
|
|
|
324
333
|
- [ProbabilisticAttachCategoryRefereeConfig](rapidata/api_client/docs/ProbabilisticAttachCategoryRefereeConfig.md)
|
|
325
334
|
- [PromptMetadata](rapidata/api_client/docs/PromptMetadata.md)
|
|
326
335
|
- [PromptMetadataInput](rapidata/api_client/docs/PromptMetadataInput.md)
|
|
336
|
+
- [PromptMetadataModel](rapidata/api_client/docs/PromptMetadataModel.md)
|
|
327
337
|
- [PublicTextMetadataInput](rapidata/api_client/docs/PublicTextMetadataInput.md)
|
|
328
338
|
- [QueryCampaignsModel](rapidata/api_client/docs/QueryCampaignsModel.md)
|
|
329
339
|
- [QueryModel](rapidata/api_client/docs/QueryModel.md)
|
|
@@ -345,12 +355,12 @@ Class | Method | HTTP request | Description
|
|
|
345
355
|
- [SignupCustomerModel](rapidata/api_client/docs/SignupCustomerModel.md)
|
|
346
356
|
- [SignupShadowCustomerModel](rapidata/api_client/docs/SignupShadowCustomerModel.md)
|
|
347
357
|
- [SimpleWorkflowConfig](rapidata/api_client/docs/SimpleWorkflowConfig.md)
|
|
348
|
-
- [SimpleWorkflowConfigBlueprint](rapidata/api_client/docs/SimpleWorkflowConfigBlueprint.md)
|
|
349
358
|
- [SimpleWorkflowConfigModel](rapidata/api_client/docs/SimpleWorkflowConfigModel.md)
|
|
350
359
|
- [SimpleWorkflowConfigModelBlueprint](rapidata/api_client/docs/SimpleWorkflowConfigModelBlueprint.md)
|
|
351
360
|
- [SimpleWorkflowGetResultOverviewGet200Response](rapidata/api_client/docs/SimpleWorkflowGetResultOverviewGet200Response.md)
|
|
352
361
|
- [SimpleWorkflowModel](rapidata/api_client/docs/SimpleWorkflowModel.md)
|
|
353
362
|
- [SimpleWorkflowModel1](rapidata/api_client/docs/SimpleWorkflowModel1.md)
|
|
363
|
+
- [SimpleWorkflowModel1Blueprint](rapidata/api_client/docs/SimpleWorkflowModel1Blueprint.md)
|
|
354
364
|
- [SimpleWorkflowModelBlueprint](rapidata/api_client/docs/SimpleWorkflowModelBlueprint.md)
|
|
355
365
|
- [SkipResult](rapidata/api_client/docs/SkipResult.md)
|
|
356
366
|
- [SortCriterion](rapidata/api_client/docs/SortCriterion.md)
|
|
@@ -360,14 +370,20 @@ Class | Method | HTTP request | Description
|
|
|
360
370
|
- [SubmitCocoResult](rapidata/api_client/docs/SubmitCocoResult.md)
|
|
361
371
|
- [TextAsset](rapidata/api_client/docs/TextAsset.md)
|
|
362
372
|
- [TextAssetModel](rapidata/api_client/docs/TextAssetModel.md)
|
|
373
|
+
- [TextAssetModel1](rapidata/api_client/docs/TextAssetModel1.md)
|
|
374
|
+
- [TextAssetModel2](rapidata/api_client/docs/TextAssetModel2.md)
|
|
363
375
|
- [TextMetadata](rapidata/api_client/docs/TextMetadata.md)
|
|
376
|
+
- [TextMetadataModel](rapidata/api_client/docs/TextMetadataModel.md)
|
|
364
377
|
- [TranscriptionMetadata](rapidata/api_client/docs/TranscriptionMetadata.md)
|
|
365
378
|
- [TranscriptionMetadataInput](rapidata/api_client/docs/TranscriptionMetadataInput.md)
|
|
379
|
+
- [TranscriptionMetadataModel](rapidata/api_client/docs/TranscriptionMetadataModel.md)
|
|
366
380
|
- [TranscriptionPayload](rapidata/api_client/docs/TranscriptionPayload.md)
|
|
367
381
|
- [TranscriptionRapidBlueprint](rapidata/api_client/docs/TranscriptionRapidBlueprint.md)
|
|
368
382
|
- [TranscriptionResult](rapidata/api_client/docs/TranscriptionResult.md)
|
|
369
383
|
- [TranscriptionTruth](rapidata/api_client/docs/TranscriptionTruth.md)
|
|
370
384
|
- [TranscriptionWord](rapidata/api_client/docs/TranscriptionWord.md)
|
|
385
|
+
- [TranslatedPromptMetadataModel](rapidata/api_client/docs/TranslatedPromptMetadataModel.md)
|
|
386
|
+
- [TranslatedString](rapidata/api_client/docs/TranslatedString.md)
|
|
371
387
|
- [UnlockOrderResult](rapidata/api_client/docs/UnlockOrderResult.md)
|
|
372
388
|
- [UpdateAccessModel](rapidata/api_client/docs/UpdateAccessModel.md)
|
|
373
389
|
- [UpdateOrderModel](rapidata/api_client/docs/UpdateOrderModel.md)
|
|
@@ -29,5 +29,5 @@ class MediaAsset(BaseAsset):
|
|
|
29
29
|
FileNotFoundError: If the provided file path does not exist.
|
|
30
30
|
"""
|
|
31
31
|
if not os.path.exists(path):
|
|
32
|
-
raise FileNotFoundError(f"File not found: {path}")
|
|
32
|
+
raise FileNotFoundError(f"File not found: {path}, please provide a valid local file path.")
|
|
33
33
|
self.path = path
|
|
@@ -4,7 +4,8 @@ Defines the MultiAsset class for handling multiple BaseAsset instances.
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
from rapidata.rapidata_client.assets.base_asset import BaseAsset
|
|
7
|
-
from
|
|
7
|
+
from rapidata.rapidata_client.assets import MediaAsset, TextAsset
|
|
8
|
+
from typing import Iterator, Sequence
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class MultiAsset(BaseAsset):
|
|
@@ -16,7 +17,7 @@ class MultiAsset(BaseAsset):
|
|
|
16
17
|
assets (List[BaseAsset]): A list of BaseAsset instances to be managed together.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
def __init__(self, assets:
|
|
20
|
+
def __init__(self, assets: Sequence[BaseAsset]) -> None:
|
|
20
21
|
"""
|
|
21
22
|
Initialize a MultiAsset instance.
|
|
22
23
|
|
|
@@ -25,8 +26,16 @@ class MultiAsset(BaseAsset):
|
|
|
25
26
|
"""
|
|
26
27
|
if len(assets) != 2:
|
|
27
28
|
raise ValueError("Assets must come in pairs for comparison tasks.")
|
|
29
|
+
|
|
30
|
+
for asset in assets:
|
|
31
|
+
if not isinstance(asset, (TextAsset, MediaAsset)):
|
|
32
|
+
raise TypeError("All assets must be a TextAsset or MediaAsset.")
|
|
33
|
+
|
|
34
|
+
if not all(isinstance(asset, type(assets[0])) for asset in assets):
|
|
35
|
+
raise ValueError("All assets must be of the same type.")
|
|
36
|
+
|
|
28
37
|
self.assets = assets
|
|
29
|
-
|
|
38
|
+
|
|
30
39
|
def __len__(self) -> int:
|
|
31
40
|
"""
|
|
32
41
|
Get the number of assets in the MultiAsset.
|
|
@@ -23,18 +23,46 @@ class RapidataDataset:
|
|
|
23
23
|
self.openapi_service = openapi_service
|
|
24
24
|
self.local_file_service = LocalFileService()
|
|
25
25
|
|
|
26
|
-
def add_texts(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
def add_texts(
|
|
27
|
+
self,
|
|
28
|
+
text_assets: list[TextAsset] | list[MultiAsset],
|
|
29
|
+
max_workers: int = 10,
|
|
30
|
+
):
|
|
31
|
+
for text_asset in text_assets:
|
|
32
|
+
if isinstance(text_asset, MultiAsset):
|
|
33
|
+
assert all(
|
|
34
|
+
isinstance(asset, TextAsset) for asset in text_asset.assets
|
|
35
|
+
), "All assets in a MultiAsset must be of type TextAsset."
|
|
36
|
+
|
|
37
|
+
def upload_text_datapoint(text_asset: TextAsset | MultiAsset) -> None:
|
|
38
|
+
if isinstance(text_asset, TextAsset):
|
|
39
|
+
texts = [text_asset.text]
|
|
40
|
+
elif isinstance(text_asset, MultiAsset):
|
|
41
|
+
texts = [asset.text for asset in text_asset.assets if isinstance(asset, TextAsset)]
|
|
42
|
+
else:
|
|
43
|
+
raise ValueError(f"Unsupported asset type: {type(text_asset)}")
|
|
44
|
+
|
|
45
|
+
model = UploadTextSourcesToDatasetModel(
|
|
46
|
+
datasetId=self.dataset_id,
|
|
47
|
+
textSources=texts
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
self.openapi_service.dataset_api.dataset_creat_text_datapoint_post(model)
|
|
51
|
+
|
|
52
|
+
total_uploads = len(text_assets)
|
|
53
|
+
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
54
|
+
futures = [
|
|
55
|
+
executor.submit(upload_text_datapoint, text_asset)
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
with tqdm(total=total_uploads, desc="Uploading text datapoints") as pbar:
|
|
59
|
+
for future in as_completed(futures):
|
|
60
|
+
future.result() # This will raise any exceptions that occurred during execution
|
|
61
|
+
pbar.update(1)
|
|
34
62
|
|
|
35
63
|
def add_media_from_paths(
|
|
36
64
|
self,
|
|
37
|
-
media_paths: list[MediaAsset |
|
|
65
|
+
media_paths: list[MediaAsset] | list[MultiAsset], # where multiasset is a list of media assets
|
|
38
66
|
metadata: list[Metadata] | None = None,
|
|
39
67
|
max_workers: int = 10,
|
|
40
68
|
):
|
|
@@ -42,6 +70,12 @@ class RapidataDataset:
|
|
|
42
70
|
raise ValueError(
|
|
43
71
|
"metadata must be None or have the same length as media_paths"
|
|
44
72
|
)
|
|
73
|
+
|
|
74
|
+
for media_path in media_paths:
|
|
75
|
+
if isinstance(media_path, MultiAsset):
|
|
76
|
+
assert all(
|
|
77
|
+
isinstance(asset, MediaAsset) for asset in media_path.assets
|
|
78
|
+
), "All assets in a MultiAsset must be of type MediaAsset."
|
|
45
79
|
|
|
46
80
|
def upload_datapoint(media_asset: MediaAsset | MultiAsset, meta: Metadata | None) -> None:
|
|
47
81
|
if isinstance(media_asset, MediaAsset):
|