Turn
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| CodexBaseModel codexed.models.base Base model for all Codex API models. |
⋔ Inheritance diagram¶
graph TD
1940435775["misc.Turn"]
3116041069["base.CodexBaseModel"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
3116041069 --> 1940435775
3879467795 --> 3116041069
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: CodexBaseModel
Turn data structure.
Source code in src/codexed/models/misc.py
completed_at
class-attribute
instance-attribute
¶
Unix timestamp (in seconds) when the turn completed.
duration_ms
class-attribute
instance-attribute
¶
Duration between turn start and completion in milliseconds, if known.
error
class-attribute
instance-attribute
¶
error: TurnError | None = None
Only populated when the Turn's status is failed.
final_response
property
¶
Extract the final assistant response text from this turn.
Looks for the last ThreadItemAgentMessage with phase="final_answer".
Falls back to the last agent message with no phase (for models that don't
emit phase metadata). Returns None if the turn has no agent messages.
For structured output turns, this returns the raw JSON string.
items
instance-attribute
¶
Only populated on a thread/resume or thread/fork response.
For all other responses and notifications returning a Turn, the items field will be an empty list.
items_view
class-attribute
instance-attribute
¶
How completely the turn's items are included in this payload.
started_at
class-attribute
instance-attribute
¶
Unix timestamp (in seconds) when the turn started.