Skip to main content

UserInputHandler

Trait UserInputHandler 

Source
pub trait UserInputHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        question: String,
        choices: Option<Vec<String>>,
        allow_freeform: Option<bool>,
    ) -> Pin<Box<dyn Future<Output = Option<UserInputResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler for user_input.requested events from the ask_user tool.

When unset, requestUserInput: false goes on the wire and the ask_user tool is disabled for the session.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, session_id: SessionId, question: String, choices: Option<Vec<String>>, allow_freeform: Option<bool>, ) -> Pin<Box<dyn Future<Output = Option<UserInputResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Answer a question on behalf of the user. Return None to signal “no answer available”.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§