Skip to main content

TranscriptMessage

Trait TranscriptMessage 

Source
pub trait TranscriptMessage {
    // Required methods
    fn render_for_compaction(&self, out: &mut String);
    fn user_text_for_compaction(&self, out: &mut String) -> bool;

    // Provided method
    fn is_compaction_summary(&self, summary_prefix: &str) -> bool { ... }
}
Expand description

Runtime-owned transcript adapter.

Implement this trait for the caller’s typed message enum. Rendering should be deterministic, concise, and model-readable.

If the source transcript carries private reasoning, render only readable text through append_private_reasoning_for_compaction. The compaction prompt directs the summarizer to retain durable findings, not raw chain-of-thought. Opaque, signed, or encrypted replay payloads must not be rendered.

Required Methods§

Source

fn render_for_compaction(&self, out: &mut String)

Render the message into the summarization transcript.

Source

fn user_text_for_compaction(&self, out: &mut String) -> bool

Write the user-visible text for real user messages.

Return false for non-user messages. Images or binary attachments should be omitted or represented by safe caller-owned text.

Provided Methods§

Source

fn is_compaction_summary(&self, summary_prefix: &str) -> bool

Identify compaction-summary messages that should not be retained as real recent user messages.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§