mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-18 01:06:38 +08:00
Merge abeccc4212
into 995bef73de
This commit is contained in:
commit
36ff1b97e9
@ -624,19 +624,13 @@ export function streamWithThink(
|
|||||||
if (!isInThinkingMode || isThinkingChanged) {
|
if (!isInThinkingMode || isThinkingChanged) {
|
||||||
// If this is a new thinking block or mode changed, add prefix
|
// If this is a new thinking block or mode changed, add prefix
|
||||||
isInThinkingMode = true;
|
isInThinkingMode = true;
|
||||||
if (remainText.length > 0) {
|
if (remainText.length > 0 && !remainText.endsWith("\n")) {
|
||||||
remainText += "\n";
|
remainText += "\n";
|
||||||
}
|
}
|
||||||
remainText += "> " + chunk.content;
|
remainText += "> ";
|
||||||
} else {
|
|
||||||
// Handle newlines in thinking content
|
|
||||||
if (chunk.content.includes("\n\n")) {
|
|
||||||
const lines = chunk.content.split("\n\n");
|
|
||||||
remainText += lines.join("\n\n> ");
|
|
||||||
} else {
|
|
||||||
remainText += chunk.content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// Append content, ensuring newlines are quoted
|
||||||
|
remainText += chunk.content.replace(/\n/g, "\n> ");
|
||||||
} else {
|
} else {
|
||||||
// If in normal mode
|
// If in normal mode
|
||||||
if (isInThinkingMode || isThinkingChanged) {
|
if (isInThinkingMode || isThinkingChanged) {
|
||||||
|
Loading…
Reference in New Issue
Block a user