pub struct RoutingFn<F>(pub F);Expand description
Wrapper for routing functions used with add_conditional_edges.
Wraps a function Fn(&JsonValue) -> String so it can be used
directly as the path argument to add_conditional_edges.
ⓘ
use langgraph::prelude::*;
use langgraph_prebuilt::tools_condition;
graph.add_conditional_edges(
"agent",
RoutingFn(tools_condition),
Some(HashMap::from([
("tools".to_string(), "tools".to_string()),
(END.to_string(), END.to_string()),
])),
)?;Tuple Fields§
§0: FTrait Implementations§
Auto Trait Implementations§
impl<F> Freeze for RoutingFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for RoutingFn<F>where
F: RefUnwindSafe,
impl<F> Send for RoutingFn<F>where
F: Send,
impl<F> Sync for RoutingFn<F>where
F: Sync,
impl<F> Unpin for RoutingFn<F>where
F: Unpin,
impl<F> UnsafeUnpin for RoutingFn<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for RoutingFn<F>where
F: UnwindSafe,
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