ai.ModelTurn
One attempt at a turn. A client returns one that succeeded; a wrapper's `child_turns` also hold the attempts that failed (`error` set, no content, `stop_reason` Failed).
Reference version
Signature
class ai.ModelTurnOne attempt at a turn. A client returns one that succeeded; a wrapper's
child_turns also hold the attempts that failed (error set, no content,
stop_reason Failed).
Source:<builtin>/ai/turn.bamlbytes 984–3046
Fields
parsed_output
ai.ParsedOutput | nullcontent
stop_reason
resolved_model
ai.events.ModelKey | nullrequested_model
string | nullcalls
child_turns
ai.ModelTurn[]error
ai.errors.Failure | baml.errors.Timeout | nullInstance methods
Every call behind this turn: its own, then each child's, oldest first.
The media payloads the turn produced, in order. A media-shaped output type is built from these instead of from the terminal text.
function
terminal_text
(self) -> string | null throws neverThe terminal Text block — the final candidate the runner parses.
The ToolUse blocks of the turn, in order.