diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 508cfc6f4..7b405d2b7 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -1020,14 +1020,13 @@ async function getLlmPrompt(labels) { * @returns {string} The parsed emotion or the fallback expression. */ function parseLlmResponse(emotionResponse, labels) { - const fallbackExpression = getFallbackExpression(); - try { const parsedEmotion = JSON.parse(emotionResponse); const response = parsedEmotion?.emotion?.trim()?.toLowerCase(); if (!response || !labels.includes(response)) { - return fallbackExpression; + console.debug(`Parsed emotion response: ${response} not in labels: ${labels}`); + throw new Error('Emotion not in labels'); } return response;