This example uses an ASP.NET Web API backend to configure the following AI-powered DevExtreme DataGrid features:
The AIIntegrationServer backend exposes separate endpoints for AI columns and the AI Assistant:
const _SERVER_URL = 'http://localhost:5005/api/ai';
const AI_COLUMN_URL = `${_SERVER_URL}/grid-column`;
const AI_ASSISTANT_URL = `${_SERVER_URL}/assistant`;This example uses endpoint URLs in a factory function to configure two AIIntegration instances:
function createSendRequest(url) {
return ({ prompt, data }) => {
const controller = new AbortController();
const signal = controller.signal;
const promise = fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ prompt, data }),
signal,
})
.then(response => response.json())
.then(result => {
return result.content;
});
return {
promise,
abort: () => controller.abort(),
};
};
}
const columnAiIntegration = new DevExpress.aiIntegration.AIIntegration({
sendRequest: createSendRequest(AI_COLUMN_URL),
});
const assistantAiIntegration = new DevExpress.aiIntegration.AIIntegration({
sendRequest: createSendRequest(AI_ASSISTANT_URL),
});To run the backend, follow the instructions in the following README: AIIntegrationServer.
- AI Integration Server
- Angular
- React
- Vue
- jQuery
- ASP.NET Core
- DataGrid - AI-Powered Features Overview
- DataGrid - AI Column
- DataGrid - AI Assistant
- AIIntegration Utility
(you will be redirected to DevExpress.com to submit your response)
