DistanceConditionV1

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

DistanceConditionV1(
self,
from_: Optional[Union[BaseComponent, str]] = None,
to_: Optional[Union[BaseComponent, str]] = None,
max: Optional[Union[BaseComponent, float]] = None,
*,
hint: Optional[Any] = None,
version: Optional[str] = '1.0.0'
)

This component checks whether the sent coordinates match the ones that you specified

For example, you want a Toloker to take a photo of a specific place. The condition.distance component checks whether the photo was taken at the location that you specified.

Parameters Description

ParametersTypeDescription
from_Optional[Union[BaseComponent, str]]

First point.

to_Optional[Union[BaseComponent, str]]

Second point.

maxOptional[Union[BaseComponent, float]]

The distance in meters by which the X and Y coordinates may differ.

hintOptional[Any]

Validation error message that a Toloker will see.

Examples:

How to check that a Toloker is in the right place.

distance_condition = tb.conditions.DistanceConditionV1(
tb.data.LocationData(),
tb.data.InputData('coordinates'),
500,
hint='You are too far from the destination coordinates.',
),
Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming