@@ -191,24 +191,27 @@ const MessageBubble = defineComponent({
191191 } ,
192192 splitMsgContent ( ) {
193193 const content = this . msg . content ;
194- if ( this . msg . role !== ' assistant' ) {
195- return { content} ;
194+ if ( this . msg . role !== " assistant" ) {
195+ return { content } ;
196196 }
197- let actualContent = '' ;
198- let cot = '' ;
199- let thinkSplit = content . split ( "<think>" , 2 ) ;
197+ let actualContent = "" ;
198+ let cot = "" ;
199+ let isThinking = false ;
200+ let thinkSplit = content . split ( "<think>" , 2 ) ;
200201 actualContent += thinkSplit [ 0 ] ;
201- while ( thinkSplit [ 1 ] !== undefined ) {
202+ while ( thinkSplit [ 1 ] !== undefined ) {
202203 // <think> tag found
203- thinkSplit = thinkSplit [ 1 ] . split ( "</think>" , 2 ) ;
204- cot += thinkSplit [ 0 ] ;
205- if ( thinkSplit [ 1 ] !== undefined ) {
204+ thinkSplit = thinkSplit [ 1 ] . split ( "</think>" , 2 ) ;
205+ cot += thinkSplit [ 0 ] ;
206+ isThinking = true ;
207+ if ( thinkSplit [ 1 ] !== undefined ) {
206208 // </think> closing tag found
207- thinkSplit = thinkSplit [ 1 ] . split ( "<think>" , 2 ) ;
208- actualContent += thinkSplit [ 0 ] ;
209+ isThinking = false ;
210+ thinkSplit = thinkSplit [ 1 ] . split ( "<think>" , 2 ) ;
211+ actualContent += thinkSplit [ 0 ] ;
209212 }
210213 }
211- return { content : actualContent , cot } ;
214+ return { content : actualContent , cot , isThinking } ;
212215 } ,
213216 } ,
214217 methods : {
0 commit comments