diff --git a/builds/typescript/client_web/src/components/markdown/MarkdownContent.tsx b/builds/typescript/client_web/src/components/markdown/MarkdownContent.tsx index d2d5c77..30a37bd 100644 --- a/builds/typescript/client_web/src/components/markdown/MarkdownContent.tsx +++ b/builds/typescript/client_web/src/components/markdown/MarkdownContent.tsx @@ -26,10 +26,14 @@ function CopyButton({ code }: { code: string }) { } export default function MarkdownContent({ content }: { content: string }) { - // Strip / blocks that some models emit as text + // Strip tool-call XML blocks that some models/proxies emit as plain text + // Covers: , , , , const cleaned = content .replace(/[\s\S]*?<\/tool_call>/g, "") .replace(/[\s\S]*?<\/tool_response>/g, "") + .replace(/<\/?(?:antml:)?function_calls>[\s\S]*?(?:<\/(?:antml:)?function_calls>|$)/g, "") + .replace(/<(?:antml:)?invoke[\s\S]*?(?:<\/(?:antml:)?invoke>|$)/g, "") + .replace(/<(?:antml:)?parameter[\s\S]*?(?:<\/(?:antml:)?parameter>|$)/g, "") .trim(); return (