Struct Prediction Trie Lookup
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
Looks up predictions in a prediction trie with graceful fallback.
Fallback chain:
- Exact path + exact call_index
- Exact path + predictions_any_index
- Deepest ancestor + exact call_index
- Deepest ancestor + predictions_any_index
- … continue to root …
- None (no predictions available)
Implementations
impl<'a> PredictionTrieLookup<'a>
impl<'a> PredictionTrieLookup<'a>
new
pub fn new(root: &'a PredictionTrieNode) -> Self
Create a new lookup over the given trie root.
find
pub 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.