only filter </think> for assistant msg

This commit is contained in:
Xuan Son Nguyen 2025-01-24 00:05:03 +01:00
parent 7b3ac17c7b
commit 4395d70d39

View file

@ -693,7 +693,9 @@ function filterThoughtFromMsgs(messages) {
return messages.map((msg) => { return messages.map((msg) => {
return { return {
role: msg.role, role: msg.role,
content: msg.content.split('</think>').at(-1).trim(), content: msg.role === 'assistant'
? msg.content.split('</think>').at(-1).trim()
: msg.content,
}; };
}); });
} }