Transform LLM emotion response to lower

This commit is contained in:
Cohee 2024-05-25 17:11:58 +03:00
parent fa6fc45e6f
commit b545185f1a

View File

@ -1024,7 +1024,7 @@ function parseLlmResponse(emotionResponse, labels) {
try {
const parsedEmotion = JSON.parse(emotionResponse);
const response = parsedEmotion?.emotion;
const response = parsedEmotion?.emotion?.trim()?.toLowerCase();
if (!response || !labels.includes(response)) {
return fallbackExpression;