Messages Format

About markdown and PlainText

Plain text

By default when you send a message using the SDK, the UI shows it in plain text.

Plain text messages are great for chatting or sending messages that don't contain formatting to the user.

Sending plain text is the default behavior of the SDK, so you just have to run the following code:

agent.send({
    conversation_id: 'your-conversation-id',
    text: 'Your plain text value',
});

Markdown

Often, you may want your agent to return more than just a simple text. In that situation, you most likely want to use the markdown format.

Markdown is great for applying some styling, or to display a link, generating a table, displaying code snippet , images, and more.

You can see a full markdown cheatsheet here.

Send indicate the interpreter you are sending text in Markdown, you just have to use the MARKDOWN format option.

from agentlabs.chat importMessageFormat

agent.send(
  text="**My Text**",
  format=MessageFormat.MARKDOWN,
  conversation_id=self.conversation_id,
)

Last updated