Run Turn • AI Agent SDK

run_turn: Execute a single turn using the prepared context.

run_turn

Async

Method

</div>

This is a method of the TurnRuntimeProtocol class in the protocols module.

Execute a single turn using the prepared context.

This is the main execution entry point for all runtime types. The context is immutable and contains all necessary configuration for the turn execution.

Signature

python
async def run_turn(context: PreparedTurnContext) -> str

Parameters

ParamField PreparedTurnContext

The prepared turn context containing model, tools, transcript, delivery channels, and correlation IDs

Returns

ResponseField str

The agent’s response as a string

Exceptions

RuntimeError

If execution fails

ValueError

If context is invalid or incompatible

Source

View on GitHub

praisonaiagents/runtime/protocols.py at line 54