Add thinking support for chat (#220)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2025-07-14 00:05:07 +08:00
1 parent 68ae661cf2
commit 4e5ef549ad
3 files changed
+22 -2

No files matched your search

+5 -2
View File
@@ -19,7 +19,7 @@ export default defineComponent({
}
},
setup(props, { attrs }) {
const md = new MarkdownIt(props.options).use(katex as any, {
const md = new MarkdownIt({ ...props.options, html: true }).use(katex as any, {
delimiters: 'all',
throwOnError: false,
errorColor: '#cc0000',
@@ -28,7 +28,10 @@ export default defineComponent({
const content = computed(() => {
const src = props.source;
return md?.render(src);
return md
?.render(src)
.replace(/<think>/g, `<div class="think">`)
.replace(/<\/think>/g, `</div>`);
});
return () =>