Skip to content

This example adds an AI-powered Smart Paste command to our Grid and Layout controls. Our command is based on the official Embarcadero SmartCore AI Components Pack available in he GetIt Package Manager

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/vcl-smartpaste-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevExpress VCL — AI-powered Smart Paste Functionality

This example adds an AI-powered Smart Paste command to our Grid and Layout controls. Our command is based on the official Embarcadero SmartCore AI Components Pack available in the GetIt Package Manager. VCL developers can switch between different AI service providers as requirements dictate.

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.

Prerequisites

  • Embarcadero RAD Studio IDE 13 or newer (Community Edition is not supported)
  • SmartCore AI Component Pack installed from GetIt
  • DevExpress VCL Components v25.2.3 or newer

Deploy and Run the Example

To connect this sample project to an AI service provider, you must:

  1. Open the main form in Designer mode.
  2. Select the OpenAI or Google Gemini provider component.
  3. Expand the Params node in the Object Inspector and paste a valid API key into the APIKey input box.
  4. Uncomment the TdxSmartCoreAIChatClient.Create method call for the target AI provider:
procedure TSmartCoreAIDemoMainForm.FormCreate(Sender: TObject);
var
  Client: TdxAIChatClient;
begin
  // OpenAI
  // Client := TdxSmartCoreAIChatClient.Create(OpenAIDriver);

  // Google Gemini
  // Client := TdxSmartCoreAIChatClient.Create(GeminiDriver);

  TdxAIChatClients.AddChatClient(Client);
end;

Note

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.

Test the Example

Layout Control

  1. Run the sample project.
  2. Click the Copy Text button or copy text manually (you can edit text directly within the editor box if you wish).
  3. Click the AI-powered Smart Paste button to insert clipboard content into grouped editors.

DevExpress VCL - Smart Paste Functionality in the Layout Control

Grid Control

  1. Switch to the Grid tab within the sample app.
  2. Copy any text line from the memo editor.
  3. Move focus to the target grid record or switch to Append mode.
  4. Right-click the grid's pop-up menu and select the Smart Paste option.

DevExpress VCL - Smart Paste Functionality in the Data Grid Control

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

This example adds an AI-powered Smart Paste command to our Grid and Layout controls. Our command is based on the official Embarcadero SmartCore AI Components Pack available in he GetIt Package Manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages