-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Grids AI Assistant: Add How-To Topics #8819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arman-boyakhchyan
merged 10 commits into
DevExpress:26_1
from
arman-boyakhchyan:grids-ai-assistant-how-to-26-1
Jun 5, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4657cfd
Grids AI Assistant: Add How-To Topics
arman-boyakhchyan 5ea1608
Add Minor Fixes
arman-boyakhchyan b2504f9
Update TreeList Recommendation
arman-boyakhchyan 621129f
Update Specifics
arman-boyakhchyan 54f1e76
Remove CTP Tags & Notes
arman-boyakhchyan 84a010f
Merge branch '26_1' of https://github.com/DevExpress/devextreme-docum…
arman-boyakhchyan e85e270
Apply suggestions from code review
arman-boyakhchyan 6c32e72
Remove Security Note
arman-boyakhchyan e9bb547
Apply suggestions from code review
arman-boyakhchyan fefa68c
Synchronize Final Edits
arman-boyakhchyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
concepts/05 UI Components/DataGrid/12 AI Assistant/00 AI Assistant.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| The {WidgetName} AI Assistant allows you to use natural language to interact with the component. | ||
|
|
||
| You can use and configure the following {WidgetName} capabilities via AI Assistant Chat prompts: | ||
|
|
||
| - [Filter Rows and Search for Text/Values](/Documentation/Guide/UI_Components/DataGrid/Filtering_and_Searching/) | ||
| - [Sort Data](/Documentation/Guide/UI_Components/DataGrid/Sorting/) | ||
| - [Group Rows](/Documentation/Guide/UI_Components/DataGrid/Grouping/) | ||
| - [Navigate between Data Pages](/Documentation/Guide/UI_Components/DataGrid/Paging/) | ||
| - [Change Row Focus](/Documentation/Guide/UI_Components/DataGrid/Focused_Row/) | ||
| - [Select Rows](/Documentation/Guide/UI_Components/DataGrid/Selection/) | ||
| - [Calculate Summaries](/Documentation/Guide/UI_Components/DataGrid/Summaries/Predefined_Aggregate_Functions/) | ||
| - [Fix](/Documentation/Guide/UI_Components/DataGrid/Columns/Column_Fixing/), [Resize](/Documentation/Guide/UI_Components/DataGrid/Columns/Column_Sizing/), and [Reorder Columns](/Documentation/Guide/UI_Components/DataGrid/Columns/Column_Reordering/) | ||
|
|
||
| #include common-demobutton-named with { | ||
| url: "https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/AIAssistant/", | ||
| name: "DataGrid - AI Assistant" | ||
| } | ||
19 changes: 19 additions & 0 deletions
19
concepts/05 UI Components/DataGrid/12 AI Assistant/05 Configuration and Use.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| To activate the AI Assistant, configure the following properties: | ||
|
|
||
| - Specify [aiIntegration](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#aiIntegration) or **aiAssistant**.[aiIntegration](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#aiIntegration) | ||
| - Set **aiAssistant**.[enabled](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#enabled) to `true` | ||
|
|
||
| Once activated, {WidgetName} adds a predefined item (*"aiAssistantButton"*) to the component [toolbar](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/toolbar/). This button opens the AI Assistant chat in a pop-up window. | ||
|
|
||
| [note] | ||
|
|
||
| Ensure users can access the AI Assistant: | ||
|
|
||
| - Do not hide the {WidgetName} toolbar (do not set **toolbar**.[visible](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/toolbar/#visible) to `false`). | ||
| - If you define **toolbar**.[items[]](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/toolbar/items/), include *"aiAssistantButton"* in the array. | ||
|
|
||
| [/note] | ||
|
|
||
| You can specify [chat](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#chat) and [popup](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#popup) objects in **aiAssistant** to customize the assistant window. These objects support DevExtreme [Chat](/Documentation/ApiReference/UI_Components/dxChat/Configuration/) and [Popup](/Documentation/ApiReference/UI_Components/dxPopup/Configuration/) configuration and allow you to integrate options such as [Chat suggestions](/Documentation/ApiReference/UI_Components/dxChat/Configuration/#suggestions). | ||
|
|
||
| You can also define **aiAssistant**.[title](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#title) to specify a custom title for the AI Assistant popup. |
154 changes: 154 additions & 0 deletions
154
concepts/05 UI Components/DataGrid/12 AI Assistant/10 Response Customization.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| AI Assistant allows you to customize AI responses using the following callbacks: | ||
|
|
||
| - [customizeResponseTitle](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#customizeResponseTitle): Customizes response titles (first line in a response) | ||
| - [customizeResponseText](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/aiAssistant/#customizeResponseText): Customizes response messages (all lines below the title) | ||
|
|
||
| You can use these callbacks to localize responses. The following code snippet uses the [locale()](/Documentation/ApiReference/Common/Utils/localization/#locale) utility method to specify response messages and titles for multiple locales: | ||
|
|
||
| --- | ||
|
|
||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| const currentLocale = DevExpress.localization.locale(); | ||
|
|
||
| $('#{widget-name}-container').dx{WidgetName}({ | ||
| aiAssistant: { | ||
| customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }, | ||
| customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }, | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
| }, | ||
| }); | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.html --> | ||
| <dx-{widget-name}> | ||
| <dxo-{widget-name}-ai-assistant | ||
| [enabled]="true" | ||
| [customizeResponseText]="customizeResponseText" | ||
| [customizeResponseTitle]="customizeResponseTitle" | ||
| ></dxo-{widget-name}-ai-assistant> | ||
| </dx-{widget-name}> | ||
|
|
||
| <!-- tab: app.component.ts --> | ||
| import { Dx{WidgetName}Module, type Dx{WidgetName}Types } from 'devextreme-angular/ui/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
|
|
||
| export class AppComponent { | ||
| currentLocale = locale(); | ||
| customizeResponseText = (command) => { | ||
| switch (this.currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| customizeResponseTitle = (status, commandNames) => { | ||
| switch (this.currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <template> | ||
| <Dx{WidgetName}> | ||
| <DxAIAssistant | ||
| :customize-response-text="customizeResponseText" | ||
| :customize-response-title="customizeResponseTitle" | ||
| /> | ||
| </Dx{WidgetName}> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { Dx{WidgetName}, DxAIAssistant, type Dx{WidgetName}Types } from 'devextreme-vue/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
|
||
| const currentLocale = locale(); | ||
| function customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| function customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
| </script> | ||
|
|
||
| ##### React | ||
|
|
||
| <!-- tab: App.tsx --> | ||
| import { {WidgetName}, AIAssistant, type {WidgetName}Types } from 'devextreme-react/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
|
||
| const currentLocale = locale(); | ||
| function customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| function customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
|
|
||
| function App() { | ||
| return ( | ||
| <{WidgetName}> | ||
| <AIAssistant | ||
| enabled={true} | ||
| customizeResponseText={customizeResponseText} | ||
| customizeResponseTitle={customizeResponseTitle} | ||
| /> | ||
| </{WidgetName}> | ||
| ); | ||
| }; | ||
|
arman-boyakhchyan marked this conversation as resolved.
arman-boyakhchyan marked this conversation as resolved.
|
||
|
|
||
| --- | ||
16 changes: 16 additions & 0 deletions
16
...ts/05 UI Components/DataGrid/12 AI Assistant/15 Specifics and Best Practices.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| Note the following AI Assistant specifics and best practices: | ||||||
|
|
||||||
| - The assistant does not have access to component data by default. In some scenarios, this can cause commands to fail. | ||||||
|
arman-boyakhchyan marked this conversation as resolved.
|
||||||
|
|
||||||
| For instance, to select the last row on a [page](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/paging/), the assistant calls the `selectByIndexes` command and uses the page size to specify an index. If the number of rows on the active page is smaller than the page size, the command fails. | ||||||
|
|
||||||
| - AI Assistant may not preserve the results of executed commands of the same type. Specify if the AI should preserve or discard previous results in your requests (include keywords such as "also" or "only"). | ||||||
|
|
||||||
| - If {WidgetName} is bound to a large dataset, the `selectAll` command may increase the context size of requests beyond the limits of your AI service. The `selectAll` command adds all row keys to the request [context](/Documentation/ApiReference/UI_Components/dxDataGrid/Types/AIAssistantRequestCreatingEvent/#context) (in [onAIAssistantRequestCreating](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onAIAssistantRequestCreating)). To avoid this behavior, you can activate **selection**.[deferred](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/selection/#deferred). | ||||||
|
|
||||||
| - The assistant does not support certain actions that are only accessible in the component UI (for instance, it cannot expand/collapse groups). | ||||||
|
|
||||||
| - If you expect users to request certain commands in the AI Assistant, ensure the corresponding {WidgetName} feature is enabled to avoid command failures. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| #####See Also##### | ||||||
| - [DataGridPredefinedCommands](/Documentation/ApiReference/UI_Components/dxDataGrid/Types/DataGridPredefinedCommands/) | ||||||
10 changes: 10 additions & 0 deletions
10
concepts/05 UI Components/TreeList/07 AI Assistant/00 AI Assistant.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| The {WidgetName} AI Assistant allows you to use natural language to interact with the component. | ||
|
|
||
| You can use and configure the following {WidgetName} capabilities via AI Assistant Chat prompts: | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
|
|
||
| - [Filter Rows and Search for Text/Values](/Documentation/Guide/UI_Components/TreeList/Filtering_and_Searching/) | ||
| - [Sort Data](/Documentation/Guide/UI_Components/TreeList/Sorting/) | ||
| - [Navigate between Pages](/Documentation/Guide/UI_Components/TreeList/Paging/) | ||
| - [Change Row Focus](/Documentation/Guide/UI_Components/TreeList/Focused_Row/) | ||
| - [Select Rows](/Documentation/Guide/UI_Components/TreeList/Selection/) | ||
| - [Fix](/Documentation/Guide/UI_Components/TreeList/Columns/Column_Fixing/), [Resize](/Documentation/Guide/UI_Components/TreeList/Columns/Column_Sizing/), and [Reorder Columns](/Documentation/Guide/UI_Components/TreeList/Columns/Column_Reordering/) | ||
19 changes: 19 additions & 0 deletions
19
concepts/05 UI Components/TreeList/07 AI Assistant/05 Configuration and Use.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| To activate the AI Assistant, configure the following properties: | ||
|
|
||
| - Specify [aiIntegration](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/#aiIntegration) or **aiAssistant**.[aiIntegration](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#aiIntegration) | ||
| - Set **aiAssistant**.[enabled](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#enabled) to `true` | ||
|
|
||
| Once activated, {WidgetName} adds a predefined item (*"aiAssistantButton"*) to the component [toolbar](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/toolbar/). This button opens the AI Assistant chat in a pop-up window. | ||
|
|
||
| [note] | ||
|
|
||
| Ensure users can access the AI Assistant: | ||
|
|
||
| - Do not hide the {WidgetName} toolbar (do not set **toolbar**.[visible](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/toolbar/#visible) to `false`). | ||
| - If you define **toolbar**.[items[]](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/toolbar/items/), include *"aiAssistantButton"* in the array. | ||
|
|
||
| [/note] | ||
|
|
||
| You can specify [chat](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#chat) and [popup](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#popup) objects in **aiAssistant** to customize the assistant window. These objects support DevExtreme [Chat](/Documentation/ApiReference/UI_Components/dxChat/Configuration/) and [Popup](/Documentation/ApiReference/UI_Components/dxPopup/Configuration/) configuration and allow you to integrate options such as [Chat suggestions](/Documentation/ApiReference/UI_Components/dxChat/Configuration/#suggestions). | ||
|
|
||
| You can also define **aiAssistant**.[title](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#title) to specify a custom title for the AI Assistant popup. |
154 changes: 154 additions & 0 deletions
154
concepts/05 UI Components/TreeList/07 AI Assistant/10 Response Customization.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| AI Assistant allows you to customize AI responses using the following callbacks: | ||
|
|
||
| - [customizeResponseTitle](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#customizeResponseTitle): Customizes response titles (first line in a response) | ||
| - [customizeResponseText](/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/aiAssistant/#customizeResponseText): Customizes response messages (all lines below the title) | ||
|
|
||
| You can use these callbacks to localize responses. The following code snippet uses the [locale()](/Documentation/ApiReference/Common/Utils/localization/#locale) utility method to specify response messages and titles for multiple locales: | ||
|
|
||
| --- | ||
|
|
||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| const currentLocale = DevExpress.localization.locale(); | ||
|
|
||
| $('#{widget-name}-container').dx{WidgetName}({ | ||
| aiAssistant: { | ||
| customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }, | ||
| customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.html --> | ||
| <dx-{widget-name}> | ||
| <dxo-{widget-name}-ai-assistant | ||
| [enabled]="true" | ||
| [customizeResponseText]="customizeResponseText" | ||
| [customizeResponseTitle]="customizeResponseTitle" | ||
| ></dxo-{widget-name}-ai-assistant> | ||
| </dx-{widget-name}> | ||
|
|
||
| <!-- tab: app.component.ts --> | ||
| import { Dx{WidgetName}Module, type Dx{WidgetName}Types } from 'devextreme-angular/ui/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
|
|
||
| export class AppComponent { | ||
| currentLocale = locale(); | ||
| customizeResponseText = (command) => { | ||
| switch (this.currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| customizeResponseTitle = (status, commandNames) => { | ||
| switch (this.currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <template> | ||
| <Dx{WidgetName}> | ||
| <DxAIAssistant | ||
| :customize-response-text="customizeResponseText" | ||
| :customize-response-title="customizeResponseTitle" | ||
| /> | ||
| </Dx{WidgetName}> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { Dx{WidgetName}, DxAIAssistant, type Dx{WidgetName}Types } from 'devextreme-vue/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
|
||
| const currentLocale = locale(); | ||
| function customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| function customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
| </script> | ||
|
|
||
| ##### React | ||
|
|
||
| <!-- tab: App.tsx --> | ||
| import { {WidgetName}, AIAssistant, type {WidgetName}Types } from 'devextreme-react/{widget-name}'; | ||
| import { locale } from "devextreme/localization"; | ||
|
|
||
| const currentLocale = locale(); | ||
| function customizeResponseText(command) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }; | ||
| function customizeResponseTitle(status, commandNames) { | ||
| switch (currentLocale) { | ||
| case 'en': | ||
| return `${status.toUpperCase()}: ${commandNames.join(', ')}`; | ||
| case 'fr': | ||
| return /* Translated texts */; | ||
| } | ||
| }; | ||
|
|
||
| function App() { | ||
| return ( | ||
| <{WidgetName}> | ||
| <AIAssistant | ||
| enabled={true} | ||
| customizeResponseText={customizeResponseText} | ||
| customizeResponseTitle={customizeResponseTitle} | ||
| /> | ||
| </{WidgetName}> | ||
| ); | ||
| }; | ||
|
arman-boyakhchyan marked this conversation as resolved.
arman-boyakhchyan marked this conversation as resolved.
|
||
|
|
||
| --- | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.