pub struct Cassette {
pub cassette_version: String,
pub agent: String,
pub inputs: BTreeMap<String, Value>,
pub interactions: Vec<Interaction>,
pub tool_calls: Vec<ToolExchange>,
}Fields§
§cassette_version: String§agent: StringFully qualified name of the agent this was recorded against.
inputs: BTreeMap<String, Value>The inputs the recording was made with.
Kept in the cassette so it is self-contained: replaying needs no side-car file, and there is no way to pair a recording with the wrong inputs and get a confusing digest mismatch instead of a clear one.
interactions: Vec<Interaction>§tool_calls: Vec<ToolExchange>Tool invocations and what they returned, in the order they happened.
Kept in their own list rather than interleaved with the model exchanges,
because the two are matched independently: an agent may call three tools
between two asks, and a single ordered stream would make each side’s
position depend on the other’s.
A recorded result contains whatever the tool returned. That is the review burden this format adds, and why the build-time secret scan reads cassettes as well as source.
Implementations§
Source§impl Cassette
impl Cassette
pub fn new(agent: impl Into<String>) -> Cassette
Sourcepub fn to_canonical_json(&self) -> String
pub fn to_canonical_json(&self) -> String
The canonical encoding: two-space indentation, trailing newline.
Cassettes are checked in and reviewed, so they get the same stability treatment as golden IR.