pub struct BudgetCondition {
pub name: String,
pub budget: ContextBudget,
}Expand description
预算条件节点 — 检查 Token 预算,决定是否进入 Compactor。
预算充足 → Goto(“llm”) 需要压缩 → Goto(“compactor”)
Fields§
§name: String§budget: ContextBudgetImplementations§
Source§impl BudgetCondition
impl BudgetCondition
pub fn new(name: impl Into<String>, budget: ContextBudget) -> Self
Trait Implementations§
Source§impl LeafNode<AgentState> for BudgetCondition
impl LeafNode<AgentState> for BudgetCondition
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut LeafContext<'life2, AgentState>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut LeafContext<'life2, AgentState>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
执行节点逻辑。
Auto Trait Implementations§
impl Freeze for BudgetCondition
impl RefUnwindSafe for BudgetCondition
impl Send for BudgetCondition
impl Sync for BudgetCondition
impl Unpin for BudgetCondition
impl UnsafeUnpin for BudgetCondition
impl UnwindSafe for BudgetCondition
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