Skip to content

Commit e885445

Browse files
authored
server : filter out harmony thought messages (#15278)
1 parent 648ebcd commit e885445

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tools/server/public/index.html.gz

40 Bytes
Binary file not shown.

tools/server/webui/src/utils/misc.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
130130
role: msg.role,
131131
content:
132132
msg.role === 'assistant'
133-
? contentStr.split('</think>').at(-1)!.trim()
133+
? contentStr
134+
.split(
135+
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
136+
)
137+
.at(-1)!
138+
.trim()
134139
: contentStr,
135140
} as APIMessage;
136141
});

0 commit comments

Comments
 (0)