File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed 
workshop-ui/src/components/chat Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import styles from "./Message.module.css"
1010import  {  getOutputFromChildren ,  getScriptContentFromChildren ,  hashString  }  from  "@/lib/utility" ; 
1111import  Callout  from  "@/components/Callout" ; 
1212import  CodeHighlight  from  "@/components/CodeHighlight" ; 
13- import  {  randomUUID  }  from  "crypto" ; 
1413
1514export  type  Message  =  TextMessage  |  HtmlMessage ; 
1615
@@ -46,9 +45,8 @@ export default memo(function Message({
4645        code ( props : any )  { 
4746            const  {  children,  className }  =  props ; 
4847            const  language  =  className ?. includes ( 'language-' )  ? className  : '' ; 
49-             const  key  =  `code-${ hashString ( children  ||  randomUUID ( ) ) }  ` ; 
50- 
51-             if  ( children . startsWith ( '<|TOOL_CODE_INTERPRETER|>' ) )  { 
48+             const  key  =  `code-${ hashString ( children  ||  crypto . randomUUID ( ) ) }  ` ; 
49+             if  ( children ?. startsWith ( '<|TOOL_CODE_INTERPRETER|>' ) )  { 
5250                const  text  =  children ; 
5351                const  content  =  getScriptContentFromChildren ( text . replace ( '<|TOOL_CODE_INTERPRETER|>' ,  '' ) . split ( '<|OUTPUT|>' ) [ 0 ] . trim ( ) ) ; 
5452                const  output  =  getOutputFromChildren ( text . split ( '<|OUTPUT|>' ) [ 1 ] ?. trim ( )  ||  null ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments