Table of Contents

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

Version int

The format version; currently CurrentVersion.

Turns IReadOnlyList<TrajectoryTurn>

One entry per model call, in order.

Fields

CurrentVersion

The current .trajectory format version.

public const int CurrentVersion = 1

Field Value

int

Properties

Turns

One entry per model call, in order.

public IReadOnlyList<TrajectoryTurn> Turns { get; init; }

Property Value

IReadOnlyList<TrajectoryTurn>

Version

The format version; currently CurrentVersion.

public int Version { get; init; }

Property Value

int

Methods

FromJson(string)

Deserializes a trajectory from JSON.

public static Trajectory FromJson(string json)

Parameters

json string

The trajectory JSON.

Returns

Trajectory

Exceptions

InvalidOperationException

The JSON is the null literal.

Load(string)

Reads a trajectory from a file.

public static Trajectory Load(string path)

Parameters

path string

The file path.

Returns

Trajectory

Save(string)

Writes the trajectory to a file.

public void Save(string path)

Parameters

path string

The file path, conventionally ending in .trajectory.

ToJson()

Serializes the trajectory as indented JSON.

public string ToJson()

Returns

string