message#

class besser.agent.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 agent) 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 agent (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 agent (false)

Type:

bool

timestamp#

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

Type:

datetime

class besser.agent.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'#
HTML = 'html'#
IMAGE = 'image'#
JSON = 'json'#
LOCATION = 'location'#
MARKDOWN = 'markdown'#
OPTIONS = 'options'#
PLOTLY = 'plotly'#
RAG_ANSWER = 'rag_answer'#
STR = 'str'#
besser.agent.core.message.get_message_type(value)[source]#