PrivateAssistant¶
An AI assistant that privately helps one or more speakers in a Conversation. See ConvoKit AI.
The PrivateAssistant class: an AI assistant that privately supports speakers in a Conversation.
-
class
convokit.model.privateAssistant.PrivateAssistant(id: str, config: Optional[Dict] = None, supports: Optional[Iterable] = None, speakers: Optional[Iterable[str]] = None, conversation_id: Optional[str] = None)¶ Represents an AI private assistant that sends Supports to one or more speakers in a Conversation.
Private assistants are not speakers in the Conversation: their messages (Supports) are seen only by the speakers they assist.
- Parameters
id – the unique id of the assistant
config – configuration of the assistant, e.g.
{"prompt": "...", "model": "gemini-2.5-flash", "temperature": 0.7}.config["prompt"]is the prompt that generates a support message from this assistant (required bygenerate(); seeconvokit.model.aiGenerationfor the other keys).supports – the Supports (or their dict forms) produced by this assistant
speakers – ids of the Speakers that can see this assistant’s Supports
conversation_id – id of the Conversation the assistant belongs to
- Variables
id – the unique id of the assistant
config – configuration of the assistant
supports – list of the Supports produced by this assistant
speakers – ids of the Speakers that can see this assistant’s Supports
conversation_id – id of the Conversation the assistant belongs to
-
classmethod
from_dict(data: Dict) → Optional[convokit.model.privateAssistant.PrivateAssistant]¶ Build a PrivateAssistant from its dict form (as produced by
to_dict()).- Parameters
data – the dict form of the assistant
- Returns
the PrivateAssistant, or None if
datais not a dict
-
generate(conversation=None, reply_to: Optional[str] = None, draft: str = '', append: bool = False, client=None, config_manager=None, id: Optional[str] = None, timestamp: Optional[int] = None) → convokit.model.support.Support¶ Generate a Support from this assistant with
convokit.genai, using the prompt inconfig["prompt"](seeconvokit.model.aiGenerationfor the recognized config keys).Example:
assistant = conversation.get_private_assistant("assistant_1") support = assistant.generate(conversation, draft="I think", append=True)
- Parameters
conversation – if given, the conversation transcript (with Supports) up to
reply_tois included in the prompt, along with earlier Supports replying toreply_toreply_to – id of the utterance the assisted speaker is replying to (defaults to the last utterance of
conversation)draft – the draft the assisted speaker has written so far
append – whether to add the generated support to this assistant and
conversationclient – a
convokit.genaiLLMClient to use instead of building one from the configconfig_manager – GenAIConfigManager used to build the client (defaults to one reading
~/.convokit/config.yml)id – id of the generated support (random if not given)
timestamp – timestamp of the generated support (defaults to after the conversation’s last message)
- Returns
the generated Support
- Raises
ValueError – if
confighas no"prompt", or ifappendis True and noconversationis given
-
static
normalize_list(value) → List[convokit.model.privateAssistant.PrivateAssistant]¶ Convert a list (or dict of id -> value) of PrivateAssistants and/or dicts into a list of PrivateAssistants. Entries that are neither are dropped.
- Parameters
value – a list or dict of PrivateAssistants and/or their dict forms (or None)
- Returns
a list of PrivateAssistants
-
to_dict() → Dict¶ Convert this assistant (including its Supports) into a JSON-serializable dict.
- Returns
dict with keys
"id","config","supports","speakers", and"conversation_id"