Struct Prediction Trie Builder

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

1pub struct PredictionTrieBuilder { /* private fields */ }

Builds a PredictionTrieNode tree from RunRecords via incremental accumulator merge.

Usage

1let mut builder = PredictionTrieBuilder::new(Some(SensitivityConfig::default()));
2builder.add_run(&run1);
3builder.add_run(&run2);
4let trie = builder.build();

Implementations

impl PredictionTrieBuilder

impl PredictionTrieBuilder

new

pub fn new(sensitivity_config: Option<SensitivityConfig>) -> Self

Creates a new builder with optional sensitivity scoring.

with_accumulators

pub fn with_accumulators(
    accumulators: AccumulatorState,
    sensitivity_config: Option<SensitivityConfig>,
) -> Self

Creates a builder seeded with pre-existing accumulators.

Used by the learner pipeline to resume incremental learning from a stored AccumulatorState.

add_run

pub fn add_run(&mut self, run: &RunRecord)

Processes a single RunRecord and updates accumulators.

Extracts LLM call contexts, optionally computes sensitivity scores, and updates accumulators at every node along each call’s path.

build

pub fn build(&self) -> PredictionTrieNode

Constructs the prediction trie from accumulated data.

Iterates all accumulated nodes, navigates/creates the trie path, and populates predictions from the accumulators.

accumulators

pub fn accumulators(&self) -> &AccumulatorState

Returns a reference to the underlying accumulator state.