优化聊天记录
This commit is contained in:
parent
eea635e7bd
commit
98e9cf72e7
@ -149,9 +149,7 @@
|
||||
if (!text || text.trim() === '') return;
|
||||
|
||||
// 判断是否是思考内容
|
||||
const isThinking = text.includes('<think>') ||
|
||||
(this.messages[this.messages.length - 1]?.type === 'thinking');
|
||||
|
||||
const isThinking = text.includes('<think>') ||(this.messages[this.messages.length - 1]?.type === 'thinking');
|
||||
if (isThinking) {
|
||||
this.handleThinkingContent(text);
|
||||
} else {
|
||||
@ -209,7 +207,7 @@
|
||||
if (this.messages.length > 0) {
|
||||
const lastMsg = this.messages[this.messages.length - 1];
|
||||
lastMsg.isComplete = true;
|
||||
|
||||
lastMsg.isTyping=false
|
||||
// 如果最后一条是思考消息,我们不需要额外处理
|
||||
if (lastMsg.type === 'thinking') {
|
||||
return;
|
||||
@ -267,7 +265,7 @@
|
||||
success: () => {
|
||||
console.log('消息发送成功');
|
||||
// 添加机器人正在输入的提示
|
||||
this.addMessage('bot', '思考中...', true);
|
||||
this.addMessage('bot', '思考中...','thinking',true);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('消息发送失败', err);
|
||||
@ -374,6 +372,7 @@
|
||||
.message-text {
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.chat-input {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user