Task

toloka.client.task.Task | Source code

Task(
self,
*,
input_values: Optional[Dict[str, Any]] = None,
known_solutions: Optional[List[BaseTask.KnownSolution]] = None,
message_on_unknown_solution: Optional[str] = None,
id: Optional[str] = None,
infinite_overlap=None,
overlap=None,
pool_id: Optional[str] = None,
remaining_overlap: Optional[int] = None,
reserved_for: Optional[List[str]] = None,
unavailable_for: Optional[List[str]] = None,
traits_all_of: Optional[List[str]] = None,
traits_any_of: Optional[List[str]] = None,
traits_none_of_any: Optional[List[str]] = None,
origin_task_id: Optional[str] = None,
created: Optional[datetime] = None,
baseline_solutions: Optional[List[BaselineSolution]] = None
)

A task that is assigned to Tolokers.

Tasks are grouped into TaskSuites.

Parameters description

ParametersTypeDescription
input_valuesOptional[Dict[str, Any]]

A dictionary with input data for a task. Input field names are keys in the dictionary.

known_solutionsOptional[List[BaseTask.KnownSolution]]

A list of all responses considered correct. It is used with control and training tasks. If there are several output fields, then you must specify all their correct combinations.

message_on_unknown_solutionOptional[str]

A hint used in training tasks.

idOptional[str]

The ID of a task.

pool_idOptional[str]

The ID of the pool that the task belongs to.

remaining_overlapOptional[int]

The number of times left for this task to be assigned to Tolokers. Read-only field.

reserved_forOptional[List[str]]

IDs of Tolokers who have access to the task.

unavailable_forOptional[List[str]]

IDs of Tolokers who don't have access to the task.

traits_all_ofOptional[List[str]]

The task can be assigned to Tolokers who have all of the specified traits.

traits_any_ofOptional[List[str]]

The task can be assigned to Tolokers who have any of the specified traits.

traits_none_of_anyOptional[List[str]]

The task can not be assigned to Tolokers who have any of the specified traits.

origin_task_idOptional[str]

The ID of a parent task. This parameter is set if the task was created by copying.

createdOptional[datetime]

The UTC date and time when the task was created.

baseline_solutionsOptional[List[BaselineSolution]]

Preliminary responses for dynamic overlap and aggregation of results by skill. They are used to calculate a confidence level of the first responses from Toloker.

Examples:

Creating a simple task with one input field.

task = toloka.client.Task(
input_values={'image': 'https://some.url/img0.png'},
pool_id='1086170'
)

See more complex example in the description of the create_tasks method.

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