Toloka documentation

compose_message_thread

toloka.client.TolokaClient.compose_message_thread

Sends message to performer

The sent message is added to a new message thread.

Parameters Description

Parameters Type Description
recipients_select_type Union[RecipientsSelectType, str, None]

Method for specifying recipients

topic Optional[Dict[str, str]]

Post title. You can provide a title in several languages (the message will come in the user's language). Format: "<language RU/EN/TR/ID/FR>": "<topic text>".

text Optional[Dict[str, str]]

Message text. You can provide text in several languages (the message will come in the user's language). Format: "<language RU/EN/TR/ID/FR>": "<message text>".

answerable Optional[bool]

Ability to reply to a message:

  • True — Users can respond to the message.
  • False — Users can't respond to the message.

recipients_ids Optional[List[str]]

List of IDs of users to whom the message will be sent.

recipients_filter Optional[FilterCondition]

Filter to select recipients.

Examples:

If you want to thank Toloka performers who have tried to complete your tasks, send them a nice 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, performer!'},
    text={'EN': message_text},
    answerable=False
)