> ## 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.

# List Sink • AI Agent SDK

> ListSink: Sink that collects events in a list.

# ListSink

> Defined in the [**protocol**](../modules/protocol) module.

<Badge color="blue">AI Agent</Badge>

Sink that collects events in a list.

Useful for testing and programmatic access to trace events.

## Methods

<CardGroup cols={2}>
  <Card title="emit()" icon="function" href="../functions/ListSink-emit">
    Add event to the list.
  </Card>

  <Card title="flush()" icon="function" href="../functions/ListSink-flush">
    No-op for list sink.
  </Card>

  <Card title="close()" icon="function" href="../functions/ListSink-close">
    No-op for list sink.
  </Card>

  <Card title="get_events()" icon="function" href="../functions/ListSink-get_events">
    Get all collected events.
  </Card>

  <Card title="clear()" icon="function" href="../functions/ListSink-clear">
    Clear all collected events.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/trace/protocol.py#L139">
  `praisonaiagents/trace/protocol.py` at line 139
</Card>
