The FMX component
TFmxHelpChatAI (unit FMX.HelpChatAI, package HelpChatAIFmx, Delphi 12 and later) is the FireMonkey twin of TVclHelpChatAI. Same engine, same page, same events: what differs is what FireMonkey itself does differently.
HelpChatAI.Settings.Provider := 'docsearch';
HelpChatAI.Settings.DocIndexFile := '...help-index.json';
HelpChatAI.Active := True;Caption and AssistantName work as in the VCL: empty means the localized "Help" and "Assistant". So do Images, ImageIndex and ImageName — the bubble is round and wears the assistant icon, and the same icon appears in the header of the panel.
One thing is genuinely different, and it bites when you pass an image list of your own. In FireMonkey a name belongs to the Source collection while ImageIndex addresses the Destination one: they are two different lookups, not two ways of saying the same thing. The component tries the name first (BitmapItemByName) and falls back to the index (Bitmap(Size, Index)).
With no image list the four built-in faces are used, exactly as in the VCL, and the Object Inspector drops down their names.
Everything in The VCL component applies — Open, OpenWithQuestion, OpenForHelp, Close, Toggle, the bubble, Container and the OnBeforeShowHelp / OnAfterShowHelp / OnBeforeHideHelp / OnAfterHideHelp events (with a TFmxObject container instead of a TWinControl), Actions, Settings.
What is different
F1
FireMonkey has no help routing: there is no WM_HELP, no Application.HelpKeyword. The component chains the OnKeyDown of the host form — your handler still runs first — and answers F1 with the current screen:
HelpChatAI.HandleF1 := True; // the default
HelpChatAI.HostForm := Self; // or leave it: Application.MainForm is usedFor other forms, call HandleKeyDown from their own OnKeyDown:
procedure TOrdersForm.FormKeyDown(Sender: TObject; var Key: Word;
var KeyChar: WideChar; Shift: TShiftState);
begin
HelpChatAI.HandleKeyDown(Key, Shift); // True when it consumed F1
end;RegisterHelpViewer still registers the chat with System.HelpIntfs, so code that calls the help system directly reaches it.
The screen context
Help properties live on TStyledControl in FMX, and forms do not have them. The component walks up from the focused control; the active TTabItem gives the screen label. When nothing has the focus — common in FMX — it falls back to the active tab of the first TTabControl it finds. Give your tabs a HelpKeyword and the context works the same way as in the VCL.
Colours
There are no VCL styles to follow, so the colours come from ThemeMode:
| Value | Result |
|---|---|
tmAuto (default) | the page's own defaults, following the light/dark setting of the system |
tmLight | the built-in light theme |
tmDark | the built-in dark theme |
OnGetTheme adjusts the result exactly as in the VCL — see Colours and theming.
Confirmation of actions
An action marked as needing confirmation is asked about through OnActionConfirm. In the VCL, with no handler, a standard dialog is shown. FireMonkey has no dialog that can be waited for on every platform (on mobile they are asynchronous) and a worker thread is waiting for the answer, so with no handler the action is refused and the model is told so. Assign OnActionConfirm and ask the user your way:
procedure TMainForm.HelpChatActionConfirm(Sender: TObject; const AName: string;
const AArgs: THelpChatActionArgs; var AAllow: Boolean);
begin
AAllow := MyOwnSynchronousQuestion(AName, AArgs.ToDisplayString);
end;Containers and the web view
A native web view is not moved from one window to another: when the container changes, the control is recreated and the page reloads. The conversation is not lost — it lives in the engine, not in the page.
Navigation outside the panel
The panel only shows the chat; a documentation link opens in the system browser. On Delphi 13 the navigation is cancelled before it starts (OnShouldLoadURL). Delphi 12 has no way to cancel a navigation, so the link is opened in the system browser and the panel returns to its own page as soon as the intruder has loaded. Links come from sanitized Markdown (http, https, mailto only), so what can appear there is an ordinary documentation page.
Dictation
There is none: the microphone button is VCL only for now. The FMX panel is the same page, so when an engine is wired to it the button will appear there too.
At design time
The component editor offers Check configuration... — the same answer the VCL one gives, over the configuration read the way the built application would read it — and the link to this documentation. Settings.Provider gets the same drop-down of registered providers.
There is no live preview here. The VCL panel is a TEdgeBrowser, which the IDE hosts without trouble; the FMX one is a native window inside an FMX form, and an FMX form created by a design package inside the VCL IDE is not the place to find out whether that works. HostForm is not published, for the same reason as in the VCL.
Platforms
| Platform | State |
|---|---|
| Windows | verified (WebView2, WindowsEngine = EdgeOnly) |
| macOS, iOS, Android | the code compiles and uses the native web view, but has not been tested yet |
On mobile, remember that a local HTTP server in-process is awkward and the model API key must not be in the package: that is what the remote server is for.