pub struct PostLLMGuard {
pub name: String,
pub stop_config: StopConfig,
}Expand description
LLM 调用后的后置检查节点 — 统一处理所有终止条件与路由。
从 LLMNode 提取的全部运行时策略:
- 最大迭代检查
- Budget 检查(单轮推理 / 总输出 / 总推理)
- 路由决策(Tool / End)
检查顺序:
- 已终止(stop_reason 已设置)→ End
- 超过最大迭代 → End
- 单轮推理超限 → End
- 总输出超限 → End
- 总推理超限 → End
- 有 tool_calls → Goto(“tool”)
- 无 tool_calls → End(正常完成)
Fields§
§name: String§stop_config: StopConfigImplementations§
Source§impl PostLLMGuard
impl PostLLMGuard
pub fn new(name: impl Into<String>, stop_config: StopConfig) -> Self
Trait Implementations§
Source§impl FlowNode<AgentState> for PostLLMGuard
impl FlowNode<AgentState> for PostLLMGuard
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut NodeContext<'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 NodeContext<'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 PostLLMGuard
impl RefUnwindSafe for PostLLMGuard
impl Send for PostLLMGuard
impl Sync for PostLLMGuard
impl Unpin for PostLLMGuard
impl UnsafeUnpin for PostLLMGuard
impl UnwindSafe for PostLLMGuard
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