-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Grids AI Assistant: Add API Descriptions Part 2 #8767
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 17 commits into
DevExpress:26_1
from
arman-boyakhchyan:grids-ai-assistant-api-part-2-26-1
May 29, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
71f8377
Grids AI Assistant: Add API Descriptions Part 2
arman-boyakhchyan 6229fdd
Add Initial Fixes
arman-boyakhchyan 6ba4f7e
Add Minor Type Fix
arman-boyakhchyan 91938b7
Add Type Links
arman-boyakhchyan ac898f3
Add Minor Code & Text Fixes
arman-boyakhchyan c775071
Update Following Feedback
arman-boyakhchyan b13ce10
Add Moved additionalInfo Desc.
arman-boyakhchyan 14575ae
Add additionalInfo Desc. to onAIAssistantRequestCreating
arman-boyakhchyan 4099ff1
Add Demo Link
arman-boyakhchyan 4bd320a
Update Demo Button Text
arman-boyakhchyan 9bab617
Update aiIntegration Description & Add Demo Links
arman-boyakhchyan d4551ef
Apply suggestions from code review
arman-boyakhchyan 4b85ab1
Synchronize Updates
arman-boyakhchyan 746d425
Update Contractions
arman-boyakhchyan f65a277
Apply suggestions from code review
arman-boyakhchyan a82fcab
Synchronize Edits
arman-boyakhchyan cdd7db9
Apply suggestions from code review
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
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
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
3 changes: 2 additions & 1 deletion
3
...dxDataGrid/1 Configuration/aiAssistant.md → ... Configuration/aiAssistant/aiAssistant.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 |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| --- | ||
| id: dxDataGrid.Options.aiAssistant | ||
| type: AIAssistant | ||
| inheritsType: AIAssistant | ||
| --- | ||
| --- | ||
| ##### shortDescription | ||
| <!-- Description goes here --> | ||
| Configures the {WidgetName} AI Assistant. | ||
|
|
||
| --- | ||
| <!-- Description goes here --> |
145 changes: 145 additions & 0 deletions
145
...0 UI Components/dxDataGrid/1 Configuration/aiAssistant/customizeResponseText.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,145 @@ | ||
| --- | ||
| id: dxDataGrid.Options.aiAssistant.customizeResponseText | ||
| type: function(command) | ||
| --- | ||
| --- | ||
| ##### shortDescription | ||
| Customizes AI Assistant response messages for each command. | ||
|
|
||
| ##### param(command): DataGridCommandInfo | ||
| Information about the command. | ||
|
|
||
| ##### return: ResponseStatusTexts | ||
| Custom messages for **success** and **failure** responses. | ||
|
|
||
| --- | ||
| **customizeResponseText** is called for each command. Use this function to customize response messages for AI Assistant commands. The chat displays these messages below the response title. If a response includes multiple commands, the chat displays each message on a separate line. | ||
|
|
||
| When a command succeeds, the AI Assistant chat displays the response in green and prefixes the text with a checkmark button emoji (✅). When a command fails, the AI Assistant chat displays the response in red and prefixes the text with a cross mark emoji (❌). | ||
|
|
||
| The **command** parameter contains the following fields: | ||
|
|
||
| - **name**: The command's name ([DataGridPredefinedCommandNames]({basewidgetpath}/Types/DataGridPredefinedCommandNames/)). | ||
| - **args**: Command arguments. Refer to [DataGridPredefinedCommands]({basewidgetpath}/Types/DataGridPredefinedCommands/) for information about the arguments of each available command. | ||
|
|
||
| Configure **customizeResponseText** to return an object with the following fields: | ||
|
|
||
| - **success**: Text to display when the command succeeds. | ||
| - **failure**: Text to display when the command fails. | ||
|
|
||
| If you do not specify any of these fields, the AI Assistant chat displays the default message. | ||
|
|
||
| You can use this function to localize response text. The following code snippet uses the [locale()](/Documentation/ApiReference/Common/Utils/localization/#locale) method to specify text for multiple locales: | ||
|
|
||
| --- | ||
|
|
||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| const currentLocale = DevExpress.localization.locale(); | ||
|
|
||
| $('#{widget-name}-container').dx{WidgetName}({ | ||
| aiAssistant: { | ||
| customizeResponseText(command) { | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
| switch (currentLocale) { | ||
| case 'en': | ||
| return { | ||
| success: `Command succeeded: ${command.name}`, | ||
| failure: `Command failed: ${command.name}`, | ||
| }; | ||
| case 'fr': | ||
| return { /* Translated texts */ }; | ||
| } | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.html --> | ||
| <dx-{widget-name}> | ||
| <dxo-{widget-name}-ai-assistant | ||
| [enabled]="true" | ||
| [customizeResponseText]="customizeResponseText" | ||
| ></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"; | ||
|
|
||
| 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 */ }; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <template> | ||
| <Dx{WidgetName}> | ||
| <DxAIAssistant | ||
| :customize-response-text="customizeResponseText" | ||
|
arman-boyakhchyan marked this conversation as resolved.
|
||
| /> | ||
| </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 */ }; | ||
| } | ||
| }; | ||
| </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 App() { | ||
| return ( | ||
| <{WidgetName}> | ||
| <AIAssistant | ||
| enabled={true} | ||
| customizeResponseText={customizeResponseText} | ||
| /> | ||
| </{WidgetName}> | ||
| ); | ||
| }; | ||
|
|
||
| --- | ||
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.