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

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**GatewayTraceHook**](../classes/GatewayTraceHook) class in the [**protocols**](../modules/protocols) 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

<ParamField query="name" type="str" required={true}>
  The stage name (see :data:`GATEWAY_TRACE_STAGES`), used as the span name.
</ParamField>

### Returns

<ResponseField name="Returns" type="'AbstractContextManager[Any]'">
  A context manager delimiting the span's lifetime.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L4843">
  `praisonaiagents/gateway/protocols.py` at line 4843
</Card>
