Full execution trace across all agent turns.
| 45 | |
| 46 | @dataclass |
| 47 | class Trajectory: |
| 48 | """Full execution trace across all agent turns.""" |
| 49 | |
| 50 | turns: list[TurnRecord] = field(default_factory=list) |
| 51 | started_at: str | None = None |
| 52 | """ISO-8601 UTC timestamp of when ``run()`` began, for replay |
| 53 | alignment with the corresponding trace. Populated by the runner.""" |
| 54 | |
| 55 | @property |
| 56 | def total_input_tokens(self) -> int: |
| 57 | return sum(t.input_tokens for t in self.turns) |
| 58 | |
| 59 | @property |
| 60 | def total_output_tokens(self) -> int: |
| 61 | return sum(t.output_tokens for t in self.turns) |
| 62 | |
| 63 | @property |
| 64 | def all_tool_calls(self) -> list[ToolCall]: |
| 65 | return [tc for turn in self.turns for tc in turn.tool_calls] |
| 66 | |
| 67 | |
| 68 | @dataclass |
no outgoing calls