message#

class besser.bot.core.message.Message(t, content, is_user, timestamp)[source]#

Bases: object

A conversation message. It is used by the streamlit UI to display the messages properly, depending on the sender (i.e., user or chatbot) and the type (string, audio, file, DataFrame, plot, etc.)

Parameters:
  • t (MessageType) – The type of the message

  • content (Any) – The message content

  • is_user (bool) – Whether the message comes from the user (true) or the chatbot (false)

  • timestamp (datetime) – The timestamp of the message (when the message was sent)

type#

The type of the message

Type:

MessageType

content#

The message content

Type:

Any

is_user#

Whether the message comes from the user (true) or the chatbot (false)

Type:

bool

timestamp#

The timestamp of the message (when the message was sent)

Type:

datetime

class besser.bot.core.message.MessageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Enumeration of the different message types in Message.

AUDIO = 'audio'#
DATAFRAME = 'dataframe'#
FILE = 'file'#
IMAGE = 'image'#
LOCATION = 'location'#
OPTIONS = 'options'#
PLOTLY = 'plotly'#
RAG_ANSWER = 'rag_answer'#
STR = 'str'#
besser.bot.core.message.get_message_type(value)[source]#