Skip to content
Binary file modified tools/server/public/index.html.gz
Binary file not shown.
11 changes: 8 additions & 3 deletions tools/server/webui/src/lib/utils/thinking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ export function parseThinkingContent(content: string): {
};
}

const completeMatch = content.includes('</think>');
const completeMatch = content.match(/<think>([\s\S]*?)<\/think>/);

if (completeMatch) {
const thinkingContent = completeMatch[1]?.trim() ?? '';
const cleanContent = `${content.slice(0, completeMatch.index ?? 0)}${content.slice(
(completeMatch.index ?? 0) + completeMatch[0].length
)}`.trim();

return {
thinking: content.split('</think>')?.[0]?.trim(),
cleanContent: content.split('</think>')?.[1]?.trim()
thinking: thinkingContent,
cleanContent
};
}

Expand Down