Skip to main content

BranchSummarizer

Trait BranchSummarizer 

Source
pub trait BranchSummarizer {
    // Required methods
    fn summarize(&self, branch_text: &str) -> Result<String, InterchangeError>;
    fn model_id(&self) -> &str;
}
Expand description

Injectable branch-summarization side-call (D-9), the module-21 analog of a caller-supplied branch summarizer — same shape, deliberately: a real implementation calls out to a cheap model; tests inject a deterministic fake. See SessionTree::summarize_branch_with’s doc comment for the “never blocks, never fails the caller” contract this trait’s Err feeds into.

Required Methods§

Source

fn summarize(&self, branch_text: &str) -> Result<String, InterchangeError>

Summarize branch_text (the rendering SessionTree::render_branch_text produces) into a short paragraph. Err means the caller falls back to a deterministic stub — see SessionTree::summarize_branch_with.

Source

fn model_id(&self) -> &str

Identifier of the model behind this summarizer (recorded on BranchSummary::model_id).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§