Ai
configurationDefines the configuration options for the AI tools in the Grid.
ai
Object<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" },
{ command: "destroy" }
],
dataSource: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
],
toolbar: ["aiAssistant"],
filterable: true,
columnMenu: {
componentType: "modern"
},
ai: {
service: "https://demos.telerik.com/service/v2/ai/grid/smart-state"
},
height: 550
});
</script>
ai.aiAssistant
ObjectDefines the configuration options for the AI Assistant tool in the Grid.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "ProductName" },
{ field: "UnitPrice" },
{ field: "UnitsInStock" }
],
dataSource: {
transport: {
read: {
url: "https://demos.telerik.com/service/v2/core/detailproducts",
},
},
pageSize: 5
},
sortable: true,
toolbar: ["aiAssistant"],
ai: {
aiAssistant: {
promptSuggestions: ["Show me the most expensive products",],
},
service: "https://demos.telerik.com/service/v2/ai/grid/smart-state"
}
});
</script>
ai.aiAssistantWindow
ObjectDefines the configuration options for the AI AssistantWindow in the Grid.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [{ field: "productName" }, { field: "unitPrice" }],
dataSource: [{ productName: "Coffee", unitPrice: 12.99 }],
toolbar: ["aiAssistant"],
ai: {
aiAssistantWindow: {
promptRequestCancel: (e) => {
console.log("Request canceled!");
}
},
service: "https://demos.telerik.com/service/v2/ai/grid/smart-state"
}
});
</script>
ai.autoClose
BooleanConfigures if the AI Assistant Window should remain visible after the response.
Default: true
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [{ field: "name" }],
dataSource: [{ name: "Jane Doe" }],
toolbar: ["aiAssistant"],
ai: {
autoClose: false,
service: {
url: "https://demos.telerik.com/service/v2/ai/grid/smart-state",
outputGetter: function(response) {
return response.messages.join("---");
}
}
}
});
</script>
ai.keepOutputHistory
BooleanConfigures if the AI Assistant output should be cleared after closing.
Default: false
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [{ field: "name" }],
dataSource: [{ name: "Jane Doe" }],
toolbar: ["aiAssistant"],
ai: {
autoClose: true,
keepOutputHistory: false,
service: {
url: "https://demos.telerik.com/service/v2/ai/grid/smart-state",
outputGetter: function(response) {
return response.messages.join("---");
}
}
}
});
</script>
ai.service
String|ObjectThe URL or the configuration of the AI service to use for generating outputs.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [{ field: "name" }],
dataSource: [{ name: "Jane Doe" }],
toolbar: ["aiAssistant"],
ai: {
service: "https://demos.telerik.com/service/v2/ai/grid/smart-state"
}
});
</script>
Related Members
- ai.service - The URL or the configuration of the AI service to use for generating outputs.
- ai.aiAssistant - Defines the configuration options for the AI Assistant tool in the Grid.
- ai.aiAssistant.promptOutputs - An array of prompt outputs to display in the AI Assistant output view.
- ai.aiAssistant.speechToText - Configures speech-to-text functionality for the AI Assistant prompt input.
- ai.aiAssistant.promptTextArea - Configuration options for the TextArea component used in the AI Assistant prompt view.
- ai.aiAssistant.promptTextArea.label - Specifies the label configuration for the textarea.
- ai.aiAssistant.outputActions - An array of action configurations for the output cards in the AI Assistant.
- ai.aiAssistant.toolbarItems - An array of toolbar items to display in the AI Assistant header toolbar.
- ai.aiAssistant.views - An array of view configurations for the AI Assistant.
- ai.aiAssistant.views.promptCommands - The commands to display in the prompt view.
- ai.aiAssistant.messages - The text messages displayed in the AI Assistant. Use this option to customize or localize the messages.
- ai.aiAssistantWindow - Defines the configuration options for the AI AssistantWindow in the Grid.
- ai.aiAssistantWindow.animation - A collection of {Animation} objects that is used to change the default animations for the AI AssistantWindow. When set to false, all animations will be disabled.
- ai.aiAssistantWindow.animation.close - The animation that will be used when the AI AssistantWindow closes.
- ai.aiAssistantWindow.animation.open - The animation that will be used when the AI AssistantWindow opens.
- ai.aiAssistantWindow.draggable - Enables (true) or disables (false) the dragging of the AI AssistantWindow.
- ai.aiAssistantWindow.modal - Specifies whether the AI AssistantWindow will display a modal overlay over the page.
- ai.aiAssistantWindow.position - A collection of one or two members which define the initial top and/or left position of the AI AssistantWindow.
- ai.aiAssistantWindow.title - The text in the title bar of the AI AssistantWindow. If set to false, the AI AssistantWindow will be displayed without a title bar.
- ai.aiAssistantWindow.content - Specifies a URL or request options from where the AI Assistant Window will load its content.