File tree Expand file tree Collapse file tree 5 files changed +6
-14
lines changed
tests/playwright/shiny/components/chat Expand file tree Collapse file tree 5 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 1
- from shinychat .express import Chat
2
-
3
1
from shiny .express import render , ui
4
2
5
3
# Set some Shiny page options
6
4
ui .page_opts (title = "Hello Chat" )
7
5
8
6
# Create a chat instance, with an initial message
9
- chat = Chat (id = "chat" )
7
+ chat = ui . Chat (id = "chat" )
10
8
11
9
# Display the chat
12
10
chat .ui (messages = ["Hello! How can I help you today?" ])
Original file line number Diff line number Diff line change 2
2
from pathlib import Path
3
3
4
4
import faicons
5
- from shinychat .express import Chat
6
5
7
6
from shiny .express import app_opts , input , ui
8
7
12
11
13
12
with ui .layout_columns ():
14
13
# Default Bot ---------------------------------------------------------------------
15
- chat_default = Chat (id = "chat_default" )
14
+ chat_default = ui . Chat (id = "chat_default" )
16
15
17
16
with ui .div ():
18
17
ui .h2 ("Default 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
4
2
5
3
suggestions1 = """
6
4
<p>Here is the <span id="first" class='suggestion'>1st input suggestion</span>.
13
11
And <span id="fifth" data-suggestion="another suggestion" data-suggestion-submit="true">this suggestion will also auto-submit</span>.</p>
14
12
"""
15
13
16
- chat = Chat ("chat" )
14
+ chat = ui . Chat ("chat" )
17
15
18
16
chat .ui (messages = [suggestions1 , suggestion2 ])
19
17
Original file line number Diff line number Diff line change 1
- from shinychat .express import Chat
2
-
3
1
from shiny import reactive
4
2
from shiny .express import input , ui
5
3
18
16
),
19
17
)
20
18
21
- chat = Chat (id = "chat" )
19
+ chat = ui . Chat (id = "chat" )
22
20
chat .ui (
23
21
class_ = "mb-5" ,
24
22
messages = [welcome ],
Original file line number Diff line number Diff line change 1
1
import ipyleaflet as ipyl # pyright: ignore[reportMissingTypeStubs]
2
2
import pandas as pd
3
3
import plotly .express as px # pyright: ignore[reportMissingTypeStubs]
4
- from shinychat .express import Chat
5
4
from shinywidgets import render_plotly , render_widget
6
5
7
6
from shiny import reactive , render
@@ -20,7 +19,7 @@ def map():
20
19
return ipyl .Map (center = (52 , 10 ), zoom = 8 )
21
20
22
21
23
- chat = Chat (id = "chat" )
22
+ chat = ui . Chat (id = "chat" )
24
23
25
24
chat .ui (messages = [map_ui ])
26
25
You can’t perform that action at this time.
0 commit comments