Class Trajectory
- Namespace
- Emissary
- Assembly
- Emissary.dll
A recorded agent run: every model request and response, replayable deterministically and
serializable as a .trajectory JSON file. Record with TrajectoryRecorder,
replay by constructing a ClaudeAgent with the trajectory.
public sealed record Trajectory : IEquatable<Trajectory>
- Inheritance
-
Trajectory
- Implements
- Inherited Members
Constructors
Trajectory(int, IReadOnlyList<TrajectoryTurn>)
A recorded agent run: every model request and response, replayable deterministically and
serializable as a .trajectory JSON file. Record with TrajectoryRecorder,
replay by constructing a ClaudeAgent with the trajectory.
public Trajectory(int Version, IReadOnlyList<TrajectoryTurn> Turns)
Parameters
VersionintThe format version; currently CurrentVersion.
TurnsIReadOnlyList<TrajectoryTurn>One entry per model call, in order.
Fields
CurrentVersion
The current .trajectory format version.
public const int CurrentVersion = 1
Field Value
Properties
Turns
One entry per model call, in order.
public IReadOnlyList<TrajectoryTurn> Turns { get; init; }
Property Value
Version
The format version; currently CurrentVersion.
public int Version { get; init; }
Property Value
Methods
FromJson(string)
Deserializes a trajectory from JSON.
public static Trajectory FromJson(string json)
Parameters
jsonstringThe trajectory JSON.
Returns
Exceptions
- InvalidOperationException
The JSON is the null literal.
Load(string)
Reads a trajectory from a file.
public static Trajectory Load(string path)
Parameters
pathstringThe file path.
Returns
Save(string)
Writes the trajectory to a file.
public void Save(string path)
Parameters
pathstringThe file path, conventionally ending in
.trajectory.
ToJson()
Serializes the trajectory as indented JSON.
public string ToJson()