Lint fix
This commit is contained in:
parent
4219468e20
commit
b93131ec7a
|
@ -1020,11 +1020,11 @@ function parseLlmResponse(emotionResponse, labels) {
|
||||||
const parsedEmotion = JSON.parse(emotionResponse);
|
const parsedEmotion = JSON.parse(emotionResponse);
|
||||||
return parsedEmotion?.emotion ?? fallbackExpression;
|
return parsedEmotion?.emotion ?? fallbackExpression;
|
||||||
} catch {
|
} catch {
|
||||||
const fuse = new Fuse(labels, {includeScore: true});
|
const fuse = new Fuse(labels, { includeScore: true });
|
||||||
console.debug("Using fuzzy search in labels: " + labels.join(', '))
|
console.debug('Using fuzzy search in labels:', labels);
|
||||||
const result = fuse.search(emotionResponse);
|
const result = fuse.search(emotionResponse);
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
console.debug("fuzzy search found: " + result[0].item + " as closest for the LLM response: " + emotionResponse)
|
console.debug(`fuzzy search found: ${result[0].item} as closest for the LLM response:`, emotionResponse);
|
||||||
return result[0].item;
|
return result[0].item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue