mod lookup#

module lookup#

Prediction trie lookup with three-level fallback chain.

Structs and Unions

struct PredictionTrieLookup<'a>#

Looks up predictions in a prediction trie with graceful fallback.

Fallback chain:

  1. Exact path + exact call_index

  2. Exact path + predictions_any_index

  3. Deepest ancestor + exact call_index

  4. Deepest ancestor + predictions_any_index

  5. … continue to root …

  6. None (no predictions available)

Implementations

impl<'a> PredictionTrieLookup<'a>#

Functions

fn find(&self, path: &[String], call_index: u32) -> Option<&'a LlmCallPrediction>#

Find the best matching prediction for the given path and call index.

Walks the trie following path elements, tracking the deepest node that has a prediction. At each node, prefers predictions_by_call_index[call_index] over predictions_any_index.

fn new(root: &'a PredictionTrieNode) -> Self#

Create a new lookup over the given trie root.