pub struct AdaptiveHintsIntercept { /* private fields */ }Expand description
Opt-in LLM request intercept that injects AgentHints into request
headers from the prediction trie in HotCache.
Constructed via AdaptiveHintsIntercept::new and converted to an
LlmRequestInterceptFn via AdaptiveHintsIntercept::into_request_fn for
registration with the NeMo Flow runtime.
Implementations§
Source§impl AdaptiveHintsIntercept
impl AdaptiveHintsIntercept
Sourcepub fn new(hot_cache: Arc<RwLock<HotCache>>, agent_id: String) -> Self
pub fn new(hot_cache: Arc<RwLock<HotCache>>, agent_id: String) -> Self
Creates a new AdaptiveHintsIntercept.
Sourcepub fn into_request_fn(self) -> LlmRequestInterceptFn
pub fn into_request_fn(self) -> LlmRequestInterceptFn
Converts this intercept into an LlmRequestInterceptFn suitable for
registration with [register_llm_request_intercept].
The returned closure reads the HotCache trie, builds AgentHints, injects them into the request headers and body, and returns the transformed request.
Auto Trait Implementations§
impl !Freeze for AdaptiveHintsIntercept
impl RefUnwindSafe for AdaptiveHintsIntercept
impl Send for AdaptiveHintsIntercept
impl Sync for AdaptiveHintsIntercept
impl Unpin for AdaptiveHintsIntercept
impl UnsafeUnpin for AdaptiveHintsIntercept
impl UnwindSafe for AdaptiveHintsIntercept
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more