Message System Overview
Flo AI uses a flexible message system to handle communication between users, agents, and tools. Messages support text, images, documents, and structured content, making it easy to build rich conversational experiences.Message Types
Flo AI supports several message types, each serving a specific purpose in conversations:BaseMessage
The base class for all messages. All message types inherit fromBaseMessage.
UserMessage
Messages from the user to the agent. Supports text, images, and documents.AssistantMessage
Messages from the agent to the user. These are typically generated by the LLM.SystemMessage
System-level instructions for the agent. Used for system prompts.FunctionMessage
Messages representing function/tool call results. Used when agents call tools.Message Content Types
Messages can contain different types of content:Text Content
Simple string content (default):Image Content
Send images to agents for vision tasks:Document Content
Send documents (PDFs, text files, etc.) to agents:Using Messages with Agents
Basic Text Messages
Messages with Images
Messages with Documents
Mixed Content Messages
You can combine text, images, and documents in a single conversation:Message Metadata
All messages support optional metadata for additional context:Working with Message Responses
Accessing Response Messages
Agents return lists of messages representing the conversation history:Extracting Content
Message History
Agents maintain conversation history across multiple calls:Using Messages in Workflows
Messages work seamlessly in Arium workflows:Message Type Reference
MessageType Constants
Message Classes
| Class | Role | Content Types | Use Case |
|---|---|---|---|
UserMessage | user | str, ImageMessageContent, DocumentMessageContent, TextMessageContent | User inputs |
AssistantMessage | assistant | str | Agent responses |
SystemMessage | system | str | System prompts |
FunctionMessage | function | str | Tool/function results |
Content Classes
| Class | Type | Fields | Use Case |
|---|---|---|---|
TextMessageContent | text | text: str | Plain text content |
ImageMessageContent | image | url, base64, bytes, mime_type | Image content |
DocumentMessageContent | document | url, base64, bytes, mime_type | Document content |

