Skip to main content
Component: OutputHandler, AgentConsole, SilentConsole, SSEOutputHandler Module: gaia.agents.base.console, gaia.api.sse_handler Import: from gaia.agents.base.console import OutputHandler, AgentConsole, SilentConsole

Overview

The console output system provides a unified interface for handling agent output across different contexts (CLI, testing, API). It implements a modular design where agents report progress through an abstract OutputHandler interface, and different implementations handle the output appropriately for their context. Key Features:
  • Abstract interface for agent output
  • Rich terminal formatting (when available)
  • Silent mode for testing
  • Server-Sent Events (SSE) for API streaming
  • Progress indicators and file preview
  • Consistent output format across all agents

Architecture

Design Philosophy:
  • Agents call output methods without knowing the implementation
  • Output handlers decide HOW to display information
  • Enables testing without modifying agent code
  • Supports real-time streaming to API clients

API Specification

OutputHandler (Abstract Base Class)

AgentConsole

SilentConsole

SSEOutputHandler


Usage Examples

Example 1: CLI Agent with Rich Output

Example 2: Testing with Silent Console

Example 3: API Streaming with SSE


Testing Requirements

Unit Tests

File: tests/agents/test_console.py

Dependencies

Required Packages

Import Dependencies


Integration Points

Agent Base Class

API Server Integration


Console Output Handlers Technical Specification