| @@ -1615,12 +1615,12 @@ jQuery(async () => { | |||
| 1615 | callback: async (args, query) => { | 1615 | callback: async (args, query) => { |
| 1616 | const clamp = (v) => Number.isNaN(v) ? null : Math.min(1, Math.max(0, v)); | 1616 | const clamp = (v) => Number.isNaN(v) ? null : Math.min(1, Math.max(0, v)); |
| 1617 | const threshold = clamp(Number(args?.threshold ?? settings.score_threshold)); | 1617 | const threshold = clamp(Number(args?.threshold ?? settings.score_threshold)); |
| 1618 | const validateSize = (v) => Number.isNaN(v) || !Number.isInteger(v) || v < 1 ? null : v; | 1618 | const validateCount = (v) => Number.isNaN(v) || !Number.isInteger(v) || v < 1 ? null : v; |
| 1619 | const resultSize = validateSize(Number(args?.resultSize)) ?? settings.chunk_count_db; | 1619 | const count = validateCount(Number(args?.count)) ?? settings.chunk_count_db; |
| 1620 | const source = String(args?.source ?? ''); | 1620 | const source = String(args?.source ?? ''); |
| 1621 | const attachments = source ? getDataBankAttachmentsForSource(source, false) : getDataBankAttachments(false); | 1621 | const attachments = source ? getDataBankAttachmentsForSource(source, false) : getDataBankAttachments(false); |
| 1622 | const collectionIds = await ingestDataBankAttachments(String(source)); | 1622 | const collectionIds = await ingestDataBankAttachments(String(source)); |
| 1623 | const queryResults = await queryMultipleCollections(collectionIds, String(query), resultSize, threshold); | 1623 | const queryResults = await queryMultipleCollections(collectionIds, String(query), count, threshold); |
| 1624 | 1624 | ||
| 1625 | // Get URLs | 1625 | // Get URLs |
| 1626 | const urls = Object | 1626 | const urls = Object |
| @@ -1651,7 +1651,7 @@ jQuery(async () => { | |||
| 1651 | helpString: 'Search the Data Bank for a specific query using vector similarity. Returns a list of file URLs with the most relevant content.', | 1651 | helpString: 'Search the Data Bank for a specific query using vector similarity. Returns a list of file URLs with the most relevant content.', |
| 1652 | namedArgumentList: [ | 1652 | namedArgumentList: [ |
| 1653 | 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, ''), | 1653 | 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, ''), |
| 1654 | new SlashCommandNamedArgument('resultSize', 'Maximum number of query results to return.', ARGUMENT_TYPE.NUMBER, false, false, ''), | 1654 | new SlashCommandNamedArgument('count', 'Maximum number of query results to return.', ARGUMENT_TYPE.NUMBER, false, false, ''), |
| 1655 | new SlashCommandNamedArgument('source', 'Optional filter for the attachments by source.', ARGUMENT_TYPE.STRING, false, false, '', ['global', 'character', 'chat']), | 1655 | new SlashCommandNamedArgument('source', 'Optional filter for the attachments by source.', ARGUMENT_TYPE.STRING, false, false, '', ['global', 'character', 'chat']), |
| 1656 | SlashCommandNamedArgument.fromProps({ | 1656 | SlashCommandNamedArgument.fromProps({ |
| 1657 | name: 'return', | 1657 | name: 'return', |