server : filter out harmony thought messages (#15278)
This commit is contained in:
parent
648ebcdb73
commit
e885445bc1
Binary file not shown.
|
|
@ -130,7 +130,12 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
|
|||
role: msg.role,
|
||||
content:
|
||||
msg.role === 'assistant'
|
||||
? contentStr.split('</think>').at(-1)!.trim()
|
||||
? contentStr
|
||||
.split(
|
||||
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
|
||||
)
|
||||
.at(-1)!
|
||||
.trim()
|
||||
: contentStr,
|
||||
} as APIMessage;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue