pub struct UtilityScoringConfig {
pub enabled: bool,
pub threshold: f32,
pub gain_weight: f32,
pub cost_weight: f32,
pub redundancy_weight: f32,
pub uncertainty_bonus: f32,
}Expand description
Configuration for utility-guided tool dispatch ([tools.utility] TOML section).
Implements the utility gate from arXiv:2603.19896: each tool call is scored
U = gain_weight*gain - cost_weight*cost - redundancy_weight*redundancy + uncertainty_bonus*uncertainty.
Calls with U < threshold are skipped (fail-closed on scoring errors).
Fields§
§enabled: boolEnable utility-guided gating. Default: false (opt-in).
threshold: f32Minimum utility score required to execute a tool call. Default: 0.1.
gain_weight: f32Weight for the estimated gain component. Must be >= 0. Default: 1.0.
cost_weight: f32Weight for the step cost component. Must be >= 0. Default: 0.5.
redundancy_weight: f32Weight for the redundancy penalty. Must be >= 0. Default: 0.3.
uncertainty_bonus: f32Weight for the exploration bonus. Must be >= 0. Default: 0.2.
Implementations§
Trait Implementations§
Source§impl Clone for UtilityScoringConfig
impl Clone for UtilityScoringConfig
Source§fn clone(&self) -> UtilityScoringConfig
fn clone(&self) -> UtilityScoringConfig
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 UtilityScoringConfig
impl Debug for UtilityScoringConfig
Source§impl Default for UtilityScoringConfig
impl Default for UtilityScoringConfig
Source§impl<'de> Deserialize<'de> for UtilityScoringConfigwhere
UtilityScoringConfig: Default,
impl<'de> Deserialize<'de> for UtilityScoringConfigwhere
UtilityScoringConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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§
impl Freeze for UtilityScoringConfig
impl RefUnwindSafe for UtilityScoringConfig
impl Send for UtilityScoringConfig
impl Sync for UtilityScoringConfig
impl Unpin for UtilityScoringConfig
impl UnsafeUnpin for UtilityScoringConfig
impl UnwindSafe for UtilityScoringConfig
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