Skip to main content

Chat Messages

Messages are exchanged with Aurora’s AI agent through WebSocket connections for real-time streaming responses. Use HTTP endpoints for session management and WebSocket for live chat interactions.

Message Structure

Messages in Aurora follow a consistent structure for both user and assistant messages.

User Messages

string
default:"user"
Always “user” for messages from the user
string
required
Message text content. Can include:
  • Natural language instructions
  • Questions about infrastructure
  • Commands for cloud operations
  • File attachment context (auto-appended)
array
Attached images for multimodal messages (supports image analysis)
Example User Message:

Assistant Messages

string
Always “assistant” for AI responses
string
Response text with markdown formatting
array
Array of tool invocations made by the agent
string
Name of the tool called (e.g., “gcp_compute”, “aws_ec2”)
object
Parameters passed to the tool
string
Tool execution result
Example Assistant Message:

Multimodal Messages

Aurora supports multimodal messages with images for visual analysis.

Sending Images

Images are sent as part of the message content in data URL format:
array
Array of file attachments
string
required
Original filename
string
required
MIME type (image/png, image/jpeg, application/pdf)
string
required
Base64-encoded file data (without data URL prefix for images)
boolean
default:false
Whether file_data is a server path reference
string
Server-side file path (for large files like ZIP archives)

Supported File Types

  • Images: PNG, JPEG, GIF, WebP (for visual analysis)
  • Documents: PDF (text extraction)
  • Archives: ZIP (server-side processing)

Image Processing

When messages with images are retrieved:
  1. Data URLs are parsed and split into components
  2. Images are extracted into images array
  3. Text content is separated from image data
  4. Each image includes:
    • displayData - Full data URL for rendering
    • type - MIME type
    • data - Base64-encoded image data
    • name - Generated filename
Example with Retrieved Images:

Message Context

Aurora maintains conversation context across messages:

Context Management

array
Complete conversation history sent to LLM
  • Includes all user and assistant messages
  • Contains tool call results
  • Used for context-aware responses
array
Simplified messages for UI display
  • User-facing message format
  • Excludes internal tool details
  • Shown in chat interface

Token Management

Messages are subject to token limits:
  • Input limit: 20,000 tokens per user message (~80,000 characters)
  • Context window: Managed automatically by Aurora
  • Token counting: Validated before processing
Error Example:

Message Streaming

Messages are streamed in real-time via WebSocket. See WebSocket Protocol for details on:
  • Sending chat messages
  • Receiving streamed responses
  • Handling tool call events
  • Managing session state

Auto-Generated Titles

Session titles are auto-generated from the first user message:
  1. Extracts first 50 characters of first user message
  2. Trims to last complete word
  3. Appends ”…” if truncated
  4. Defaults to “New Chat” if no user message exists
Example:

Best Practices

Message Composition

  • Be specific with cloud resource requirements
  • Include region/zone information when relevant
  • Provide context for multi-step operations
  • Reference previous messages naturally

Attachments

  • Optimize images before uploading (< 5MB recommended)
  • Use PNG for diagrams, JPEG for photos
  • Include descriptive filenames
  • Attach relevant context files

Error Handling

  • Check token count for large messages
  • Validate file formats before uploading
  • Handle WebSocket disconnections gracefully
  • Retry failed operations with exponential backoff

Message Lifecycle

  1. Compose - User creates message with text/attachments
  2. Validate - Token count and format validation
  3. Send - Transmitted via WebSocket
  4. Process - Aurora agent analyzes and executes
  5. Stream - Response streamed back in chunks
  6. Store - Messages persisted in session
  7. Display - Rendered in chat UI