Syncfusion React AI AssistView Component
Component Overview
The Syncfusion React AI AssistView component is a comprehensive interactive chat component designed for building AI-powered conversational interfaces. It provides:
Core Capabilities
- Prompt-Response Management: Manage conversation history with automatic data collection
- Real-time Streaming: Stream AI responses character-by-character for live typing effects
- Chain of Thoughts: Visualize AI reasoning process through thinking blocks with multi-stage workflow support
- Template System: Customize every UI element (banners, prompt items, responses, suggestions, footer)
- Multi-View Support: Switch between conversation assist view and custom content views
- Voice Integration: Built-in Speech-to-Text (voice input) and Text-to-Speech (voice output)
- File Attachments: Upload and include files with prompts
- Advanced Toolbars: Configurable toolbars for header, footer, responses, and prompts
- AI Service Integration: Direct integration with OpenAI, Azure OpenAI, and other AI services
- Event-Driven Architecture: Hooks for prompt submission, changes, and component lifecycle
Key Features
- Markdown Support: Render AI responses as formatted HTML via markdown parsing
- Conversation History: Automatic tracking of all prompts and responses
- Suggestion System: Display helpful prompt suggestions to guide users
- Avatar Customization: Customize user and AI icons/avatars
- Scroll Management: Auto-scroll or manual scroll-to-bottom button
- Clear Functionality: Clear current prompt or entire conversation
- Regenerate Responses: Request alternative AI responses for existing prompts without resubmitting queries
- Responsive Design: Works on desktop and mobile with responsive layouts
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Install @syncfusion/ej2-react-interactive-chat package
- Add CSS theme imports
- Create basic component initialization
- Render component to DOM
- First working functional component example
Configuration Essentials
📄 Read: references/configuration-essentials.md
- Set initial prompt text and placeholders
- Configure prompt suggestions and suggestion headers
- Customize user and AI avatar icons
- Control clear button visibility
- Enable/disable scroll-to-bottom functionality
- Manage component instance via refs
- Set component dimensions (height and width)
- Apply custom CSS classes for styling
- Control header visibility
- Configure globalization (locale, RTL support)
- Enable state persistence across sessions
Conversation Management
📄 Read: references/conversation-management.md
- Initialize with pre-configured conversation data
- Add responses (string or object format)
- Access and manage conversation history
- Work with PromptModel data structure
- Render markdown in responses
- Persist and restore conversations
Events and Interactions
📄 Read: references/events-and-interactions.md
- Handle component lifecycle (created event)
- Respond to prompt submissions (promptRequest event)
- Track prompt text changes (promptChanged event)
- Access detailed event arguments (PromptChangedEventArgs, PromptRequestEventArgs)
- Cancel prompt submissions programmatically
- Handle stop responding events for long operations
- Modify suggestions and toolbar items dynamically
- Implement event-driven workflows
- Integrate with AI services via event handlers
Toolbar Customization
📄 Read: references/toolbar-customization.md
- Configure four toolbar types (header, footer, response, prompt)
- Add custom toolbar items
- Control toolbar positioning (Inline vs Bottom)
- Customize toolbar icons
- Handle item click events
- Configure all ToolbarItemModel properties (align, cssClass, disabled, tabIndex, template, type, visible)
- Create custom toolbar item templates
- Control item visibility and enabled state dynamically
- Set tab order for keyboard navigation
- Manage attachment button behavior
- Enable regenerate responses functionality for multiple AI-generated responses
- Navigate between regenerated responses with previous/next buttons
File Attachments
📄 Read: references/file-attachments.md
- Enable file attachment support
- Configure upload endpoints (saveUrl, removeUrl)
- Restrict file types (allowedFileType)
- Set file size limits (maxFileSize)
- Limit number of attachments (maximumCount)
- Access attached files via attachedFiles array (FileInfo interface)
- Handle attachment lifecycle events (beforeAttachmentUpload, attachmentUploadSuccess, attachmentUploadFailure, attachmentRemoved)
- Validate files before upload
- Initialize prompts with pre-attached files
- Handle server-side file processing
- Custom attachment templates (attachmentTemplate)
Custom Views
📄 Read: references/custom-views.md
- Create multiple views (Assist and Custom types)
- Set view names and icons
- Define view-specific templates
- Configure activeView property to set initial view
- Switch between views programmatically
- Persist active view across sessions
- Conditionally set initial view based on user role or state
- Display side-by-side content panels
- Use cases for multi-view layouts
Templating System
📄 Read: references/templating-system.md
- Customize banner templates (welcome content)
- Create prompt item templates (user message display)
- Design response item templates (AI response display)
- Build suggestion item templates
- Create custom footer templates
- Access template context data
AI Service Integration
📄 Read: references/ai-integration-setup.md
- Integrate with Azure OpenAI, OpenAI, Gemini, Claude
- Configure API credentials and authentication
- Handle real-time prompt processing
- Stream responses for live typing effects
- Parse markdown responses with marked library
- Error handling and rate limiting
- Security considerations for API keys
Generative UI
📄 Read: references/generative-ui.md
- Register custom tools with registerToolUI() method
- Configure tool templates and handlers for rendering
- Add interactive elements (charts, cards, custom tools) via blocks property
- Render multiple tools within single AI response
- Configure AI system prompts for structured JSON generation
- AI service integration with generative UI blocks
Speech Capabilities
📄 Read: references/speech-capabilities.md
- Enable Speech-to-Text (voice input)
- Configure speech recognition language
- Handle interim transcripts while speaking
- Implement Text-to-Speech (voice output) via Web Speech API
- Convert AI responses to spoken audio
- Customize TTS with textToSpeechSettings (language, speechPitch, speechRate, volume, voice)
- Customize button labels and icons
- Handle speech events (start, stop, transcript, error)
- Browser compatibility notes
Chain of Thoughts
📄 Read: references/chain-of-thoughts.md
- Visualize AI reasoning process with thinking blocks
- Configure thinking blocks with stages and status updates
- Add multi-stage reasoning workflows (completed, inprogress, failed)
- Customize thinking block templates
- Add inline context items with badges and tooltips
- Handle editableContextClicked events for interactive context
- Configure stage-level item templates
- Stream thinking blocks for real-time reasoning visualization
Methods and APIs
📄 Read: references/methods-and-apis.md
- Use addPromptResponse() method
- Execute prompts dynamically with executePrompt()
- Scroll to bottom programmatically
- Access component instance via refs
- Manage component state
- Common patterns and gotchas
Quick Start Example
import { AIAssistViewComponent, PromptRequestEventArgs } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from "react-dom";
function App() {
const assistInstance = React.useRef<AIAssistViewComponent>(null);
const PromptRequestEventArgs) => {
setTimeout(() => {
let defaultResponse = 'For real-time AI processing, connect to your preferred service (OpenAI, Azure OpenAI, etc.).';
assistInstance.current.addPromptResponse(defaultResponse);
}, 1000);
};
return (
<AIAssistViewComponent
id="aiAssistView"
ref={assistInstance}
promptRequest={onPromptRequest}
prompt={'Welcome! How can I help?'}
promptSuggestions={['Ask about features', 'Get started guide']}
/>
);
}
ReactDOM.render(<App />, document.getElementById('container'));
Common Patterns
Pattern 1: Basic Chat with Suggestions
Create a simple conversational interface with predefined suggestions:
- Enable prompt suggestions to guide user interactions
- Handle promptRequest event with simple responses
- Display conversation history automatically
Pattern 2: AI Service Integration
Connect to real AI services for intelligent responses:
- Use promptRequest event to capture user input
- Call AI API with prompt text
- Stream response character-by-character for live effect
- Parse markdown responses for formatted output
Pattern 3: Multi-View Dashboard
Combine chat with supporting content:
- Create Assist view for conversation
- Add Custom view for settings/sidebar
- Switch activeView based on user interaction
- Share data between views
Pattern 4: Voice-Enabled Chat
Enable hands-free interaction with speech:
- Enable speechToTextSettings to capture voice
- Configure Text-to-Speech for response audio
- Use toolbar for voice control buttons
- Handle speech events for status feedback
Pattern 5: File-Attached Prompts
Support file uploads with prompts:
- Enable attachments with enableAttachments property
- Configure attachment endpoints and file restrictions
- Include file data in prompt context
- Send files to backend API
Pattern 6: Chain of Thoughts Reasoning
Visualize AI's step-by-step reasoning process:
- Inject AssistThinking module for thinking block support
- Create thinking blocks with multiple reasoning stages
- Use status updates (completed, inprogress, failed) for real-time progress
- Stream thinking blocks alongside text responses
- Add context items to highlight referenced tools or files
- Customize block and stage templates for branded styling
Key Props & Configuration
Essential Props
promptRequest: Event handler when user submits prompt
prompt: Initial/default text in prompt input
promptPlaceholder: Placeholder text for input area
promptSuggestions: Array of suggested prompts
prompts: Pre-configured conversation data
Customization Props
promptIconCss: CSS class for user avatar
responseIconCss: CSS class for AI avatar
showClearButton: Show/hide clear button (default: false)
showHeader: Show/hide component header (default: true)
enableScrollToBottom: Show scroll-to-bottom button (default: true)
height: Component height (string | number, default: '100%')
width: Component width (string | number, default: '100%')
cssClass: Custom CSS classes for styling
activeView: Currently displayed view index (number, default: 0)
Template Props
bannerTemplate: Welcome banner content
promptItemTemplate: User message display
responseItemTemplate: AI response display
promptSuggestionItemTemplate: Suggestion styling
footerTemplate: Custom prompt input area
Advanced Props
enableAttachments: Enable file uploads (default: false)
attachmentSettings: File upload configuration
speechToTextSettings: Voice input configuration
textToSpeechSettings: Text-to-speech configuration
toolbarSettings: Header toolbar configuration
footerToolbarSettings: Footer toolbar configuration
responseToolbarSettings: Response action toolbar
promptToolbarSettings: Prompt toolbar configuration
blockTemplate: Custom template for thinking blocks and other response blocks
itemTemplate: Custom template for individual stages within thinking blocks
locale: Localization/globalization setting (default: 'en-US')
enableRtl: Enable right-to-left rendering (default: false)
enablePersistence: Enable state persistence (default: false)
Generative UI Props
blocks: Array of response blocks (TextBlock, ToolBlock, ThinkingBlock) to render dynamic UI elements within responses
registerToolUI(): Public method to register custom tool templates for rendering interactive components (charts, cards, custom tools) within AI responses
Event Props
created: Component lifecycle event
promptRequest: Prompt submission event
promptChanged: Prompt text change event
stopRespondingClick: Stop button click event
beforeAttachmentUpload: Before file upload event
attachmentUploadSuccess: File upload success event
attachmentUploadFailure: File upload failure event
attachmentRemoved: File removal event
editableContextClicked: Fires when user clicks an inline context item in thinking blocks
Common Use Cases
Chat Bot with AI Integration
Build a customer service chatbot connected to OpenAI or Azure services:
- Set up component with suggestions
- Handle promptRequest to send to AI API
- Stream responses for real-time feedback
- Use templates for branded appearance
Voice-Enabled Assistant
Create hands-free voice interaction:
- Enable speechToTextSettings
- Configure Text-to-Speech toolbar button
- Handle speech events for status
- Provide visual feedback during voice capture
File Analysis Chat
Allow users to upload and discuss files:
- Enable attachments
- Configure file restrictions (type, size, count)
- Send files with prompts to backend
- Display file information in conversation
Multi-Feature Dashboard
Combine chat with settings and content:
- Create multiple views (Assist + Custom)
- Use templates for custom view content
- Implement view switching logic
- Share conversation state between views
Thinking-Enabled Reasoning Assistant
Showcase AI's reasoning process for complex tasks:
- Inject AssistThinking module for thinking block support
- Configure thinking blocks with multiple stages
- Stream blocks with status updates (inprogress → completed)
- Add context items (tools, files, search results) within stages
- Customize block templates for transparent reasoning display
- Handle editableContextClicked for interactive exploration
Generative UI with Dynamic Interactive Tools
Render dynamic interactive components and custom tools within AI responses:
- Register custom tools (charts, cards, forms) using registerToolUI()
- Configure tool templates for responsive UI rendering
- Define blocks array with TextBlock and ToolBlock combinations
- Configure AI system prompt for structured JSON generation
- Send tool blocks within addPromptResponse() calls
- Create rich, interactive experiences with AI-generated UI elements
1---2name: syncfusion-react-ai-assistview3description: Implement the Syncfusion React AI AssistView component. Use this skill to handle AI-powered conversational interfaces, AssistView setup, conversation flow, speech input or output, file attachments, UI customization, state management, chain of thoughts reasoning visualization, generative UI with dynamic tools, and AI service integration such as OpenAI or Azure AI in React applications.4---5
6# Syncfusion React AI AssistView Component
7
8## Component Overview
9
10The **Syncfusion React AI AssistView** component is a comprehensive interactive chat component designed for building AI-powered conversational interfaces. It provides:
11
12### Core Capabilities
13- **Prompt-Response Management**: Manage conversation history with automatic data collection
14- **Real-time Streaming**: Stream AI responses character-by-character for live typing effects
15- **Chain of Thoughts**: Visualize AI reasoning process through thinking blocks with multi-stage workflow support
16- **Template System**: Customize every UI element (banners, prompt items, responses, suggestions, footer)
17- **Multi-View Support**: Switch between conversation assist view and custom content views
18- **Voice Integration**: Built-in Speech-to-Text (voice input) and Text-to-Speech (voice output)
19- **File Attachments**: Upload and include files with prompts
20- **Advanced Toolbars**: Configurable toolbars for header, footer, responses, and prompts
21- **AI Service Integration**: Direct integration with OpenAI, Azure OpenAI, and other AI services
22- **Event-Driven Architecture**: Hooks for prompt submission, changes, and component lifecycle
23
24### Key Features
25- **Markdown Support**: Render AI responses as formatted HTML via markdown parsing
26- **Conversation History**: Automatic tracking of all prompts and responses
27- **Suggestion System**: Display helpful prompt suggestions to guide users
28- **Avatar Customization**: Customize user and AI icons/avatars
29- **Scroll Management**: Auto-scroll or manual scroll-to-bottom button
30- **Clear Functionality**: Clear current prompt or entire conversation
31- **Regenerate Responses**: Request alternative AI responses for existing prompts without resubmitting queries
32- **Responsive Design**: Works on desktop and mobile with responsive layouts
33
34## Documentation and Navigation Guide
35
36### Getting Started
37📄 **Read:** [references/getting-started.md](references/getting-started.md)
38- Install @syncfusion/ej2-react-interactive-chat package
39- Add CSS theme imports
40- Create basic component initialization
41- Render component to DOM
42- First working functional component example
43
44### Configuration Essentials
45📄 **Read:** [references/configuration-essentials.md](references/configuration-essentials.md)
46- Set initial prompt text and placeholders
47- Configure prompt suggestions and suggestion headers
48- Customize user and AI avatar icons
49- Control clear button visibility
50- Enable/disable scroll-to-bottom functionality
51- Manage component instance via refs
52- **Set component dimensions (height and width)**
53- **Apply custom CSS classes for styling**
54- **Control header visibility**
55- **Configure globalization (locale, RTL support)**
56- **Enable state persistence across sessions**
57
58### Conversation Management
59📄 **Read:** [references/conversation-management.md](references/conversation-management.md)
60- Initialize with pre-configured conversation data
61- Add responses (string or object format)
62- Access and manage conversation history
63- Work with PromptModel data structure
64- Render markdown in responses
65- Persist and restore conversations
66
67### Events and Interactions
68📄 **Read:** [references/events-and-interactions.md](references/events-and-interactions.md)
69- Handle component lifecycle (created event)
70- Respond to prompt submissions (promptRequest event)
71- Track prompt text changes (promptChanged event)
72- **Access detailed event arguments (PromptChangedEventArgs, PromptRequestEventArgs)**
73- **Cancel prompt submissions programmatically**
74- **Handle stop responding events for long operations**
75- **Modify suggestions and toolbar items dynamically**
76- Implement event-driven workflows
77- Integrate with AI services via event handlers
78
79### Toolbar Customization
80📄 **Read:** [references/toolbar-customization.md](references/toolbar-customization.md)
81- Configure four toolbar types (header, footer, response, prompt)
82- Add custom toolbar items
83- Control toolbar positioning (Inline vs Bottom)
84- Customize toolbar icons
85- Handle item click events
86- **Configure all ToolbarItemModel properties (align, cssClass, disabled, tabIndex, template, type, visible)**
87- **Create custom toolbar item templates**
88- **Control item visibility and enabled state dynamically**
89- **Set tab order for keyboard navigation**
90- Manage attachment button behavior
91- **Enable regenerate responses functionality for multiple AI-generated responses**
92- **Navigate between regenerated responses with previous/next buttons**
93
94### File Attachments
95📄 **Read:** [references/file-attachments.md](references/file-attachments.md)
96- Enable file attachment support
97- Configure upload endpoints (saveUrl, removeUrl)
98- Restrict file types (allowedFileType)
99- Set file size limits (maxFileSize)
100- Limit number of attachments (maximumCount)
101- **Access attached files via attachedFiles array (FileInfo interface)**
102- **Handle attachment lifecycle events (beforeAttachmentUpload, attachmentUploadSuccess, attachmentUploadFailure, attachmentRemoved)**
103- **Validate files before upload**
104- **Initialize prompts with pre-attached files**
105- Handle server-side file processing
106- Custom attachment templates (attachmentTemplate)
107
108### Custom Views
109📄 **Read:** [references/custom-views.md](references/custom-views.md)
110- Create multiple views (Assist and Custom types)
111- Set view names and icons
112- Define view-specific templates
113- **Configure activeView property to set initial view**
114- **Switch between views programmatically**
115- **Persist active view across sessions**
116- **Conditionally set initial view based on user role or state**
117- Display side-by-side content panels
118- Use cases for multi-view layouts
119
120### Templating System
121📄 **Read:** [references/templating-system.md](references/templating-system.md)
122- Customize banner templates (welcome content)
123- Create prompt item templates (user message display)
124- Design response item templates (AI response display)
125- Build suggestion item templates
126- Create custom footer templates
127- Access template context data
128
129### AI Service Integration
130📄 **Read:** [references/ai-integration-setup.md](references/ai-integration-setup.md)
131- Integrate with Azure OpenAI, OpenAI, Gemini, Claude
132- Configure API credentials and authentication
133- Handle real-time prompt processing
134- Stream responses for live typing effects
135- Parse markdown responses with marked library
136- Error handling and rate limiting
137- Security considerations for API keys
138
139### Generative UI
140📄 **Read:** [references/generative-ui.md](references/generative-ui.md)
141- **Register custom tools with registerToolUI() method**
142- **Configure tool templates and handlers for rendering**
143- **Add interactive elements (charts, cards, custom tools) via blocks property**
144- **Render multiple tools within single AI response**
145- **Configure AI system prompts for structured JSON generation**
146- **AI service integration with generative UI blocks**
147
148### Speech Capabilities
149📄 **Read:** [references/speech-capabilities.md](references/speech-capabilities.md)
150- Enable Speech-to-Text (voice input)
151- Configure speech recognition language
152- Handle interim transcripts while speaking
153- Implement Text-to-Speech (voice output) via Web Speech API
154- **Convert AI responses to spoken audio**
155- **Customize TTS with textToSpeechSettings (language, speechPitch, speechRate, volume, voice)**
156- Customize button labels and icons
157- Handle speech events (start, stop, transcript, error)
158- Browser compatibility notes
159
160### Chain of Thoughts
161📄 **Read:** [references/chain-of-thoughts.md](references/chain-of-thoughts.md)
162- **Visualize AI reasoning process with thinking blocks**
163- **Configure thinking blocks with stages and status updates**
164- **Add multi-stage reasoning workflows (completed, inprogress, failed)**
165- **Customize thinking block templates**
166- **Add inline context items with badges and tooltips**
167- **Handle editableContextClicked events for interactive context**
168- **Configure stage-level item templates**
169- Stream thinking blocks for real-time reasoning visualization
170
171### Methods and APIs
172📄 **Read:** [references/methods-and-apis.md](references/methods-and-apis.md)
173- Use addPromptResponse() method
174- Execute prompts dynamically with executePrompt()
175- Scroll to bottom programmatically
176- Access component instance via refs
177- Manage component state
178- Common patterns and gotchas
179
180---
181
182## Quick Start Example
183
184```tsx
185import { AIAssistViewComponent, PromptRequestEventArgs } from '@syncfusion/ej2-react-interactive-chat';
186import * as React from 'react';
187import * as ReactDOM from "react-dom";
188
189function App() {
190 const assistInstance = React.useRef<AIAssistViewComponent>(null);
191
192 const onPromptRequest = (args: PromptRequestEventArgs) => {
193 setTimeout(() => {
194 let defaultResponse = 'For real-time AI processing, connect to your preferred service (OpenAI, Azure OpenAI, etc.).';
195 assistInstance.current.addPromptResponse(defaultResponse);
196 }, 1000);
197 };
198
199 return (
200 <AIAssistViewComponent
201 id="aiAssistView"
202 ref={assistInstance}
203 promptRequest={onPromptRequest}
204 prompt={'Welcome! How can I help?'}
205 promptSuggestions={['Ask about features', 'Get started guide']}
206 />
207 );
208}
209
210ReactDOM.render(<App />, document.getElementById('container'));
211```
212
213---
214
215## Common Patterns
216
217### Pattern 1: Basic Chat with Suggestions
218Create a simple conversational interface with predefined suggestions:
219- Enable prompt suggestions to guide user interactions
220- Handle promptRequest event with simple responses
221- Display conversation history automatically
222
223### Pattern 2: AI Service Integration
224Connect to real AI services for intelligent responses:
225- Use promptRequest event to capture user input
226- Call AI API with prompt text
227- Stream response character-by-character for live effect
228- Parse markdown responses for formatted output
229
230### Pattern 3: Multi-View Dashboard
231Combine chat with supporting content:
232- Create Assist view for conversation
233- Add Custom view for settings/sidebar
234- Switch activeView based on user interaction
235- Share data between views
236
237### Pattern 4: Voice-Enabled Chat
238Enable hands-free interaction with speech:
239- Enable speechToTextSettings to capture voice
240- Configure Text-to-Speech for response audio
241- Use toolbar for voice control buttons
242- Handle speech events for status feedback
243
244### Pattern 5: File-Attached Prompts
245Support file uploads with prompts:
246- Enable attachments with enableAttachments property
247- Configure attachment endpoints and file restrictions
248- Include file data in prompt context
249- Send files to backend API
250
251### Pattern 6: Chain of Thoughts Reasoning
252Visualize AI's step-by-step reasoning process:
253- Inject AssistThinking module for thinking block support
254- Create thinking blocks with multiple reasoning stages
255- Use status updates (completed, inprogress, failed) for real-time progress
256- Stream thinking blocks alongside text responses
257- Add context items to highlight referenced tools or files
258- Customize block and stage templates for branded styling
259
260---
261
262## Key Props & Configuration
263
264### Essential Props
265- `promptRequest`: Event handler when user submits prompt
266- `prompt`: Initial/default text in prompt input
267- `promptPlaceholder`: Placeholder text for input area
268- `promptSuggestions`: Array of suggested prompts
269- `prompts`: Pre-configured conversation data
270
271### Customization Props
272- `promptIconCss`: CSS class for user avatar
273- `responseIconCss`: CSS class for AI avatar
274- `showClearButton`: Show/hide clear button (default: false)
275- `showHeader`: Show/hide component header (default: true)
276- `enableScrollToBottom`: Show scroll-to-bottom button (default: true)
277- `height`: Component height (string | number, default: '100%')
278- `width`: Component width (string | number, default: '100%')
279- `cssClass`: Custom CSS classes for styling
280- `activeView`: Currently displayed view index (number, default: 0)
281
282### Template Props
283- `bannerTemplate`: Welcome banner content
284- `promptItemTemplate`: User message display
285- `responseItemTemplate`: AI response display
286- `promptSuggestionItemTemplate`: Suggestion styling
287- `footerTemplate`: Custom prompt input area
288
289### Advanced Props
290- `enableAttachments`: Enable file uploads (default: false)
291- `attachmentSettings`: File upload configuration
292- `speechToTextSettings`: Voice input configuration
293- `textToSpeechSettings`: Text-to-speech configuration
294- `toolbarSettings`: Header toolbar configuration
295- `footerToolbarSettings`: Footer toolbar configuration
296- `responseToolbarSettings`: Response action toolbar
297- `promptToolbarSettings`: Prompt toolbar configuration
298- `blockTemplate`: Custom template for thinking blocks and other response blocks
299- `itemTemplate`: Custom template for individual stages within thinking blocks
300- `locale`: Localization/globalization setting (default: 'en-US')
301- `enableRtl`: Enable right-to-left rendering (default: false)
302- `enablePersistence`: Enable state persistence (default: false)
303
304### Generative UI Props
305- **`blocks`**: Array of response blocks (TextBlock, ToolBlock, ThinkingBlock) to render dynamic UI elements within responses
306- **`registerToolUI()`**: Public method to register custom tool templates for rendering interactive components (charts, cards, custom tools) within AI responses
307
308### Event Props
309- `created`: Component lifecycle event
310- `promptRequest`: Prompt submission event
311- `promptChanged`: Prompt text change event
312- `stopRespondingClick`: Stop button click event
313- `beforeAttachmentUpload`: Before file upload event
314- `attachmentUploadSuccess`: File upload success event
315- `attachmentUploadFailure`: File upload failure event
316- `attachmentRemoved`: File removal event
317- `editableContextClicked`: Fires when user clicks an inline context item in thinking blocks
318
319---
320
321## Common Use Cases
322
323### Chat Bot with AI Integration
324Build a customer service chatbot connected to OpenAI or Azure services:
3251. Set up component with suggestions
3262. Handle promptRequest to send to AI API
3273. Stream responses for real-time feedback
3284. Use templates for branded appearance
329
330### Voice-Enabled Assistant
331Create hands-free voice interaction:
3321. Enable speechToTextSettings
3332. Configure Text-to-Speech toolbar button
3343. Handle speech events for status
3354. Provide visual feedback during voice capture
336
337### File Analysis Chat
338Allow users to upload and discuss files:
3391. Enable attachments
3402. Configure file restrictions (type, size, count)
3413. Send files with prompts to backend
3424. Display file information in conversation
343
344### Multi-Feature Dashboard
345Combine chat with settings and content:
3461. Create multiple views (Assist + Custom)
3472. Use templates for custom view content
3483. Implement view switching logic
3494. Share conversation state between views
350
351### Thinking-Enabled Reasoning Assistant
352Showcase AI's reasoning process for complex tasks:
3531. Inject AssistThinking module for thinking block support
3542. Configure thinking blocks with multiple stages
3553. Stream blocks with status updates (inprogress → completed)
3564. Add context items (tools, files, search results) within stages
3575. Customize block templates for transparent reasoning display
3586. Handle editableContextClicked for interactive exploration
359
360### Generative UI with Dynamic Interactive Tools
361Render dynamic interactive components and custom tools within AI responses:
3621. Register custom tools (charts, cards, forms) using registerToolUI()
3632. Configure tool templates for responsive UI rendering
3643. Define blocks array with TextBlock and ToolBlock combinations
3654. Configure AI system prompt for structured JSON generation
3665. Send tool blocks within addPromptResponse() calls
3676. Create rich, interactive experiences with AI-generated UI elements
368
369---