Rapidata order builder
RapidataOrderBuilder #
Builder object for creating Rapidata orders.
Use the fluent interface to set the desired configuration. Add a workflow to the order using .workflow()
and finally call .create()
to create the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openapi_service |
OpenAPIService
|
The OpenAPIService instance. |
required |
name |
str
|
The name of the order. |
required |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openapi_service |
OpenAPIService
|
The OpenAPIService instance. |
required |
name |
str
|
The name of the order. |
required |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
create #
create(
submit: bool = True, max_workers: int = 10
) -> RapidataOrder
Create the Rapidata order by making the necessary API calls based on the builder's configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
submit |
bool
|
Whether to submit the order upon creation. Defaults to True. |
True
|
max_workers |
int
|
The maximum number of worker threads for processing media paths. Defaults to 10. |
10
|
Raises:
Type | Description |
---|---|
ValueError
|
If both media paths and texts are provided, or if neither is provided. |
AssertionError
|
If the workflow is a CompareWorkflow and media paths are not in pairs. |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrder |
RapidataOrder
|
The created RapidataOrder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
workflow #
workflow(workflow: Workflow) -> RapidataOrderBuilder
Set the workflow for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workflow |
Workflow
|
The workflow to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
referee #
referee(referee: Referee) -> RapidataOrderBuilder
Set the referee for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
referee |
Referee
|
The referee to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
media #
media(
asset: (
list[MediaAsset]
| list[TextAsset]
| list[MultiAsset]
),
metadata: Sequence[Metadata] | None = None,
) -> RapidataOrderBuilder
Set the media assets for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
media_paths |
list[MediaAsset] | list[TextAsset] | list[MultiAsset]
|
The paths of the media assets to be set. |
required |
metadata |
list[Metadata] | None
|
Metadata for the media assets. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
feature_flags #
feature_flags(
feature_flags: FeatureFlags,
) -> RapidataOrderBuilder
Set the feature flags for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_flags |
FeatureFlags
|
The feature flags to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
filters #
filters(filters: Sequence[Filter]) -> RapidataOrderBuilder
Set the filters for the order, e.g., country, language, userscore, etc.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filters |
Sequence[Filters]
|
The user filters to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
country_filter #
country_filter(
country_codes: list[str],
) -> RapidataOrderBuilder
Set the target country codes for the order. E.g. country_codes=["DE", "CH", "AT"]
for Germany, Switzerland, and Austria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
country_codes |
list[str]
|
The country codes to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
language_filter #
language_filter(
language_codes: list[str],
) -> RapidataOrderBuilder
Set the target language codes for the order. E.g. language_codes=["de", "fr", "it"]
for German, French, and Italian.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
language_codes |
list[str]
|
The language codes to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
aggregator #
aggregator(
aggregator: AggregatorType,
) -> RapidataOrderBuilder
Set the aggregator for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aggregator |
AggregatorType
|
The aggregator to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
validation_set_id #
validation_set_id(
validation_set_id: str,
) -> RapidataOrderBuilder
Set the validation set ID for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validation_set_id |
str
|
The validation set ID to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
rapids_per_bag #
rapids_per_bag(amount: int) -> RapidataOrderBuilder
Define the number of tasks a user sees in a single session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
int
|
The number of tasks a user sees in a single session. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method is not implemented yet. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
selections #
selections(
selections: Sequence[Selection],
) -> RapidataOrderBuilder
Set the selections for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selections |
Sequence[Selection]
|
The selections to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |
Source code in src/rapidata/rapidata_client/order/rapidata_order_builder.py
priority #
priority(priority: int) -> RapidataOrderBuilder
Set the priority for the order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
priority |
int
|
The priority to be set. |
required |
Returns:
Name | Type | Description |
---|---|---|
RapidataOrderBuilder |
RapidataOrderBuilder
|
The updated RapidataOrderBuilder instance. |