Skip to content

Slash commands ​

A line that starts with / in the question box is a command, not a question: it never reaches the model, and its answer is a system bubble that is shown but not kept in the conversation, so it does not end up in the next prompt either - and the X at its top right takes it off the page once it has been read. Commands give the answers a model cannot give for certain - who is answering, which pages the answer would be based on, what the application lets the assistant do - and put the buttons of the panel under the keyboard.

The answer of /actions: what it answers first, then the list

Every answer starts with what it answers - "Available actions (/actions):" - so a bubble read later, or a text pasted into a message to the developer, says what it is. An answer taller than the panel is shown from that first line.

The commands ​

CommandWhat it does
/helpThe commands you can type
/whoThe model in use: name, model, provider, endpoint
/use nameSwitches to the named model (a prefix is enough)
/lang [language]Without a language, the languages of the chat; with one (de, Deutsch, german), switches to it
/retry [name]Asks the last question again, to another model if named
/search wordsThe documentation pages the answer would be grounded on; without words, those of the last question
/pagesThe pages of the documentation index
/doc pageOpens a page of the documentation in the panel
/contextThe screen context the application sent - what F1 knows
/actionsThe actions the application registered, with their parameters (* = required)
/skillsThe skills of the assistant: what each one does, in the language of the chat, and the actions it brings; a name of Settings.Skills no skill of the application has is marked not available
/checkThe configuration check: the provider of the model in use, every model of the catalogue, the index and the pages folder - and the names of AllowedActions that no registered action answers to
/statsTime to the first token and to the end of the last answer
/clear, /pdf, /copy, /attachThe buttons of the panel
/promptThe system prompt the last question went with, documentation excerpts included; in two boxes with a title each: Cached prompt, then Context (now, the screen, the excerpts). Below them, the search terms of the model when the question was translated for the search
/run action name=valueRuns a registered action by hand, with the usual confirmation

The answer of /prompt: the cached prompt, then the context of the question

/search is the one to reach for when an answer ignores a page that has it: if the page is not in the list, the model never saw it, and the fix is in the index or in the words of the page, not in the prompt.

Which ones the user may type ​

EnabledCommands on TVclHelpChatAI and TFmxHelpChatAI is a set of THelpChatCommand, edited in the Object Inspector with a check box each. The default is every command but prompt and run: the first shows the instructions and the excerpts of a request, the second runs an action without the model. Enable them in a build for support or testing:

pascal
HelpChatAI.EnabledCommands := HELPCHAT_DEF_COMMANDS + [hccPrompt, hccRun];

The set is enforced by the server of the panel, not only by the page: a command that is not enabled is answered 403. A remote session starts without check - it would print the folders, the files and the missing keys of the machine the server runs on - and without run, because the actions are not on the server.

From code ​

Whatever the user can do in the panel, the application can do on the component - and from code any command runs, enabled or not: EnabledCommands is what the user may type, not what the application may do.

pascal
HelpChatAI.ExecuteCommand(hccActions);            // opens the panel and shows the answer
HelpChatAI.ExecuteCommand(hccSearch, 'export');   // with its arguments

ShowMessage(HelpChatAI.ExplainCommand(hccWho));   // the same answer as text, no panel:
// Model in use (/who):
// Claude · claude-haiku-5-5
// Provider: claude
// Endpoint: https://api.anthropic.com
MethodWhat it does
ExecuteCommand(ACommand, AArgs)Runs the command in the panel as if typed, opening it when it is closed
ExplainCommand(ACommand, AArgs): stringThe answer as plain text, without the panel. run is not run here - the action would wait for the very thread that is asking - and answers with its usage
ClearConversationThe ↺ button
Models, SelectModel(AName)The list of the models
Languages, ActiveLanguage, SelectLanguage(ALanguage)The flag of the language
RetryLastQuestion(AModel)/retry
SaveConversationPdfThe PDF button
CopyLastAnswerThe copy button of the last answer
AttachFile(AFileName, out AError)The clip

With a remote engine ExplainCommand answers empty and the server refuses the commands it does not enable even from code: there the page talks to a server shared by everybody, which cannot take a page's word that the application asked.

Adding a command ​

THelpChatCommand lives in HelpChatAI.Commands. A new one is a member of the enumeration, its name, its title and description in every language of HelpChatAI.Messages, and its answer - a case in HelpChatRunCommand when the engine answers it, a branch in panel.js when the page does. The components, the server and the page read the set, so nothing else changes.

Released under the Apache License 2.0