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
async def run_turn(context: PreparedTurnContext) -> strParameters
ParamField
PreparedTurnContextThe prepared turn context containing model, tools, transcript, delivery channels, and correlation IDs
Returns
ResponseField
strThe agent’s response as a string
Exceptions
RuntimeError
If execution fails
ValueError
If context is invalid or incompatible
Source
View on GitHubpraisonaiagents/runtime/protocols.py at line 54