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

# Turn Runtime Protocol • AI Agent SDK

> TurnRuntimeProtocol: Protocol for turn-based runtime execution.

# TurnRuntimeProtocol

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

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

Protocol for turn-based runtime execution.

This protocol defines the interface that runtimes must implement to
execute prepared turn contexts. It standardizes the execution contract
across different runtime types (native, plugin, managed, etc.).

## Methods

<CardGroup cols={2}>
  <Card title="run_turn()" icon="function" href="../functions/TurnRuntimeProtocol-run_turn">
    Execute a single turn using the prepared context.
  </Card>

  <Card title="supports_runtime_mode()" icon="function" href="../functions/TurnRuntimeProtocol-supports_runtime_mode">
    Check if this runtime supports the given execution mode.
  </Card>

  <Card title="get_supported_modes()" icon="function" href="../functions/TurnRuntimeProtocol-get_supported_modes">
    Get all runtime modes supported by this implementation.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class MyRuntime:
        async def run_turn(self, context: PreparedTurnContext) -> str:
            # Execute the turn using the prepared context
            return "response"
    
    # Use with prepared context
    context = PreparedTurnContext(...)
    runtime = MyRuntime()
    result = await runtime.run_turn(context)
```

## Source

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