Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
61fa2f5
AI Column type, sorting test
Raushen Sep 18, 2025
899cf2b
Merge branch '25_2' of github.com:DevExpress/DevExtreme into AI-Colum…
Raushen Sep 18, 2025
60c2661
Fix tests
Raushen Sep 19, 2025
5251ddd
Update test handler
Raushen Sep 19, 2025
dc63e3b
Merge branch '25_2' of github.com:DevExpress/DevExtreme into AI-Colum…
Raushen Sep 19, 2025
bc882d9
Merge branch '25_2' of github.com:DevExpress/DevExtreme into AI-Colum…
Raushen Sep 22, 2025
a268cae
Merge branch '25_2' of github.com:DevExpress/DevExtreme into AI-Colum…
Raushen Sep 24, 2025
638c59d
Add structure
Raushen Sep 24, 2025
ffbf698
Add methods
Raushen Sep 24, 2025
9e65d90
Merge commit
Raushen Sep 24, 2025
38dbb4b
Merge branch '25_2' of github.com:DevExpress/DevExtreme into AI-Colum…
Raushen Sep 24, 2025
4543f14
Refactoring
Raushen Sep 24, 2025
dd4a44d
Add aiIntegration tests
Raushen Sep 29, 2025
ba73086
Prompt property
Raushen Sep 29, 2025
202d34d
Handling data changing
Raushen Oct 2, 2025
798b3e4
Async tests
Raushen Oct 2, 2025
149ca7b
Manual mode test
Raushen Oct 2, 2025
dc00b82
Merge branch '25_2' of github.com:DevExpress/DevExtreme into New-AI-C…
Raushen Oct 2, 2025
97a34ab
Remove playground file dx.ai-integration.js
Raushen Oct 2, 2025
c78d4ef
Remove playground file jquery AI Column Base.html
Raushen Oct 2, 2025
9166c36
Remove playground file jquery calculateCellValue.html
Raushen Oct 2, 2025
42163d0
Rollback
Raushen Oct 2, 2025
03acfb0
Rollback
Raushen Oct 2, 2025
a54a763
Fix tests
Raushen Oct 3, 2025
5ae838d
Update dx.all.d.ts
Raushen Oct 3, 2025
56ebe9a
Error text fix
Raushen Oct 3, 2025
03e3d20
Merge branch '25_2' of github.com:DevExpress/DevExtreme into New-AI-C…
Raushen Oct 6, 2025
6de7eaf
Fix comments
Raushen Oct 6, 2025
f660cca
Rename GenerateColumn -> GenerateGridColumn
Raushen Oct 7, 2025
378f570
.d.ts regeneration
Raushen Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { GenerateGridColumnCommandParams, GenerateGridColumnCommandResult } from '@js/common/ai-integration';
import { BaseCommand } from '@ts/core/ai_integration/commands/base';
import type { PromptData, PromptTemplateName } from '@ts/core/ai_integration/core/prompt_manager';

export class GenerateGridColumnCommand extends BaseCommand<
GenerateGridColumnCommandParams,
GenerateGridColumnCommandResult
> {
protected getTemplateName(): PromptTemplateName {
return 'generateColumn';
}

protected buildPromptData(params: GenerateGridColumnCommandParams): PromptData {
const dataDescription = this.generateDataDescription(params.data);
return {
user: {
text: params.text,
data: dataDescription,
},
};
}

protected parseResult(response: string): GenerateGridColumnCommandResult {
const result: GenerateGridColumnCommandResult = JSON.parse(response);
return result;
}

private generateDataDescription(data: Record<PropertyKey, unknown>): string {
const result = JSON.stringify(data);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import type {
ExecuteCommandResult,
ExpandCommandParams,
ExpandCommandResult,
GenerateGridColumnCommandParams,
GenerateGridColumnCommandResult,
ProofreadCommandParams,
ProofreadCommandResult,
RequestCallbacks,
Expand Down Expand Up @@ -36,6 +38,8 @@ import {
import { PromptManager } from '@ts/core/ai_integration/core/prompt_manager';
import { RequestManager } from '@ts/core/ai_integration/core/request_manager';

import { GenerateGridColumnCommand } from '../commands/generateGridColumn';

export const enum CommandNames {
ChangeStyle = 'changeStyle',
ChangeTone = 'changeTone',
Expand All @@ -46,6 +50,7 @@ export const enum CommandNames {
Summarize = 'summarize',
Translate = 'translate',
SmartPaste = 'smartPaste',
GenerateGridColumn = 'generateGridColumn',
}

export const COMMANDS = {
Expand All @@ -58,6 +63,7 @@ export const COMMANDS = {
[CommandNames.Summarize]: SummarizeCommand,
[CommandNames.Translate]: TranslateCommand,
[CommandNames.SmartPaste]: SmartPasteCommand,
[CommandNames.GenerateGridColumn]: GenerateGridColumnCommand,
} as const;

export interface CommandDefinition<TParams, TResult> {
Expand All @@ -76,6 +82,10 @@ export interface Commands {
[CommandNames.Summarize]: CommandDefinition<SummarizeCommandParams, SummarizeCommandResult>;
[CommandNames.Translate]: CommandDefinition<TranslateCommandParams, TranslateCommandResult>;
[CommandNames.SmartPaste]: CommandDefinition<SmartPasteCommandParams, SmartPasteCommandResult>;
[CommandNames.GenerateGridColumn]: CommandDefinition<
GenerateGridColumnCommandParams,
GenerateGridColumnCommandResult
>;
}

export class AIIntegration implements IAIIntegration {
Expand Down Expand Up @@ -210,4 +220,15 @@ export class AIIntegration implements IAIIntegration {
callbacks,
);
}

public generateGridColumn(
params: GenerateGridColumnCommandParams,
callbacks: RequestCallbacks<GenerateGridColumnCommandResult>,
): () => void {
return this.executeCommand(
CommandNames.GenerateGridColumn,
params,
callbacks,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export type PromptTemplateName =
| 'shorten'
| 'summarize'
| 'translate'
| 'smartPaste';
| 'smartPaste'
| 'generateColumn';

export type PromptTemplates = Map<PromptTemplateName, PromptTemplate>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ export const templates: PromptTemplates = {
system: 'You are a helpful assistant that helps to fill fields based on the text provided. You will get a text and a list of fields that should be filled using info from the text. It can include the name of field, suitable format, optionally some additional instruction about what it should include. You need to return data for all the fields in the following format without any preamble, introduction, or explanatory text: {fieldName}:::{fieldValue};;;{fieldName}:::{fieldValue} and so on, where {fieldName} - is a variable for a field name and {fieldValue} - is a variable for a string to fill. If there is no info to fill, field value should be empty (like Name:::;;;)- do not use placeholders like (empty), N/A, null, or similar. Only fill in date fields if a complete date is explicitly present. If the date is missing or incomplete, leave the field empty.',
user: 'Text: {{text}}. Fields: {{fields}}.',
},
generateColumn: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[thoughts]
This API may become public, so I would ask TechWriters to help with the name. I would narrow down the meaning of this name to generateDataGridColumn.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, adding a bit of specificity is beneficial. Let's rename this template to generateGridColumn. This adds specificity while keeping the name relatively short and leaving the door open to using this template in the TreeList (if we ever decide to add AI columns to the TreeList).

Suggested change
generateColumn: {
generateGridColumn: {

system: 'You are a helpful assistant that generates column data based on the provided text and existing data context. Generate appropriate column values that match the request and are consistent with the existing data structure.',
user: 'Text: {{text}}. Data: {{data}}.',
},
};
Loading
Loading