diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 24a2382a7..1768762db 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -186,6 +186,7 @@ parser.addCommand('trimend', trimEndCallback, [], '(text parser.addCommand('inject', injectCallback, [], 'id=injectId (position=before/after/chat depth=number [text]) – injects a text into the LLM prompt for the current chat. Requires a unique injection ID. Positions: "before" main prompt, "after" main prompt, in-"chat" (default: after). Depth: injection depth for the prompt (default: 4).', true, true); parser.addCommand('listinjects', listInjectsCallback, [], ' – lists all script injections for the current chat.', true, true); parser.addCommand('flushinjects', flushInjectsCallback, [], ' – removes all script injections for the current chat.', true, true); +parser.addCommand('tokens', (_, text) => getTokenCount(text), [], '(text) – counts the number of tokens in the text.', true, true); registerVariableCommands(); const NARRATOR_NAME_KEY = 'narrator_name';