mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Clean reasoning from classify response
- If a reasoning model is used (via LLM, or R1 distill via webLLM), it'll likely return reasoning. That should not be used for the search of classification inside the response
This commit is contained in:
@ -17,6 +17,7 @@ import { slashCommandReturnHelper } from '../../slash-commands/SlashCommandRetur
|
||||
import { generateWebLlmChatPrompt, isWebLlmSupported } from '../shared.js';
|
||||
import { Popup, POPUP_RESULT } from '../../popup.js';
|
||||
import { t } from '../../i18n.js';
|
||||
import { removeReasoningFromString } from '../../reasoning.js';
|
||||
export { MODULE_NAME };
|
||||
|
||||
/**
|
||||
@ -928,6 +929,9 @@ function parseLlmResponse(emotionResponse, labels) {
|
||||
|
||||
return response;
|
||||
} catch {
|
||||
// Clean possible reasoning from response
|
||||
emotionResponse = removeReasoningFromString(emotionResponse);
|
||||
|
||||
const fuse = new Fuse(labels, { includeScore: true });
|
||||
console.debug('Using fuzzy search in labels:', labels);
|
||||
const result = fuse.search(emotionResponse);
|
||||
|
Reference in New Issue
Block a user