pub struct LlmNode { /* private fields */ }Expand description
LLM Node - executes an LLM callable within a graph
This node wraps an LlmCallable and adapts it to the Node interface.
The input NodeState is converted to a prompt, and the LLM response
is converted back to a NodeState for downstream nodes.
Implementations§
Source§impl LlmNode
impl LlmNode
Sourcepub fn new(
name: impl Into<String>,
system_prompt: impl Into<String>,
provider: Arc<dyn ModelProvider>,
) -> Self
pub fn new( name: impl Into<String>, system_prompt: impl Into<String>, provider: Arc<dyn ModelProvider>, ) -> Self
Create a new LLM node with a provider
Sourcepub fn with_model(
name: impl Into<String>,
system_prompt: impl Into<String>,
model: impl Into<String>,
provider: Arc<dyn ModelProvider>,
) -> Self
pub fn with_model( name: impl Into<String>, system_prompt: impl Into<String>, model: impl Into<String>, provider: Arc<dyn ModelProvider>, ) -> Self
Create with explicit model pin.
Sourcepub fn with_tools(self, tools: Vec<DynTool>) -> Self
pub fn with_tools(self, tools: Vec<DynTool>) -> Self
Add tools to the underlying callable
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LlmNode
impl !RefUnwindSafe for LlmNode
impl Send for LlmNode
impl Sync for LlmNode
impl Unpin for LlmNode
impl UnsafeUnpin for LlmNode
impl !UnwindSafe 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