pub struct RenderFormTool;Expand description
Tool for rendering forms to collect user input.
This tool generates form UI components that allow agents to collect
structured input from users. The form includes various field types
and returns submitted data via UiEvent::FormSubmit.
§Supported Field Types
text: Single-line text input (default)email: Email address input with validationpassword: Password input (masked)number: Numeric inputselect: Dropdown selection from optionstextarea: Multi-line text input
§Example JSON Parameters
{
"title": "Contact Form",
"description": "Please fill out your details",
"fields": [
{ "name": "email", "label": "Email", "type": "email", "required": true },
{ "name": "message", "label": "Message", "type": "textarea" }
],
"submit_label": "Send"
}Implementations§
Trait Implementations§
Source§impl Default for RenderFormTool
impl Default for RenderFormTool
Source§impl Tool for RenderFormTool
impl Tool for RenderFormTool
fn name(&self) -> &str
fn description(&self) -> &str
fn parameters_schema(&self) -> Option<Value>
fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn ToolContext>,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for RenderFormTool
impl RefUnwindSafe for RenderFormTool
impl Send for RenderFormTool
impl Sync for RenderFormTool
impl Unpin for RenderFormTool
impl UnsafeUnpin for RenderFormTool
impl UnwindSafe for RenderFormTool
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