pub struct LLMNode {
pub name: String,
pub model: ResolvedModel,
pub executor: ToolExecutor,
pub config: ToolUseConfig,
pub deps: ToolUseDeps,
}Expand description
LLM 调用节点 — 执行单次 LLM 调用。
职责单一: 只负责“调用 LLM + 收集流式响应 + emit Effects“。 不感知 Budget、Compaction、Iteration Limit 等运行时策略。
§Typed State
从 ctx 获取 AgentState,直接操作 typed 字段,写回 ctx。
Fields§
§name: String§model: ResolvedModel§executor: ToolExecutor§config: ToolUseConfig§deps: ToolUseDepsImplementations§
Source§impl LLMNode
impl LLMNode
pub fn new( name: impl Into<String>, model: ResolvedModel, executor: ToolExecutor, config: ToolUseConfig, deps: ToolUseDeps, ) -> Self
Trait Implementations§
Source§impl FlowNode<AgentState> for LLMNode
impl FlowNode<AgentState> for LLMNode
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 !RefUnwindSafe for LLMNode
impl !UnwindSafe for LLMNode
impl Freeze for LLMNode
impl Send for LLMNode
impl Sync for LLMNode
impl Unpin for LLMNode
impl UnsafeUnpin for LLMNode
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