pub struct StateMachineFilter { /* private fields */ }Expand description
Filters tools based on state machine rules: which tools are allowed after certain tools, and which tools become available after N turns.
Implementations§
Source§impl StateMachineFilter
impl StateMachineFilter
pub fn new() -> Self
Sourcepub fn after_tool(
self,
tool_name: impl Into<String>,
allowed_next: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn after_tool( self, tool_name: impl Into<String>, allowed_next: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add a rule: after tool_name is called, only allowed_next tools are available.
Sourcepub fn turn_threshold(
self,
min_turns: usize,
add_tools: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn turn_threshold( self, min_turns: usize, add_tools: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add a rule: tools in add_tools are hidden until min_turns is reached.
Trait Implementations§
Source§impl Default for StateMachineFilter
impl Default for StateMachineFilter
Source§impl ToolFilter for StateMachineFilter
impl ToolFilter for StateMachineFilter
Source§fn filter(
&self,
tools: Vec<ToolDefinition>,
context: &FilterContext,
) -> Vec<ToolDefinition>
fn filter( &self, tools: Vec<ToolDefinition>, context: &FilterContext, ) -> Vec<ToolDefinition>
Filter the list of tool definitions based on the current context.
Auto Trait Implementations§
impl Freeze for StateMachineFilter
impl RefUnwindSafe for StateMachineFilter
impl Send for StateMachineFilter
impl Sync for StateMachineFilter
impl Unpin for StateMachineFilter
impl UnsafeUnpin for StateMachineFilter
impl UnwindSafe for StateMachineFilter
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