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

# Streaming Tracker • AI Agents Framework

> StreamingTracker: Track streaming operations (LLM responses).

# StreamingTracker

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

<Badge color="purple">AI Agents Framework</Badge>

Track streaming operations (LLM responses).

## Constructor

<ParamField query="name" type="str" required={true}>
  No description available.
</ParamField>

## Methods

<CardGroup cols={2}>
  <Card title="start()" icon="function" href="../functions/StreamingTracker-start">
    Start tracking.
  </Card>

  <Card title="first_token()" icon="function" href="../functions/StreamingTracker-first_token">
    Mark time to first token.
  </Card>

  <Card title="chunk()" icon="function" href="../functions/StreamingTracker-chunk">
    Record a chunk received.
  </Card>

  <Card title="end()" icon="function" href="../functions/StreamingTracker-end">
    End tracking and record to Profiler.
  </Card>

  <Card title="ttft_ms()" icon="function" href="../functions/StreamingTracker-ttft_ms">
    Get time to first token in ms.
  </Card>

  <Card title="elapsed_ms()" icon="function" href="../functions/StreamingTracker-elapsed_ms">
    Get elapsed time in ms.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
tracker = StreamingTracker("chat")
    tracker.start()
    tracker.first_token()  # Mark TTFT
    for chunk in stream:
        tracker.chunk()
    tracker.end(total_tokens=100)
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L142">
  `praisonai/profiler.py` at line 142
</Card>
