mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Throw if couldn't classify
This commit is contained in:
@ -1006,7 +1006,6 @@ function parseLlmResponse(emotionResponse, labels) {
|
|||||||
try {
|
try {
|
||||||
const parsedEmotion = JSON.parse(emotionResponse);
|
const parsedEmotion = JSON.parse(emotionResponse);
|
||||||
return parsedEmotion?.emotion ?? fallbackExpression;
|
return parsedEmotion?.emotion ?? fallbackExpression;
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
const fuse = new Fuse([emotionResponse]);
|
const fuse = new Fuse([emotionResponse]);
|
||||||
for (const label of labels) {
|
for (const label of labels) {
|
||||||
@ -1017,7 +1016,7 @@ function parseLlmResponse(emotionResponse, labels) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fallbackExpression;
|
throw new Error('Could not parse emotion response ' + emotionResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTextGenSettingsReady(args) {
|
function onTextGenSettingsReady(args) {
|
||||||
|
Reference in New Issue
Block a user