pub struct Router;Expand description
Router helper functions for common patterns
Implementations§
Source§impl Router
impl Router
Sourcepub fn has_tool_calls(
messages_field: &str,
if_true: &str,
if_false: &str,
) -> impl Fn(&State) -> String + Send + Sync + Clone
pub fn has_tool_calls( messages_field: &str, if_true: &str, if_false: &str, ) -> impl Fn(&State) -> String + Send + Sync + Clone
Sourcepub fn by_bool(
field: &str,
if_true: &str,
if_false: &str,
) -> impl Fn(&State) -> String + Send + Sync + Clone
pub fn by_bool( field: &str, if_true: &str, if_false: &str, ) -> impl Fn(&State) -> String + Send + Sync + Clone
Sourcepub fn max_iterations(
counter_field: &str,
max: usize,
continue_target: &str,
done_target: &str,
) -> impl Fn(&State) -> String + Send + Sync + Clone
pub fn max_iterations( counter_field: &str, max: usize, continue_target: &str, done_target: &str, ) -> impl Fn(&State) -> String + Send + Sync + Clone
Sourcepub fn on_error(
error_field: &str,
error_target: &str,
success_target: &str,
) -> impl Fn(&State) -> String + Send + Sync + Clone
pub fn on_error( error_field: &str, error_target: &str, success_target: &str, ) -> impl Fn(&State) -> String + Send + Sync + Clone
Auto Trait Implementations§
impl Freeze for Router
impl RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnwindSafe for Router
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