pub struct ClassificationEngineConfig {
pub use_llm: bool,
pub llm_model: String,
pub llm_provider: String,
pub openrouter_api_key: Option<String>,
pub confidence_threshold: f64,
pub weighted_sum: WeightedSumConfig,
}Expand description
Runtime configuration for the ClassificationEngine.
Why: classification tiers (especially LLM) need provider / model /
threshold tuning; bundling those knobs into a config struct keeps the
engine constructor signature stable as new tiers are added.
What: holds LLM toggles (use_llm, llm_model, llm_provider,
openrouter_api_key) plus a confidence_threshold shared by all tiers,
and the weighted_sum config for Tier 2.5 (added in 1.3.0).
Test: every classifier test in classify::tests builds one via
Default::default() or with explicit overrides.
Fields§
§use_llm: boolWhether to engage the LLM tier when tiers 1–3 fail.
llm_model: StringLLM model identifier (provider-specific).
llm_provider: StringLLM provider: "openrouter", "openai", or "auto".
openrouter_api_key: Option<String>Optional OpenRouter API key. If None, the env var
OPENROUTER_API_KEY is consulted at engine-build time.
confidence_threshold: f64Minimum confidence required to accept a verdict.
Verdicts below this threshold are returned as-is (so the caller
can still inspect them), but their confidence informs filtering
in downstream reports.
weighted_sum: WeightedSumConfigConfiguration for the weighted-sum tier (Tier 2.5). Added in 1.3.0.
Why: the pipeline builds the engine from ClassificationEngineConfig;
threading the weighted-sum config here keeps all per-run tier knobs in
one place without changing the engine constructor’s arity.
What: forwards to WeightedSumClassifier::new at engine-build time.
Test: covered indirectly by classify_sync tests that exercise Tier 2.5.
Trait Implementations§
Source§impl Clone for ClassificationEngineConfig
impl Clone for ClassificationEngineConfig
Source§fn clone(&self) -> ClassificationEngineConfig
fn clone(&self) -> ClassificationEngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClassificationEngineConfig
impl Debug for ClassificationEngineConfig
Auto Trait Implementations§
impl Freeze for ClassificationEngineConfig
impl RefUnwindSafe for ClassificationEngineConfig
impl Send for ClassificationEngineConfig
impl Sync for ClassificationEngineConfig
impl Unpin for ClassificationEngineConfig
impl UnsafeUnpin for ClassificationEngineConfig
impl UnwindSafe for ClassificationEngineConfig
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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