create_task_suites

toloka.client.TolokaClient.create_task_suites | Source code

Creates several task suites in Toloka.

Usually, you don't need to create task suites manually, because Toloka can group tasks into suites automatically.

Use this method if you need to group specific tasks together or to set different parameters in different task suites. You can create general and control tasks or task suites in different pools with a single method call.

If async_mode is True, create_task_suites starts asynchronous operation internally and waits for the completion of it.

If async_mode is False, no more than 5000 tasks can be created in a single request. Don't change async_mode to False, if you do not understand clearly why you need it.

You can send a maximum of 100,000 requests of this kind per minute and 2,000,000 requests per day. It is recommended that you create no more than 10,000 task suites in a single request if the async_mode parameter is True.

Parameters description

ParametersTypeDescription
task_suitesList[TaskSuite]

A list of task suites to be created.

operation_idOptional[UUID]

The UUID of the operation that conforms to the RFC4122 standard. The UUID is used if async_mode is True.

Specify UUID to avoid accidental errors like Toloka operation duplication caused by network problems. If you send several requests with the same operation_id, Toloka performs the operation only once.

async_modeOptional[bool]

Request processing mode:

  • True — Asynchronous operation is started internally.
  • False — The request is processed synchronously.

Default value: True.

allow_defaultsOptional[bool]

Active overlap setting:

  • True — Use the overlap that is set in the defaults.default_overlap_for_new_task_suites pool parameter.
  • False — Use the overlap that is set in the overlap task suite parameter.

Default value: False.

open_poolOptional[bool]

Open the pool immediately after creating a task suite, if the pool is closed.

skip_invalid_itemsOptional[bool]

Task suite validation option:

  • True — All valid task suites are added. If a task suite doesn't pass validation, then it is not added to Toloka.
  • False — If any task suite doesn't pass validation, then operation is cancelled and no task suites are added to Toloka.

Default value: False.

Examples:

task_suites = [
toloka.client.TaskSuite(
pool_id='1086170',
overlap=1,
tasks=[
toloka.client.Task(input_values={
'question': 'Choose a random number'
})
]
)
]
task_suites = toloka_client.create_task_suites(task_suites)

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