File tree Expand file tree Collapse file tree 5 files changed +7
-15
lines changed
tests/playwright/shiny/components/chat Expand file tree Collapse file tree 5 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 1- from shinychat .express import Chat
2-
31from shiny .express import render , ui
42
53# Set some Shiny page options
64ui .page_opts (title = "Hello Chat" )
75
86# Create a chat instance, with an initial message
9- chat = Chat (id = "chat" )
7+ chat = ui . Chat (id = "chat" )
108
119# Display the chat
1210chat .ui (messages = ["Hello! How can I help you today?" ])
Original file line number Diff line number Diff line change 22from pathlib import Path
33
44import faicons
5- from shinychat .express import Chat
65
76from shiny .express import app_opts , input , ui
87
1211
1312with ui .layout_columns ():
1413 # Default Bot ---------------------------------------------------------------------
15- chat_default = Chat (id = "chat_default" )
14+ chat_default = ui . Chat (id = "chat_default" )
1615
1716 with ui .div ():
1817 ui .h2 ("Default Bot" )
@@ -27,7 +26,7 @@ async def handle_user_input_default(user_input: str):
2726 await chat_default .append_message (f"You said: { user_input } " )
2827
2928 # Animal Bot ----------------------------------------------------------------------
30- chat_animal = Chat (id = "chat_animal" )
29+ chat_animal = ui . Chat (id = "chat_animal" )
3130
3231 with ui .div ():
3332 ui .h2 ("Animal Bot" )
Original file line number Diff line number Diff line change 1- from shinychat .express import Chat
2-
3- import shiny .express # type: ignore[reportUnusedImport] # noqa: F401
1+ from shiny .express import ui # type: ignore[reportUnusedImport] # noqa: F401
42
53suggestions1 = """
64<p>Here is the <span id="first" class='suggestion'>1st input suggestion</span>.
1311And <span id="fifth" data-suggestion="another suggestion" data-suggestion-submit="true">this suggestion will also auto-submit</span>.</p>
1412"""
1513
16- chat = Chat ("chat" )
14+ chat = ui . Chat ("chat" )
1715
1816chat .ui (messages = [suggestions1 , suggestion2 ])
1917
Original file line number Diff line number Diff line change 1- from shinychat .express import Chat
2-
31from shiny import reactive
42from shiny .express import input , ui
53
1816 ),
1917)
2018
21- chat = Chat (id = "chat" )
19+ chat = ui . Chat (id = "chat" )
2220chat .ui (
2321 class_ = "mb-5" ,
2422 messages = [welcome ],
Original file line number Diff line number Diff line change 11import ipyleaflet as ipyl # pyright: ignore[reportMissingTypeStubs]
22import pandas as pd
33import plotly .express as px # pyright: ignore[reportMissingTypeStubs]
4- from shinychat .express import Chat
54from shinywidgets import render_plotly , render_widget
65
76from shiny import reactive , render
@@ -20,7 +19,7 @@ def map():
2019 return ipyl .Map (center = (52 , 10 ), zoom = 8 )
2120
2221
23- chat = Chat (id = "chat" )
22+ chat = ui . Chat (id = "chat" )
2423
2524chat .ui (messages = [map_ui ])
2625
You can’t perform that action at this time.
0 commit comments