smartBox.aiAssistantSettings.serviceString|Object
String value represents the URL to which the SmartBox tool sends the AI request. When you set this property, the SmartBox tool sends and handles an HTTP request to the provided URL. You can handle the smartBoxAIAssistantPromptRequest event to modify the request options before the tool sends it.
The object configuration enables the user to set specific headers configuration and send additional data with the AI request.
When service is not configured, the SmartBox tool does not send an HTTP request. You should handle the smartBoxAIAssistantPromptRequest event to send and handle a custom HTTP request.
Example - set service as URL string
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "ProductName" },
{ field: "UnitPrice" }
],
dataSource: {
data: [
{ ProductName: "Tea", UnitPrice: 10 },
{ ProductName: "Coffee", UnitPrice: 15 }
]
},
search: {
fields: [{ name: "ProductName", operator: "contains" }]
},
toolbar: ["smartBox"],
smartBox: {
activeMode: "AIAssistant",
aiAssistantSettings: {
enabled: true,
service: "https://demos.telerik.com/service/v2/ai/grid/smart-state"
}
}
});
</script>
Example - set service as object with headers
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "ProductName" },
{ field: "UnitPrice" }
],
dataSource: {
data: [
{ ProductName: "Tea", UnitPrice: 10 },
{ ProductName: "Coffee", UnitPrice: 15 }
]
},
search: {
fields: [{ name: "ProductName", operator: "contains" }]
},
toolbar: ["smartBox"],
smartBox: {
aiAssistantSettings: {
enabled: true,
activeMode: "AIAssistant",
service: {
url: "https://demos.telerik.com/service/v2/ai/grid/smart-state",
headers: {
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
},
}
}
}
});
</script>