MCPcopy
hub / github.com/IBM/AssetOpsBench / Trajectory

Class Trajectory

src/agent/models.py:47–65  ·  view source on GitHub ↗

Full execution trace across all agent turns.

Source from the content-addressed store, hash-verified

45
46@dataclass
47class 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

Callers 6

runMethod · 0.85
_build_trajectoryFunction · 0.85
runMethod · 0.85
_build_trajectoryFunction · 0.85
build_trajectoryFunction · 0.85

Calls

no outgoing calls

Tested by 1