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

# Context List Sink • AI Agent SDK

> ContextListSink: Sink that collects events in a list.

# ContextListSink

> Defined in the [**Context Events**](../modules/context_events) module.

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

Sink that collects events in a list.

Useful for testing and programmatic access to context events.

## Methods

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

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

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

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

  <Card title="clear()" icon="function" href="../functions/ContextListSink-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/context_events.py#L311">
  `praisonaiagents/trace/context_events.py` at line 311
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Context Concept" icon="layer-group" href="/docs/docs/concepts/context" />

  <Card title="Context Management" icon="sliders" href="/docs/docs/features/context-management" />

  <Card title="Context Strategies" icon="diagram-project" href="/docs/docs/features/context-strategies" />
</CardGroup>
