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

# stage • AI Agent SDK

> stage: Open a tracing scope for pipeline stage ``name``.

# stage

Method

> This is a method of the [**GatewayTraceHook**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/GatewayTraceHook.md) class in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Open a tracing scope for pipeline stage `name`.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def stage(name: str) -> 'AbstractContextManager[Any]'
```

## Parameters

**name** `str` *required*

The stage name (see :data:`GATEWAY_TRACE_STAGES`), used as the span name.

### Returns

**Returns** `'AbstractContextManager[Any]'`

A context manager delimiting the span's lifetime.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L6778)
>
> `praisonaiagents/gateway/protocols.py` at line 6778


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.