eSeGeCe
software
The sgcAI OpenAI component enables Delphi teams to ship smart, revenue-ready experiences that blend natural language understanding, code generation, and conversation flows into existing VCL and FMX products. With a single drop-in component, SaaS vendors can offer AI-driven assistants, automated documentation, or multilingual chat without rebuilding their infrastructure.
The snippet below configures a TsgcOpenAI component at runtime. Drop a TButton, TMemo, and TListBox on the form to visualize the conversation.
uses
System.SysUtils, sgcAI_OpenAI;
procedure TFormMain.FormCreate(Sender: TObject);
begin
OpenAI := TsgcOpenAI.Create(Self);
OpenAI.APIKey := GetEnvironmentVariable('OPENAI_API_KEY');
OpenAI.DefaultModel := 'gpt-4o-mini';
OpenAI.HTTP.Proxy.Host := 'proxy.company.local';
OpenAI.HTTP.Proxy.Port := 8080;
OpenAI.HTTP.Timeout := 15000;
OpenAI.Streaming := True;
end;
procedure TFormMain.ButtonAskClick(Sender: TObject);
var
LRequest: TsgcOpenAIChatRequest;
LResponse: TsgcOpenAIChatResponse;
begin
LRequest := TsgcOpenAIChatRequest.Create;
try
LRequest.Messages.Add('system', 'Answer as a senior support engineer.');
LRequest.Messages.Add('user', MemoPrompt.Lines.Text);
LResponse := OpenAI.Chat.Create(LRequest);
try
ListBoxHistory.Items.Add(LResponse.Choices[0].Message.Content);
finally
LResponse.Free;
end;
finally
LRequest.Free;
end;
end;
Delphi vendors can unlock new revenue streams by packaging AI copilots, knowledge search, and audio transcription as subscription tiers. With built-in analytics events and token accounting, it is straightforward to measure engagement, justify upsells, and build personalized customer success workflows.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.