pub struct NamespaceWeightsConfig {
pub howto: HashMap<String, f32>,
pub troubleshoot: HashMap<String, f32>,
pub location: HashMap<String, f32>,
pub explanation: HashMap<String, f32>,
pub comparison: HashMap<String, f32>,
pub general: HashMap<String, f32>,
}Expand description
Runtime namespace weights configuration.
Contains weight multipliers for each intent type. Values are
stored as HashMap<String, f32> where keys are namespace names
(lowercase) and values are boost multipliers.
Fields§
§howto: HashMap<String, f32>Weights for HowTo intent.
troubleshoot: HashMap<String, f32>Weights for Troubleshoot intent.
location: HashMap<String, f32>Weights for Location intent.
explanation: HashMap<String, f32>Weights for Explanation intent.
comparison: HashMap<String, f32>Weights for Comparison intent.
general: HashMap<String, f32>Weights for General intent.
Implementations§
Source§impl NamespaceWeightsConfig
impl NamespaceWeightsConfig
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Creates a new config with default weights (matches hard-coded behavior).
Sourcepub fn get_weight(&self, intent_type: &str, namespace: &str) -> f32
pub fn get_weight(&self, intent_type: &str, namespace: &str) -> f32
Gets the weight for a namespace and intent type.
Returns 1.0 if no weight is configured.
Sourcepub fn get_intent_weights(&self, intent_type: &str) -> Vec<(String, f32)>
pub fn get_intent_weights(&self, intent_type: &str) -> Vec<(String, f32)>
Gets all namespace weights for a given intent type.
Returns a vector of (namespace_name, weight) pairs.
Sourcepub fn merge_from_file(&mut self, file: &ConfigFileNamespaceWeights)
pub fn merge_from_file(&mut self, file: &ConfigFileNamespaceWeights)
Merges config file weights into this config.
Only overrides values that are explicitly set in the file config.
fn merge_intent_weights( target: &mut HashMap<String, f32>, source: &ConfigFileIntentWeights, )
Trait Implementations§
Source§impl Clone for NamespaceWeightsConfig
impl Clone for NamespaceWeightsConfig
Source§fn clone(&self) -> NamespaceWeightsConfig
fn clone(&self) -> NamespaceWeightsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamespaceWeightsConfig
impl Debug for NamespaceWeightsConfig
Source§impl Default for NamespaceWeightsConfig
impl Default for NamespaceWeightsConfig
Source§fn default() -> NamespaceWeightsConfig
fn default() -> NamespaceWeightsConfig
Auto Trait Implementations§
impl Freeze for NamespaceWeightsConfig
impl RefUnwindSafe for NamespaceWeightsConfig
impl Send for NamespaceWeightsConfig
impl Sync for NamespaceWeightsConfig
impl Unpin for NamespaceWeightsConfig
impl UnwindSafe for NamespaceWeightsConfig
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<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].