Prechádzať zdrojové kódy

历史对话显示调整

liuchengsen 3 týždňov pred
rodič
commit
0c5e80d05a
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      static/index.html

+ 2 - 1
static/index.html

@@ -427,7 +427,8 @@
     var w=document.getElementById('chat').querySelector('.welcome');if(w)w.remove();
     for(var i=0;i<msgs.length;i++){
       var m=msgs[i],div=document.createElement('div');
-      div.className='msg '+m.role;
+      var roleClass=m.role==='assistant'?'ai':m.role;
+      div.className='msg '+roleClass;
       if(m.role==='user'){div.textContent=m.content}
       else{ div.innerHTML = buildAiInnerHtml(m); }
       document.getElementById('chat').appendChild(div);