devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
39 lines (38 loc) • 1.11 kB
JavaScript
/**
* DevExtreme (esm/__internal/core/ai_integration/commands/executeGridAssistant.js)
* Version: 26.1.3
* Build date: Wed Jun 10 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
BaseCommand
} from "../../../core/ai_integration/commands/base";
export class ExecuteGridAssistantCommand extends BaseCommand {
getTemplateName() {
return "executeGridAssistant"
}
buildPromptData(params) {
return {
user: {
text: params.text,
context: JSON.stringify(params.context)
}
}
}
parseResult(response) {
if ("string" === typeof response) {
if ("" === response) {
return {
actions: []
}
}
return JSON.parse(response)
}
const actions = "string" === typeof response.actions ? JSON.parse(response.actions) : response.actions;
return {
actions: actions
}
}
}