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 | Type | Description |
---|---|---|
action | Optional[BaseComponent] | An action to trigger. |
condition | Optional[BaseComponent] | A condition that must be met in order to trigger the action. |
fire_immediately | Optional[Union[BaseComponent, bool]] | If |
on_change_of | Optional[BaseComponent] | The data change event that triggers the action. |
Examples:
How to save Toloker's coordinates.
import toloka.client.project.template_builder as tbcoordinates_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