pub struct Transcript { /* private fields */ }Expand description
The messages one run’s model saw, one JSON line each, already scanned. Private fields: a transcript that skipped the scan cannot be assembled a line at a time.
Implementations§
Source§impl Transcript
impl Transcript
Sourcepub fn of(
run: RunId,
conversation: &Conversation,
) -> Result<Transcript, AxError>
pub fn of( run: RunId, conversation: &Conversation, ) -> Result<Transcript, AxError>
Renders and scans every message of the window.
§Errors
Refuses a message that will not serialise, which is a defect in the wire types rather than in the conversation.
Sourcepub fn address(room: &Address, run: RunId) -> Result<Address, AxError>
pub fn address(room: &Address, run: RunId) -> Result<Address, AxError>
<room>/<run-id>.jsonl. Pure, so a handoff can name the address
before the run it belongs to has taken a turn.
§Errors
Propagates a room whose address cannot take another segment.
pub fn run(&self) -> RunId
pub fn lines(&self) -> &[String]
Sourcepub fn materialise(
&self,
cas: &mut Cas,
city_root: &Path,
room: &Address,
) -> Result<TranscriptRecord, AxError>
pub fn materialise( &self, cas: &mut Cas, city_root: &Path, room: &Address, ) -> Result<TranscriptRecord, AxError>
Pins the transcript in the store, then writes it read-only at
its address under city_root.
Writing the same transcript twice is writing it once: the store deduplicates by content, and a file already at the address is left as it is.
§Errors
Propagates a store that will not take the bytes and a room that will not take the file, each naming the path.