perf: skip processChineseContent for non-Chinese content (#23162)
This commit is contained in:
@@ -103,6 +103,7 @@ function isChineseChar(char: string): boolean {
|
||||
// Tackle "Model output issue not following the standard Markdown/LaTeX format" in Chinese.
|
||||
function processChineseContent(content: string): string {
|
||||
// This function is used to process the response content before the response content is rendered.
|
||||
if (!/[\u4e00-\u9fa5]/.test(content)) return content;
|
||||
const lines = content.split('\n');
|
||||
const processedLines = lines.map((line) => {
|
||||
if (/[\u4e00-\u9fa5]/.test(line)) {
|
||||
|
||||
Reference in New Issue
Block a user