SetActionV1

toloka.client.project.template_builder.actions.SetActionV1 | Source code

SetActionV1(
self,
data: Optional[Union[BaseComponent, RefComponent]] = None,
payload: Optional[Any] = None,
*,
version: Optional[str] = '1.0.0'
)

The action sets the value of a data field.

For more information, see action.set.

Parameters description

ParametersTypeDescription
dataOptional[Union[BaseComponent, RefComponent]]

The data field to set.

payloadOptional[Any]

The value.

Examples:

The hot key 1 fills a text field with a predefined text. The RefComponent is used to reference the output data field.

from toloka.client.project.template_builder import *
tb_config = TemplateBuilder(
vars={'0': OutputData('result')},
view=TextFieldV1(
data=RefComponent('vars.0'),
label=InputData('question'),
),
plugins=[
HotkeysPluginV1(
key_1=SetActionV1(
data=RefComponent('vars.0'),
payload='It is not a question'
)
)
]
)

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