pub struct UtilityContext {
pub tool_calls_this_turn: usize,
pub tokens_consumed: usize,
pub token_budget: usize,
pub user_requested: bool,
}Expand description
Context required to compute utility — provided by the agent loop.
Fields§
§tool_calls_this_turn: usizeNumber of tool calls already dispatched in the current LLM turn.
tokens_consumed: usizeTokens consumed so far in this turn.
token_budget: usizeToken budget for the current turn. 0 = budget unknown (cost component treated as 0).
user_requested: boolTrue when the user explicitly requested tool invocation — either via a /tool slash
command or when the user message contains an unambiguous tool-invocation phrase detected
by has_explicit_tool_request. Must NOT be set from LLM call content or tool outputs.
Trait Implementations§
Source§impl Clone for UtilityContext
impl Clone for UtilityContext
Source§fn clone(&self) -> UtilityContext
fn clone(&self) -> UtilityContext
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 moreAuto Trait Implementations§
impl Freeze for UtilityContext
impl RefUnwindSafe for UtilityContext
impl Send for UtilityContext
impl Sync for UtilityContext
impl Unpin for UtilityContext
impl UnsafeUnpin for UtilityContext
impl UnwindSafe for UtilityContext
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