AllConditionV1

toloka.client.project.template_builder.conditions.AllConditionV1 | Source code

AllConditionV1(
self,
conditions: Optional[Union[BaseComponent, List[BaseComponent]]] = None,
*,
hint: Optional[Any] = None,
version: Optional[str] = '1.0.0'
)

Checks that all nested conditions are met.

For more information, see condition.all.

Parameters description

ParametersTypeDescription
conditionsOptional[Union[BaseComponent, List[BaseComponent]]]

A list of conditions.

hintOptional[Any]

A hint that is shown if the condition is not met.

Examples:

import toloka.client.project.template_builder as tb
coordinates_validation = tb.conditions.AllConditionV1(
[
tb.conditions.RequiredConditionV1(
tb.data.OutputData('performer_coordinates'),
hint="Couldn't get your coordinates. Please enable geolocation.",
),
tb.conditions.DistanceConditionV1(
tb.data.LocationData(),
tb.data.InputData('coordinates'),
500,
hint='You are too far from the destination coordinates.',
),
],
)

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming