server : filter out harmony thought messages (#15278)

This commit is contained in:
Aldehir Rojas
2025-08-13 05:28:21 -05:00
committed by GitHub
parent 648ebcdb73
commit e885445bc1
2 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@@ -130,7 +130,12 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
role: msg.role, role: msg.role,
content: content:
msg.role === 'assistant' msg.role === 'assistant'
? contentStr.split('</think>').at(-1)!.trim() ? contentStr
.split(
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
)
.at(-1)!
.trim()
: contentStr, : contentStr,
} as APIMessage; } as APIMessage;
}); });