@ynhcj/xiaoyi-channel 0.0.156-next → 0.0.157-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -410,11 +410,10 @@ export function createXYReplyDispatcher(params) {
|
|
|
410
410
|
if (text.length > 0) {
|
|
411
411
|
// 🔑 检测是否是新一轮思考:当前text比上一次短,或不以上次内容开头
|
|
412
412
|
const isNewRound = lastReasoningText.length > 0 &&
|
|
413
|
-
|
|
413
|
+
text.length < lastReasoningText.length;
|
|
414
414
|
if (isNewRound) {
|
|
415
415
|
// 将上一轮思考追加到历史
|
|
416
416
|
accumulatedReasoningHistory += (accumulatedReasoningHistory ? "\n\n" : "") + lastReasoningText;
|
|
417
|
-
scopedLog().log(`[onReasoningStream] new round detected, lastReasoningText: ${lastReasoningText.substring(0, 100)}, text: ${text.substring(0, 100)}`);
|
|
418
417
|
}
|
|
419
418
|
// 更新当前轮最后一次text
|
|
420
419
|
lastReasoningText = text;
|
|
@@ -453,6 +452,7 @@ export function createXYReplyDispatcher(params) {
|
|
|
453
452
|
if (isNewRound) {
|
|
454
453
|
// 将上一轮回复追加到历史
|
|
455
454
|
accumulatedReplyHistory += (accumulatedReplyHistory ? "\n\n" : "") + lastReplyText;
|
|
455
|
+
scopedLog().log(`[onPartialReply] new round detected, lastReplyText: ${lastReplyText.substring(0, 100)}, text: ${text.substring(0, 100)}`);
|
|
456
456
|
}
|
|
457
457
|
// 更新当前轮最后一次text
|
|
458
458
|
lastReplyText = text;
|