Core entities
Core entities listed here are used in backend-storage and backend-frontend communication. For simplicity reasons, they are all designed to be simple frozen dataclasses. If you are implementing your own Suppgram frontend, you may need to extend these classes with new fields.
Customers
suppgram.entities.Customer
dataclass
Describes a particular customer who is interacting with the support system.
Contains the data necessary to identify the external system customer communicates through (e. g. Telegram bot, Instagram business account, PubNub chat, etc.), the data necessary to identify the customer and send them messages within that system, and all available metadata (e.g. first name, last name) that can be useful.
Attributes: |
|
---|
suppgram.entities.CustomerIdentification
dataclass
Subset of Customer fields allowing to uniquely identify the customer.
suppgram.entities.CustomerDiff
dataclass
Agents
suppgram.entities.Agent
dataclass
Describes support agent who is able to communicate with customers via the support system or manage other agents.
Attributes: |
|
---|
suppgram.entities.AgentIdentification
dataclass
Subset of Agent fields allowing to uniquely identify the agent.
suppgram.entities.AgentDiff
dataclass
Workplaces
suppgram.entities.Workplace
dataclass
Describes support agent's workplace.
Workplace is an abstraction over a way agent conveys their messages. Examples of a workplace include:
- private Telegram chat with one of the agent bots, identified by user ID and bot ID;
- PubNub chat, identified by chat ID;
- web interface session, identified by active websocket identifier.
Attributes: |
---|
suppgram.entities.WorkplaceIdentification
dataclass
Subset of Workplace fields allowing to uniquely identify the workplace.
Conversations
suppgram.entities.Conversation
dataclass
Describes a particular conversation between customer and support agent(s).
When a customer sends a message into the support system, a new conversation is created. It can then be assigned to an agent and resolved by them. If the customer sends a message again, previously resolved conversations are ignored and a new one is spawned.
Attributes: |
|
---|
suppgram.entities.ConversationDiff
dataclass
Describes an update to a Conversation object.
Attributes: |
|
---|
suppgram.entities.ConversationState
Bases: str
, Enum
Enumeration describing current state of a conversation.
Attributes: |
|
---|
suppgram.entities.Message
dataclass
Describes message within a conversation.
May be a message from customer, agent, or an internal message corresponding
to an event (e.g. conversation resolution) depending on kind
.
Attributes: |
|
---|
suppgram.entities.MessageKind
Bases: str
, Enum
Enumeration describing message kind.
FROM_CUSTOMER = 'from_customer'
class-attribute
instance-attribute
Regular message from a customer.
FROM_AGENT = 'from_agent'
class-attribute
instance-attribute
Regular message from a currently assigned agent.
POSTPONED = 'postponed'
class-attribute
instance-attribute
Internal message marking the moment the conversation was postponed by the agent.
RESOLVED = 'resolved'
class-attribute
instance-attribute
Internal message marking the moment the conversation was resolved by the agent.