mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Display Think for Deepseek R1 model #4903 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -20,9 +20,10 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for you
|
||||
|
||||
import { preprocessLaTeX } from '@/utils/chat';
|
||||
import { preprocessLaTeX, replaceThinkToSection } from '@/utils/chat';
|
||||
import { replaceTextByOldReg } from '../utils';
|
||||
|
||||
import { pipe } from 'lodash/fp';
|
||||
import styles from './index.less';
|
||||
|
||||
const reg = /(~{2}\d+={2})/g;
|
||||
@ -50,7 +51,9 @@ const MarkdownContent = ({
|
||||
text = t('chat.searching');
|
||||
}
|
||||
const nextText = replaceTextByOldReg(text);
|
||||
return loading ? nextText?.concat('~~2$$') : preprocessLaTeX(nextText);
|
||||
return loading
|
||||
? nextText?.concat('~~2$$')
|
||||
: pipe(replaceThinkToSection, preprocessLaTeX)(nextText);
|
||||
}, [content, loading, t]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user