TriggerPluginV1

toloka.client.project.template_builder.plugins.TriggerPluginV1 | Source code

TriggerPluginV1(
self,
*,
action: Optional[BaseComponent] = None,
condition: Optional[BaseComponent] = None,
fire_immediately: Optional[Union[BaseComponent, bool]] = None,
on_change_of: Optional[BaseComponent] = None,
version: Optional[str] = '1.0.0'
)

A plugin for triggering actions when events occur.

For more information, see plugin.trigger.

Parameters description

ParametersTypeDescription
actionOptional[BaseComponent]

An action to trigger.

conditionOptional[BaseComponent]

A condition that must be met in order to trigger the action.

fire_immediatelyOptional[Union[BaseComponent, bool]]

If True then the action is triggered immediately after the task is loaded.

on_change_ofOptional[BaseComponent]

The data change event that triggers the action.

Examples:

How to save Toloker's coordinates.

import toloka.client.project.template_builder as tb
coordinates_save_plugin = tb.plugins.TriggerPluginV1(
fire_immediately=True,
action=tb.actions.SetActionV1(
data=tb.data.OutputData(path='toloker_coordinates'),
payload=tb.data.LocationData()
),
)

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