TemplateBuilderViewSpec

toloka.client.project.view_spec.TemplateBuilderViewSpec | Source code

TemplateBuilderViewSpec(
self,
*,
settings: Optional[ViewSpec.Settings] = None,
view: Optional[BaseComponent] = None,
plugins: Optional[List[BaseComponent]] = None,
vars: Optional[Dict[str, Any]] = None,
core_version: Optional[str] = '1.0.0',
infer_data_spec: Optional[bool] = False
)

A task interface defined with the TemplateBuilder.

See also Template Builder in the guide.

Parameters description

ParametersTypeDescription
view-

A top level component like SideBySideLayoutV1.

plugins-

An array of plugins.

vars-

Reusable data. It is referenced with the RefComponent.

core_versionOptional[str]

The default template components version. Most likely, you do not need to change this parameter.

infer_data_specOptional[bool]
  • True – The specifications of input and output data are generated automatically depending on the task interface settings.
  • False – You configure the specifications manually, if:
    • You don't want the specification to be affected by changes in instructions or other project parameters.
    • You have to change automatically generated specifications to suite your needs.

Examples:

Creating a simple interface based on ListViewV1:

import toloka.client.project.template_builder as tb
project_interface = toloka.client.project.view_spec.TemplateBuilderViewSpec(
view=tb.view.ListViewV1(
items=[header, output_field, radiobuttons],
validation=some_validation,
),
plugins=[plugin1, plugin2]
)
# add 'project_interface' to 'toloka.project.Project' instance

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