diff --git a/public/scripts/extensions/memory/index.js b/public/scripts/extensions/memory/index.js index 0bc2ff577..bc65c8e4a 100644 --- a/public/scripts/extensions/memory/index.js +++ b/public/scripts/extensions/memory/index.js @@ -23,8 +23,7 @@ import { debounce_timeout } from '../../constants.js'; import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js'; import { SlashCommand } from '../../slash-commands/SlashCommand.js'; import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js'; -import { resolveVariable } from '../../variables.js'; -import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js'; +import { MacrosParser } from '../../macros.js'; export { MODULE_NAME }; const MODULE_NAME = '1_memory'; @@ -937,4 +936,6 @@ jQuery(async function () { helpString: 'Summarizes the given text. If no text is provided, the current chat will be summarized. Can specify the source and the prompt to use.', returns: ARGUMENT_TYPE.STRING, })); + + MacrosParser.registerMacro('summary', () => getLatestMemoryFromChat(getContext().chat)); }); diff --git a/public/scripts/templates/macros.html b/public/scripts/templates/macros.html index c11a8b5a1..010a462f7 100644 --- a/public/scripts/templates/macros.html +++ b/public/scripts/templates/macros.html @@ -16,6 +16,7 @@
  • {{persona}}your current Persona Description
  • {{mesExamples}}the Character's Dialogue Examples
  • {{mesExamplesRaw}}unformatted Dialogue Examples (only for Story String)
  • +
  • {{summary}}the latest chat summary generated by the "Summarize" extension (if available).
  • {{user}}your current Persona username
  • {{char}}the Character's name
  • {{char_version}}the Character's version number