File tree Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 33app_ui  =  ui .page_fillable (
44    ui .panel_title ("Hello Shiny Chat" ),
55    ui .chat_ui ("chat" ),
6-     fillable_mobile = True ,
7- )
8- 
9- # Create a welcome message 
10- welcome  =  """ 
6+     ui .chat_ui (
7+         "chat" ,
8+         messages = [
9+             """ 
1110Hi! This is a simple Shiny `Chat` UI. Enter a message below and I will 
1211simply repeat it back to you. 
1312
1413To learn more about chatbots and how to build them with Shiny, check out 
1514[the documentation](https://shiny.posit.co/py/docs/genai-chatbots.html). 
1615""" 
16+         ],
17+     ),
18+     fillable_mobile = True ,
19+ )
1720
1821
1922def  server (input , output , session ):
20-     chat  =  ui .Chat (id = "chat" ,  messages = [ welcome ] )
23+     chat  =  ui .Chat (id = "chat" )
2124
2225    # Define a callback to run when the user submits a message 
2326    @chat .on_user_submit  
Original file line number Diff line number Diff line change 77    fillable_mobile = True ,
88)
99
10- # Create a welcome message 
11- welcome  =  """ 
10+ # Create a chat instance 
11+ chat  =  ui .Chat (id = "chat" )
12+ 
13+ # Display it, with a startup message 
14+ chat .ui (
15+     messages = [
16+         """ 
1217Hi! This is a simple Shiny `Chat` UI. Enter a message below and I will 
1318simply repeat it back to you. 
1419
1520To learn more about chatbots and how to build them with Shiny, check out 
1621[the documentation](https://shiny.posit.co/py/docs/genai-chatbots.html). 
1722""" 
18- 
19- # Create a chat instance 
20- chat  =  ui .Chat (
21-     id = "chat" ,
22-     messages = [welcome ],
23+     ],
2324)
2425
25- # Display it 
26- chat .ui ()
27- 
2826
2927# Define a callback to run when the user submits a message 
3028@chat .on_user_submit  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments