Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

517 B
Raw Blame
// Reasoning models (e.g. qwen3 family) emit <think>...</think> in the text
// stream. Drop complete blocks, and drop an unterminated trailing block so a
// half-finished thought never flashes into the rendered output.
// Isomorphic — no `server-only`, safe to import from client and server.
export function stripThinking(text: string): string {
  let out = text.replace(/<think>[\s\S]*?<\/think>/gi, "");
  const openIdx = out.search(/<think>/i);
  if (openIdx !== -1) out = out.slice(0, openIdx);
  return out;
}