> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# display • Rust AI Agent SDK

> Display and callback system for PraisonAI

# display

<Badge color="orange">Rust AI Agent SDK</Badge>

Display and callback system for PraisonAI

This module provides display functions and callback registration matching the Python SDK's
main.py display system.

# Features

* Display functions for various output types (interaction, tool calls, errors, etc.)
* Callback registration for custom display handling
* Approval callback for dangerous operations
* Color palette for consistent UI

# Example

```rust,ignore theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::display::{register_display_callback, display_interaction, DisplayType};

// Register a custom callback
register_display_callback(DisplayType::Interaction, |event| {
println!("Agent: {} said: {}", event.agent_name, event.content);
});

// Display an interaction
display_interaction("assistant", "Hello!", None);
```

## Import

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::display::*;
```

## Classes

<CardGroup cols={2}>
  <Card title="ColorPalette" icon="brackets-curly" href="../classes/ColorPalette">
    PraisonAI color palette for consistent UI
  </Card>

  <Card title="DisplayEvent" icon="brackets-curly" href="../classes/DisplayEvent">
    Event data passed to display callbacks
  </Card>

  <Card title="DisplayType" icon="brackets-curly" href="../classes/DisplayType">
    Types of display events
  </Card>

  <Card title="ApprovalDecision" icon="brackets-curly" href="../classes/ApprovalDecision">
    Approval decision for dangerous operations
  </Card>

  <Card title="RiskLevel" icon="brackets-curly" href="../classes/RiskLevel">
    Risk level for operations requiring approval
  </Card>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="clear_display_callbacks()" icon="function" href="../functions/clear_display_callbacks">
    Clear all callbacks for a display type
  </Card>

  <Card title="clear_all_callbacks()" icon="function" href="../functions/clear_all_callbacks">
    Clear all callbacks
  </Card>

  <Card title="execute_sync_callbacks()" icon="function" href="../functions/execute_sync_callbacks">
    Execute synchronous callbacks for a display event
  </Card>

  <Card title="execute_async_callbacks()" icon="function" href="../functions/execute_async_callbacks">
    Execute asynchronous callbacks for a display event
  </Card>

  <Card title="execute_callbacks()" icon="function" href="../functions/execute_callbacks">
    Execute all callbacks (sync and async) for a display event
  </Card>

  <Card title="request_approval()" icon="function" href="../functions/request_approval">
    Request approval for a dangerous operation
  </Card>

  <Card title="display_interaction()" icon="function" href="../functions/display_interaction">
    Display an agent interaction
  </Card>

  <Card title="display_instruction()" icon="function" href="../functions/display_instruction">
    Display an instruction
  </Card>

  <Card title="display_tool_call()" icon="function" href="../functions/display_tool_call">
    Display a tool call
  </Card>

  <Card title="display_error()" icon="function" href="../functions/display_error">
    Display an error
  </Card>

  <Card title="display_generating()" icon="function" href="../functions/display_generating">
    Display generating/working status
  </Card>

  <Card title="display_reasoning_steps()" icon="function" href="../functions/display_reasoning_steps">
    Display reasoning steps
  </Card>

  <Card title="display_working_status()" icon="function" href="../functions/display_working_status">
    Display working status with animation frame
  </Card>

  <Card title="display_self_reflection()" icon="function" href="../functions/display_self_reflection">
    Display self-reflection output
  </Card>

  <Card title="clean_display_content()" icon="function" href="../functions/clean_display_content">
    Clean content for display (truncate if too long)
  </Card>

  <Card title="has_callbacks()" icon="function" href="../functions/has_callbacks">
    Check if callbacks are registered for a display type
  </Card>

  <Card title="callback_count()" icon="function" href="../functions/callback_count">
    Get the number of registered callbacks for a display type
  </Card>
</CardGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Display" icon="display" href="/docs/rust/display" />

  <Card title="Rust Output" icon="file-export" href="/docs/rust/output" />
</CardGroup>
