pub struct QuestionTool { /* private fields */ }Expand description
Builtin tool that pauses the agent to ask the user structured questions.
When the agent needs clarification before proceeding it can call this tool
with a list of questions, each with a header and a set of labelled options.
Execution is suspended until the registered OnQuestion callback returns
the user’s answers, enabling interactive human-in-the-loop flows within an
otherwise autonomous run. Each question may allow single or multiple
selections via the multiple flag.
Implementations§
Source§impl QuestionTool
impl QuestionTool
pub fn new(on_question: Arc<OnQuestion>) -> Self
Trait Implementations§
Source§impl Tool for QuestionTool
impl Tool for QuestionTool
fn definition(&self) -> ToolDefinition
fn execute( &self, _ctx: &ExecutionContext, input: Value, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, Error>> + Send + '_>>
Auto Trait Implementations§
impl Freeze for QuestionTool
impl !RefUnwindSafe for QuestionTool
impl Send for QuestionTool
impl Sync for QuestionTool
impl Unpin for QuestionTool
impl UnsafeUnpin for QuestionTool
impl !UnwindSafe for QuestionTool
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