diff --git a/public/scripts/extensions/vectors/index.js b/public/scripts/extensions/vectors/index.js index 62a8c33fa..30278ddea 100644 --- a/public/scripts/extensions/vectors/index.js +++ b/public/scripts/extensions/vectors/index.js @@ -1615,12 +1615,12 @@ jQuery(async () => { callback: async (args, query) => { const clamp = (v) => Number.isNaN(v) ? null : Math.min(1, Math.max(0, v)); const threshold = clamp(Number(args?.threshold ?? settings.score_threshold)); - const validateSize = (v) => Number.isNaN(v) || !Number.isInteger(v) || v < 1 ? null : v; - const resultSize = validateSize(Number(args?.resultSize)) ?? settings.chunk_count_db; + const validateCount = (v) => Number.isNaN(v) || !Number.isInteger(v) || v < 1 ? null : v; + const count = validateCount(Number(args?.count)) ?? settings.chunk_count_db; const source = String(args?.source ?? ''); const attachments = source ? getDataBankAttachmentsForSource(source, false) : getDataBankAttachments(false); const collectionIds = await ingestDataBankAttachments(String(source)); - const queryResults = await queryMultipleCollections(collectionIds, String(query), resultSize, threshold); + const queryResults = await queryMultipleCollections(collectionIds, String(query), count, threshold); // Get URLs const urls = Object @@ -1651,7 +1651,7 @@ jQuery(async () => { helpString: 'Search the Data Bank for a specific query using vector similarity. Returns a list of file URLs with the most relevant content.', namedArgumentList: [ new SlashCommandNamedArgument('threshold', 'Threshold for the similarity score in the [0, 1] range. Uses the global config value if not set.', ARGUMENT_TYPE.NUMBER, false, false, ''), - new SlashCommandNamedArgument('resultSize', 'Maximum number of query results to return.', ARGUMENT_TYPE.NUMBER, false, false, ''), + new SlashCommandNamedArgument('count', 'Maximum number of query results to return.', ARGUMENT_TYPE.NUMBER, false, false, ''), new SlashCommandNamedArgument('source', 'Optional filter for the attachments by source.', ARGUMENT_TYPE.STRING, false, false, '', ['global', 'character', 'chat']), SlashCommandNamedArgument.fromProps({ name: 'return',