Use performFuzzySearch

6ff06ff04bded54c846ce203192243c0908d74b8

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -5Ignore whitespace
public/scripts/reasoning.js+3 -5
@@ -1,5 +1,4 @@
11import {
2- Fuse,
32 moment,
43} from '../lib.js';
54import { chat, closeMessageEditor, event_types, eventSource, main_api, messageFormatting, saveChatConditional, saveChatDebounced, saveSettingsDebounced, substituteParams, syncMesToSwipe, updateMessageBlock } from '../script.js';
@@ -8,7 +7,7 @@ import { getCurrentLocale, t, translate } from './i18n.js';
87import { MacrosParser } from './macros.js';
98import { chat_completion_sources, getChatCompletionModel, oai_settings } from './openai.js';
109import { Popup } from './popup.js';
1110import { performFuzzySearch, power_user } from './power-user.js';
1211import { SlashCommand } from './slash-commands/SlashCommand.js';
1312import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from './slash-commands/SlashCommandArgument.js';
1413import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
@@ -91,7 +90,7 @@ export function extractReasoningFromData(data, {
9190 mainApi = null,
9291 ignoreShowThoughts = false,
9392 textGenType = null,
9493 chatCompletionSource = null,
9594} = {}) {
9695 switch (mainApi ?? main_api) {
9796 case 'textgenerationwebui':
@@ -781,8 +780,7 @@ function selectReasoningTemplateCallback(args, name) {
781780 let foundName = templateNames.find(x => x.toLowerCase() === name.toLowerCase());
782781
783782 if (!foundName) {
784783 const fuseresult = new FuseperformFuzzySearch('reasoning-templates', templateNames, [], name);
785- const result = fuse.search(name);
786784
787785 if (result.length === 0) {
788786 !quiet && toastr.warning(`Reasoning template "${name}" not found`);