Skip to content

Commit b9dd7ac

Browse files
committed
fix:修复支持functioncall的模型输出工具调用显示异常
1 parent 73a17ba commit b9dd7ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/resources/chatPanelScript.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,11 @@ async function renderMessage(role, content, index) {
298298
});
299299
ensureCopyButtons();
300300
hljs.highlightAll();
301-
} else {
301+
}
302+
else if (role === 'tool') {
303+
targetDiv.innerHTML = `<tool_call>${targetDiv.dataset.markdownContent}</tool_call>`;
304+
}
305+
else {
302306
targetDiv.innerHTML = `<button class="edit-btn">✎</button><div class="user-content">${targetDiv.dataset.markdownContent}</div>`;
303307
targetDiv.dataset.index = index;
304308
setupEditButtons();
@@ -413,7 +417,7 @@ function checkScrollIntent(isScrollingDown) {
413417
}
414418

415419
// 调试输出
416-
console.log(`方向: ${isScrollingDown ? '↓' : '↑'} | 距底部: ${distanceToBottom}px | 自动: ${autoScrollEnabled}`);
420+
// console.log(`方向: ${isScrollingDown ? '↓' : '↑'} | 距底部: ${distanceToBottom}px | 自动: ${autoScrollEnabled}`);
417421
}
418422

419423
// 智能滚动执行

0 commit comments

Comments
 (0)