compose_message_thread

toloka.client.TolokaClient.compose_message_thread | Source code

Creates a message thread and sends the first thread message to Tolokers.

Parameters description

ParametersTypeDescription
recipients_select_typeUnion[RecipientsSelectType, str, None]

The way of specifying message recipients.

topicOptional[Dict[str, str]]

The message thread title.

textOptional[Dict[str, str]]

The message text.

answerableOptional[bool]
  • True — Tolokers can respond to your messages.
  • False — Tolokers can't respond to your messages.
recipients_idsOptional[List[str]]

A list of Toloker IDs. It is filled if recipients_select_type is DIRECT.

recipients_filterOptional[FilterCondition]

A filter for selecting Tolokers. It is set if recipients_select_type is FILTER.

  • Returns:

    The created message thread.

  • Return type:

    MessageThread

Examples:

A message is sent to all Tolokers who have tried to complete your tasks. The message is in English. Tolokers can't reply to your message.

message_text = "Amazing job! We've just trained our first model with the data you prepared for us. Thank you!"
toloka_client.compose_message_thread(
recipients_select_type='ALL',
topic={'EN': 'Thank you!'},
text={'EN': message_text},
answerable=False
)

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