Module ui

Module ui 

Source
Available on crate feature ui only.
Expand description

Dynamic UI generation for agents.

Enables agents to render rich user interfaces via tool calls:

Available with feature: ui

Modules§

prompts
UI Agent System Prompts
schema
templates
Pre-built UI Templates
tools
toolset
validation
Validation for UI components

Structs§

Alert
Badge
Button
Card
Chart
CodeBlock
Container
DateInput
Divider
Grid
Icon
Image
KeyValue
KeyValuePair
List
Modal
MultiSelect
NumberInput
Progress
RenderAlertTool
Tool for rendering alerts/notifications
RenderCardTool
Tool for rendering information cards.
RenderChartTool
Tool for rendering charts and data visualizations.
RenderConfirmTool
Tool for rendering confirmation dialogs
RenderFormTool
Tool for rendering forms to collect user input.
RenderLayoutTool
Tool for rendering complex multi-component layouts.
RenderModalTool
Tool for rendering modal dialogs.
RenderProgressTool
Tool for rendering progress indicators and loading states
RenderTableTool
Tool for rendering data tables.
RenderToastTool
Tool for rendering toast notifications
Select
SelectOption
Skeleton
Slider
Spinner
Stack
StatItem
Status item for dashboard templates
Switch
Tab
Table
TableColumn
Tabs
TemplateData
Template data that can be customized
Text
TextInput
Textarea
Toast
UiResponse
UiToolset
A toolset containing all UI rendering tools.
UiUpdate
Incremental UI update for streaming
UserData
User data for templates
ValidationError
Validation error for UI components

Enums§

AlertVariant
BadgeVariant
ButtonVariant
ChartKind
Component
ModalSize
SkeletonVariant
SpinnerSize
StackDirection
TextVariant
Theme
Theme configuration for UI rendering
UiEvent
Event sent from UI to agent when user interacts with components
UiOperation
Operation type for streaming UI updates
UiTemplate
Available UI templates

Constants§

MIME_TYPE_UI
MIME_TYPE_UI_UPDATE
UI_AGENT_PROMPT
System prompt for agents using UI tools.
UI_AGENT_PROMPT_SHORT
Short version of the prompt for token-limited contexts

Traits§

Validate
Trait for validatable UI components

Functions§

render_template
Generate a UI response from a template
validate_ui_response
Validate a UiResponse and return Result