Change pool priority

Change the priority of the pool and offer it to Tolokers before other pools.

Steps to follow

1. Import Toloka-Kit

Connect the Toloka-Kit library to your script.

import toloka.client as toloka

2. Instantiate TolokaClient

Replace the sample API key with your own one.

toloka_client = toloka.
TolokaClient
('PlaceYourRealApiKey_Here', 'PRODUCTION');

3. Change pool priority

Find out the ID of the pool for which you want to change the priority. Then call the patch_pool() method.

patched_pool = toloka_client.
patch_pool
(pool_id='1443815', priority=0)

4. Print pool ID and priority

The patch_pool() request will return the Pool class object. You can use its attributes to print the information you need.

print(patched_pool.id, patched_pool.priority)

You should get an output with the pool ID and the updated priority which looks like this.

1443815 0

Complete code: Change pool priority

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
patched_pool = toloka_client.patch_pool(pool_id='1443815', priority=0)
print(patched_pool.id, patched_pool.priority)
List of classes and methods used in this recipe

See also

Last updated: February 7, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming