Skip to content

Commit 00febb3

Browse files
Merge pull request #1 from DevExpress-Examples/dmitry-eliseev-devexpress-vcl-smartpaste-example-add-readme
Add README for AI-powered Smart Paste example
2 parents 41e745d + b09b6e1 commit 00febb3

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

849 KB
Loading
591 KB
Loading

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!-- default badges list -->
2+
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
3+
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
4+
<!-- default badges end -->
5+
# DevExpress VCL — AI-powered Smart Paste Functionality
6+
7+
This example adds an [AI-powered Smart Paste command](https://docs.devexpress.com/VCL/405528/ExpressCrossPlatformLibrary/common-features/ai-powered-extensions) to our [Grid](https://docs.devexpress.com/VCL/171093/ExpressQuantumGrid/vcl-data-grid) and [Layout](https://docs.devexpress.com/VCL/152013/ExpressLayoutControl/introduction) controls. Our command is based on the official Embarcadero [SmartCore AI Components Pack](https://docwiki.embarcadero.com/RADStudio/Florence/en/SmartCore_AI_Component_Pack) available in the [GetIt Package Manager](https://getitnow.embarcadero.com/smartcore-ai-components). VCL developers can switch between different AI service providers as requirements dictate.
8+
9+
> A _Smart Paste_ command analyzes clipboard content and assigns correct values (in specific formats) to corresponding editors in a complex UI layout or within grid cells.
10+
11+
## Prerequisites
12+
13+
* Embarcadero RAD Studio IDE 13 or newer (Community Edition is not supported)
14+
* [SmartCore AI Component Pack](https://docwiki.embarcadero.com/RADStudio/Florence/en/SmartCore_AI_Component_Pack) installed from [GetIt](https://getitnow.embarcadero.com/smartcore-ai-components)
15+
* DevExpress VCL Components v25.2.3 or newer
16+
17+
## Deploy and Run the Example
18+
19+
To connect this sample project to an AI service provider, you must:
20+
21+
1. Open the main form in **Designer** mode.
22+
2. Select the OpenAI or Google Gemini provider component.
23+
3. Expand the `Params` node in the **Object Inspector** and paste a valid API key into the `APIKey` input box.
24+
4. Uncomment the `TdxSmartCoreAIChatClient.Create` method call for the target AI provider:
25+
26+
```
27+
procedure TSmartCoreAIDemoMainForm.FormCreate(Sender: TObject);
28+
var
29+
Client: TdxAIChatClient;
30+
begin
31+
// OpenAI
32+
// Client := TdxSmartCoreAIChatClient.Create(OpenAIDriver);
33+
34+
// Google Gemini
35+
// Client := TdxSmartCoreAIChatClient.Create(GeminiDriver);
36+
37+
TdxAIChatClients.AddChatClient(Client);
38+
end;
39+
```
40+
41+
> [!NOTE]
42+
> DevExpress AI-powered Extensions follow the "bring your own key" principle. DevExpress does not offer a REST API and does not ship any built-in LLMs/SLMs. You need an active subscription for the required AI service to obtain the REST API endpoint, key, and model deployment name. These variables must be specified at application startup to register AI clients and enable DevExpress AI-powered Extensions in your application.
43+
44+
## Test the Example
45+
46+
### Layout Control
47+
48+
1. Run the sample project.
49+
2. Click the **Copy Text** button or copy text manually (you can edit text directly within the editor box if you wish).
50+
3. Click the **AI-powered Smart Paste** button to insert clipboard content into grouped editors.
51+
52+
![DevExpress VCL - Smart Paste Functionality in the Layout Control](/Delphi/Images/vcl-smartpaste-layout-control-example.gif)
53+
54+
### Grid Control
55+
56+
1. Switch to the **Grid** tab within the sample app.
57+
2. Copy any text line from the memo editor.
58+
3. Move focus to the target grid record or switch to **Append** mode.
59+
4. Right-click the grid's pop-up menu and select the **Smart Paste** option.
60+
61+
![DevExpress VCL - Smart Paste Functionality in the Data Grid Control](/Delphi/Images/vcl-smartpaste-grid-control-example.gif)
62+
63+
## Documentation
64+
65+
* [AI-powered Smart Paste for Native VCL Controls](https://docs.devexpress.com/VCL/405528/ExpressCrossPlatformLibrary/common-features/ai-powered-extensions#native-vcl-control-with-support-for-ai-powered-smart-paste)
66+
* [TcxCustomGridTableView.SmartPaste](https://docs.devexpress.com/VCL/cxGridCustomTableView.TcxCustomGridTableView.SmartPaste(System.String))
67+
* [TdxCustomLayoutGroup.SmartPaste](https://docs.devexpress.com/VCL/dxLayoutContainer.TdxCustomLayoutGroup.SmartPaste(System.String))
68+
<!-- feedback -->
69+
## Does this example address your development requirements/objectives?
70+
71+
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=vcl-smartpaste-example&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=vcl-smartpaste-example&~~~was_helpful=no)
72+
73+
(you will be redirected to DevExpress.com to submit your response)
74+
<!-- feedback end -->

0 commit comments

Comments
 (0)