perf: skip processChineseContent for non-Chinese content (#23162)

This commit is contained in:
Algorithm5838
2026-04-01 05:34:50 -05:00
committed by GitHub
parent b898fc0258
commit 354a179f6d
+1
View File
@@ -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)) {