pub struct Turn {Show 13 fields
pub id: String,
pub parent_id: Option<String>,
pub role: Role,
pub timestamp: String,
pub text: String,
pub thinking: Option<String>,
pub tool_uses: Vec<ToolInvocation>,
pub model: Option<String>,
pub stop_reason: Option<String>,
pub token_usage: Option<TokenUsage>,
pub environment: Option<EnvironmentSnapshot>,
pub delegations: Vec<DelegatedWork>,
pub file_mutations: Vec<FileMutation>,
}Expand description
A single turn in a conversation, from any provider.
Fields§
§id: StringUnique identifier within the conversation.
parent_id: Option<String>Parent turn ID (for branching conversations).
role: RoleWho produced this turn.
timestamp: StringWhen this turn occurred (ISO 8601).
text: StringThe visible text content (already collapsed from provider-specific formats).
thinking: Option<String>Internal reasoning (chain-of-thought, thinking blocks).
tool_uses: Vec<ToolInvocation>Tool invocations in this turn.
model: Option<String>Model identifier (e.g. “claude-opus-4-6”, “gpt-4o”).
stop_reason: Option<String>Why the turn ended (e.g. “end_turn”, “tool_use”, “max_tokens”).
token_usage: Option<TokenUsage>Token usage for this turn.
environment: Option<EnvironmentSnapshot>Environment at time of this turn.
delegations: Vec<DelegatedWork>Sub-agent work delegated from this turn.
file_mutations: Vec<FileMutation>File mutations produced by this turn, with diffs pre-resolved by
the provider’s to_view. Each entry projects to a sibling
file.write artifact change in the derived step. When the
mutation is attributable to a specific tool call, tool_id on
the entry links back to that ToolInvocation::id.