pub struct RetrievalBudget {
pub lexical_ms: u64,
pub semantic_ms: u64,
}Expand description
A time budget for a retrieval.
Fields§
§lexical_ms: u64Milliseconds allowed for lexical search.
semantic_ms: u64Milliseconds allowed for semantic fallback; zero disables it.
Implementations§
Source§impl RetrievalBudget
impl RetrievalBudget
Sourcepub fn interactive() -> Self
pub fn interactive() -> Self
The budget for a synchronous fallback on the tool-call path.
Semantic search gets a short deadline rather than none. It used to get none, on the reasoning that a network round trip would turn a slow answer into a late one — true of a remote backend, and the reason the deadline is short. But it also meant a local backend was never asked: measured against a perfect semantic oracle, this path answered exactly as many questions as BM25 alone, because the oracle was never once consulted. A deadline keeps the latency guarantee and stops throwing away the one path that could answer.
Sourcepub fn interactive_with(config: &RetrievalConfig) -> Self
pub fn interactive_with(config: &RetrievalConfig) -> Self
The interactive budget under a specific configuration.
Sourcepub fn speculative() -> Self
pub fn speculative() -> Self
The budget for speculative preparation, where semantic fallback is worth attempting because nothing is waiting on it.
Sourcepub fn speculative_with(config: &RetrievalConfig) -> Self
pub fn speculative_with(config: &RetrievalConfig) -> Self
The speculative budget under a specific configuration.
Trait Implementations§
Source§impl Clone for RetrievalBudget
impl Clone for RetrievalBudget
Source§fn clone(&self) -> RetrievalBudget
fn clone(&self) -> RetrievalBudget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetrievalBudget
impl Debug for RetrievalBudget
Source§impl PartialEq for RetrievalBudget
impl PartialEq for RetrievalBudget
impl Copy for RetrievalBudget
impl Eq for RetrievalBudget
impl StructuralPartialEq for RetrievalBudget
Auto Trait Implementations§
impl Freeze for RetrievalBudget
impl RefUnwindSafe for RetrievalBudget
impl Send for RetrievalBudget
impl Sync for RetrievalBudget
impl Unpin for RetrievalBudget
impl UnwindSafe for RetrievalBudget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].