Support

A message from a PrivateAssistant to the speaker(s) it helps. See ConvoKit AI.

The Support class: a private message from a PrivateAssistant to the speakers it assists.

class convokit.model.support.Support(id: str, text: str, reply_to: Optional[str] = None, draft: str = '', private_assistant_id: Optional[str] = None, timestamp: Union[str, int, None] = None)

Represents a single message from a PrivateAssistant to the speaker(s) it assists, outside the main Conversation.

The speakers that can see a Support are given by its PrivateAssistant’s speakers.

Parameters
  • id – the unique id of the support

  • text – the text of the support message

  • reply_to – id of the utterance the assisted speaker is replying to

  • draft – the draft of the reply the assisted speaker has written so far ("" means the draft is empty)

  • private_assistant_id – id of the PrivateAssistant that produced the support

  • timestamp – the time the support was sent (an int, or a string)

Variables
  • id – the unique id of the support

  • text – the text of the support message

  • reply_to – id of the utterance the assisted speaker is replying to

  • draft – the assisted speaker’s draft at the time of the support

  • private_assistant_id – id of the PrivateAssistant that produced the support

  • timestamp – the time the support was sent

classmethod from_dict(data: Dict) → Optional[convokit.model.support.Support]

Build a Support from its dict form (as produced by to_dict()). Keys outside the Support fields are ignored.

Parameters

data – the dict form of the support

Returns

the Support, or None if data is not a dict

get_transcript(conversation, supports: bool = False) → str

Get a plain-text transcript of the given Conversation, from its beginning up to and including this support. See Conversation.get_transcript.

Parameters
  • conversation – the Conversation this support belongs to (Supports don’t keep a reference to it)

  • supports – whether to include the other Supports before this one (this support is always shown)

Returns

the transcript as a single string

Raises

ValueError – if this support is not in conversation

static normalize_list(value: Optional[Iterable]) → List[convokit.model.support.Support]

Convert a list of Supports and/or dicts into a list of Supports. Entries that are neither are dropped.

Parameters

value – an iterable of Supports and/or their dict forms (or None)

Returns

a list of Supports

to_dict() → Dict

Convert this support into a JSON-serializable dict.

Returns

dict with keys "id", "text", "reply_to", "draft", "private_assistant_id", and "timestamp"