fix: 思考内容正确显示 - 判断thinking字段存在而非值
This commit is contained in:
@@ -1165,9 +1165,10 @@ function renderMessages() {
|
||||
|
||||
// 思考内容块(仅AI消息)
|
||||
let thinkingHtml = '';
|
||||
if (!isUser && msg.thinking) {
|
||||
// 判断是否是当前正在生成的消息(有thinking且content为空或很短)
|
||||
if (!isUser && 'thinking' in msg) {
|
||||
// 判断是否是当前正在生成的消息(有thinking字段且正在加载)
|
||||
const isGenerating = index === currentConversation.messages.length - 1 && isLoading && enableThinking;
|
||||
// 思考进行中且没有正式内容时展开
|
||||
const expandedClass = isGenerating && !msg.content ? 'expanded' : '';
|
||||
|
||||
thinkingHtml = `
|
||||
@@ -1177,7 +1178,7 @@ function renderMessages() {
|
||||
<span>思考过程</span>
|
||||
<svg class="thinking-arrow" viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M7 10l5 5 5-5z"/></svg>
|
||||
</div>
|
||||
<div class="thinking-content">${renderMarkdown(msg.thinking)}</div>
|
||||
<div class="thinking-content">${renderMarkdown(msg.thinking || '思考中...')}</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user