pub struct AdaptiveContextConfig {
pub base_count: usize,
pub max_count: usize,
pub max_tokens: usize,
pub preview_length: usize,
pub min_confidence: f32,
pub weights: NamespaceWeightsConfig,
}Expand description
Configuration for adaptive memory context injection.
Fields§
§base_count: usizeBase number of memories to retrieve.
max_count: usizeMaximum number of memories to retrieve (high confidence).
max_tokens: usizeMaximum tokens for injected memory content.
preview_length: usizeMaximum length for content preview.
min_confidence: f32Minimum confidence threshold for injection.
weights: NamespaceWeightsConfigNamespace weights configuration.
Implementations§
Source§impl AdaptiveContextConfig
impl AdaptiveContextConfig
Sourcepub const fn with_base_count(self, count: usize) -> Self
pub const fn with_base_count(self, count: usize) -> Self
Sets the base memory count.
Sourcepub const fn with_max_count(self, count: usize) -> Self
pub const fn with_max_count(self, count: usize) -> Self
Sets the maximum memory count.
Sourcepub const fn with_max_tokens(self, tokens: usize) -> Self
pub const fn with_max_tokens(self, tokens: usize) -> Self
Sets the maximum token budget.
Sourcepub const fn with_preview_length(self, length: usize) -> Self
pub const fn with_preview_length(self, length: usize) -> Self
Sets the preview length for memory content.
Sourcepub const fn with_min_confidence(self, confidence: f32) -> Self
pub const fn with_min_confidence(self, confidence: f32) -> Self
Sets the minimum confidence threshold.
Sourcepub fn from_search_intent_config(config: &SearchIntentConfig) -> Self
pub fn from_search_intent_config(config: &SearchIntentConfig) -> Self
Builds context configuration from search intent settings.
Sourcepub fn with_weights(self, weights: NamespaceWeightsConfig) -> Self
pub fn with_weights(self, weights: NamespaceWeightsConfig) -> Self
Sets custom namespace weights.
Sourcepub const fn memories_for_confidence(&self, confidence: f32) -> usize
pub const fn memories_for_confidence(&self, confidence: f32) -> usize
Calculates the number of memories to retrieve based on confidence.
Trait Implementations§
Source§impl Clone for AdaptiveContextConfig
impl Clone for AdaptiveContextConfig
Source§fn clone(&self) -> AdaptiveContextConfig
fn clone(&self) -> AdaptiveContextConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdaptiveContextConfig
impl Debug for AdaptiveContextConfig
Auto Trait Implementations§
impl Freeze for AdaptiveContextConfig
impl RefUnwindSafe for AdaptiveContextConfig
impl Send for AdaptiveContextConfig
impl Sync for AdaptiveContextConfig
impl Unpin for AdaptiveContextConfig
impl UnwindSafe for AdaptiveContextConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Converts
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>
Converts
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>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].