UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

43 lines (42 loc) 1.3 kB
/** * DevExtreme (cjs/__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/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExecuteGridAssistantCommand = void 0; var _base = require("../../../core/ai_integration/commands/base"); class ExecuteGridAssistantCommand extends _base.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 } } } exports.ExecuteGridAssistantCommand = ExecuteGridAssistantCommand;