pub enum Flow {
Default,
Func(FlowFn),
}
Expand description
A user-facing enum defining how an Agent
executes a flow
after receiving a prompt.
The flow determines how prompts are handled and how responses are generated. By default, the agent uses the built-in flow, but you can(and should) also provide custom functions or closures.
§Variants
Flow::Default
— use the built-in default flow.- [
Flow::Custom
] — supply a function pointer with the correct signature. - [
Flow::CustomClosure
] — supply a closure wrapped in anArc
.
Variants§
Default
Use the built-in default flow.
Func(FlowFn)
Use a custom function pointer.
Function must match for<'a> fn(&'a mut Agent, String) -> FlowFuture<'a>
.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Flow
impl !RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl !UnwindSafe for Flow
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