Skip to main content

LlmClassifierRouteConfig

Struct LlmClassifierRouteConfig 

Source
pub struct LlmClassifierRouteConfig {
Show 19 fields pub classifier_target: String, pub mode: Option<ClassifierMode>, pub strong_target: Option<String>, pub weak_target: Option<String>, pub base_threshold: Option<f64>, pub threshold_step: Option<f64>, pub fail_open: Option<bool>, pub classify_trigger: ClassifyTrigger, pub message_hash_fallback: bool, pub recent_turn_window: Option<usize>, pub prompt: Option<String>, pub response_format_type: ClassifierResponseFormat, pub max_output_tokens: u64, pub escalation: Option<EscalationJudgeConfig>, pub decision: Option<DecisionJudgeRouteConfig>, pub models: Option<CategoryModelConfig>, pub default_target: Option<String>, pub response_schema: Option<String>, pub policy: Option<ClassifierPolicyConfig>,
}
Expand description

Settings for an llm_classifier route. Which fields are required depends on the ClassifierMode; using a field from the wrong mode is an error.

Fields§

§classifier_target: String

Target the judge is called through. Never a routing destination itself.

§mode: Option<ClassifierMode>

Mode to run. Defaults to escalation when escalation is set, otherwise capability.

§strong_target: Option<String>

Capability and escalation modes: the capable tier.

§weak_target: Option<String>

Capability and escalation modes: the efficient tier.

§base_threshold: Option<f64>

Capability mode: lowest solve probability that still routes to the weak target, from 0 to 1.

§threshold_step: Option<f64>

Capability mode: how much to raise the threshold when the judge is uncertain. Added once for an uncertain verdict and twice for unsupported.

§fail_open: Option<bool>

Capability mode: routes to the capable tier on judge client failures and deadlines. Defaults to true when capability mode is selected.

§classify_trigger: ClassifyTrigger

How often the judge runs: every request, once per user turn, or once per session.

§message_hash_fallback: bool

Reuses the session’s target by hashing the first user message when no session ID is available. Needs classify_trigger = "new_session".

§recent_turn_window: Option<usize>

How many trailing turns the judge sees. Unset shows it the opening task and the latest user follow-up only.

§prompt: Option<String>

Replaces the packaged judge prompt. Required in custom mode.

§response_format_type: ClassifierResponseFormat

How the judge is asked for structured output. Use json_object when the provider cannot do JSON Schema.

§max_output_tokens: u64

Most completion tokens the judge verdict may use.

§escalation: Option<EscalationJudgeConfig>

Escalation mode: how many escalate verdicts latch the session, and how much of the transcript the judge sees.

§decision: Option<DecisionJudgeRouteConfig>

Capability mode: use a decision target as the judge, with relative-advantage scoring.

§models: Option<CategoryModelConfig>

Custom mode: runtime model groups.

§default_target: Option<String>

Custom mode: category used when the judge fails or its verdict cannot be routed.

§response_schema: Option<String>

Custom mode: JSON Schema the verdict must match, written as a string.

§policy: Option<ClassifierPolicyConfig>

Custom mode: how to read the chosen target out of the verdict.

Trait Implementations§

Source§

impl Clone for LlmClassifierRouteConfig

Source§

fn clone(&self) -> LlmClassifierRouteConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LlmClassifierRouteConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LlmClassifierRouteConfig

Source§

fn default() -> LlmClassifierRouteConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LlmClassifierRouteConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more