pub struct ContextBudget { /* private fields */ }Expand description
The shared context accounting the two tools read and write.
Implementations§
Source§impl ContextBudget
impl ContextBudget
Sourcepub fn new() -> ContextBudget
pub fn new() -> ContextBudget
A budget with nothing published yet.
Sourcepub fn publish(&self, usage: Value)
pub fn publish(&self, usage: Value)
Publish the agent’s ContextUsage (already serialized, so this
module needs no dependency on the agent’s own types).
Sourcepub fn snapshot(&self) -> Option<Value>
pub fn snapshot(&self) -> Option<Value>
The last published accounting, if the agent has published one.
Sourcepub fn request_new_context(&self, request: NewContextRequest)
pub fn request_new_context(&self, request: NewContextRequest)
Park a fresh-window request for the agent to apply.
Sourcepub fn take_new_context(&self) -> Option<NewContextRequest>
pub fn take_new_context(&self) -> Option<NewContextRequest>
Take the parked request, if any (the agent calls this once per tool round).
Trait Implementations§
Source§impl Debug for ContextBudget
impl Debug for ContextBudget
Source§impl Default for ContextBudget
impl Default for ContextBudget
Source§fn default() -> ContextBudget
fn default() -> ContextBudget
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ContextBudget
impl RefUnwindSafe for ContextBudget
impl Send for ContextBudget
impl Sync for ContextBudget
impl Unpin for ContextBudget
impl UnsafeUnpin for ContextBudget
impl UnwindSafe for ContextBudget
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