• Material 3
  • Bootstrap 5
  • Fluent 2
  • Tailwind CSS
  • Fluent 2 High Contrast
Preferences
Mode Selection
Touch
Mouse
Theme Selection
Theme Mode
Localization
*Translated by Google Translator.
Currency

This sample demonstrates how to render interactive generative UI tools directly within AI responses using user prompts in the AI AssistView control. By configuring an appropriate system prompt, the AI can generate well-structured prompts that automatically invoke the registered tools, enabling seamless integration of dynamic and interactive UI elements within responses.

DEMO
SOURCE

In this example, the AI AssistView is configured with the UI tools:

  • The addPromptResponse method adds AI responses to the AIAssistView by accepting a blocks array that defines content structure. Tools are registered using registerToolUI(), which defines a template and handler function for rendering.
  • Tool registration - Three registered tools deliver rich content: weather-card for forecast displays, chart-tool for GDP growth visualization, and sales-grid for regional performance data.
  • bannerTemplate - Customizes the initial banner content with icon and heading.
  • promptSuggestions - Provides predefined prompts for weather forecasts, sales analysis, and economic trend data.
  • promptRequest - Handles prompt execution and dynamically renders custom tools.
  • enableStreaming - Enables real-time response streaming with simulated delay.
Transform your ASP.NET Core web apps today with Syncfusion® ASP.NET Core components
145+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE
opens in a new tab