AgentLabs - Docs
  • Introduction
    • What is AgentLabs?
    • Get Started with AgentLabs
    • Pricing
  • Getting Started
    • Installation
    • Secret Key
    • Using the SDK
  • Core Concepts
    • Frontend as a service
    • User Authentication
    • Project
    • Agents
    • Messages
      • Messages Format
      • One-off vs Stream
      • Typewriter animation
    • Attachments
  • Recipes
    • Before we start
    • Ping-Pong
    • ChatGPT with LangChain
    • Code Interpreter
    • Mutli-Agent with AutoGen
  • 🧙Community
    • Github
    • Discord
    • Support team
Powered by GitBook
On this page
  • Plain text
  • Markdown
  1. Core Concepts
  2. Messages

Messages Format

About markdown and PlainText

PreviousMessagesNextOne-off vs Stream

Last updated 1 year ago

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',
});
agent.send({
    conversationId: '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.

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,
)
agent.send({
    conversationId: 'your-conversation-id',
    text: 'Your plain text value',
    format: 'Markdown'
});

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

You can see a

or to display a link
full markdown cheatsheet here.
Plain text response example
Example of a message containing markdown