Adding AI capabilities allows users to interact with widget functionality through natural language. Instead of requiring users to know which widget controls or settings to use, AI can identify an appropriate widget capability, provide the required inputs, perform the task, and communicate the result.
As a widget developer, you can extend your custom ArcGIS Experience Builder
Experience Builder supports three ways to integrate a custom widget with AI:
| Capability | Use it to | Example |
|---|---|---|
| AI actions | Allow AI to perform tasks using a widget at runtime. | Zoom a map to selected data. |
| AI renderer | Allow AI to display widget-specific content in the chat. | Display a chart of analysis results. |
| Human input | Collect input from the user during an AI action. | Ask the user to select a layer before continuing. |
AI actions
AI actions make widget functionality available to AI at runtime. Use an action when AI needs to perform a task or retrieve information from a widget.
For example, a Map widget could expose actions to:
- Zoom to data from one or more data sources.
- Get the current map extent.
- Perform another map operation supported by the widget.
An action should describe a meaningful task, with clear inputs and a result that AI can communicate to the user. When an action changes widget state, the widget interface should reflect the result. If the operation can be reversed, consider providing undo behavior.
Expose capabilities
An AI action should expose the underlying capability of a widget rather than simulate interactions with its user interface.
For example, a Print widget can expose a print action with options such as include:
printMap({
includeLegend: true
})Avoid creating separate actions that represent individual UI operations, such as:
enableLegend()
clickPrintButton()Designing actions around complete tasks allows AI to determine the appropriate parameters and perform the operation without depending on the structure of the widget interface.
AI renderer
An AI renderer provides a widget-specific way to present information in the chat. Use a renderer when a visual representation would communicate results more effectively than text alone. For example, a Chart widget could display a chart representing feature data instead of returning the same information only as text.
Be mindful of the chat context and the user's needs when designing the renderer:
- Keep the rendered content focused on the chat experience. A widget displayed in the chat may not need all of the controls available in its usual runtime interface.
- An AI renderer presents content in the chat. It is not the mechanism for collecting a response that resumes a paused action. Use human input for that purpose.
Human input
Human input allows an AI action to collect a response from the user before continuing. Use it when an action needs the user to make a selection or confirm an operation. For example, a widget could ask the user to select a layer before an action processes its data.
Some things to consider when using human input:
- Unlike an AI renderer, which presents content, human input collects a response and resumes a paused action.
- Make the requested input clear and provide a meaningful description of the user's response, including when the user cancels the interaction.
Use capabilities together
AI actions, AI renderers, and human input capabilities serve different purposes and can complement one another. You do not need to implement all three in every widget.
For example, an experience could support this workflow:
- A user asks AI to summarize data from a layer.
- An AI action requests human input so the user can choose the layer.
- The action resumes with the selection and processes the data.
- An AI renderer presents the resulting information as a chart in the chat.
Choose the capabilities needed for the workflow rather than exposing every widget interaction to AI.
Design considerations
When planning AI capabilities for a widget:
- Design AI actions around complete user tasks rather than individual UI interactions.
- Give each action a clear description that explains what it does and when it should be used.
- Prefer explicit parameters over actions that depend on hidden widget state.
- Return meaningful result descriptions so AI can communicate what happened.
- Keep AI renderers lightweight and focused on the content needed in the chat experience.
- Use human input when an action needs a response from the user before it can continue.
Next steps
See Implement AI capabilities in custom widgets to declare and implement the capabilities in your widget.