Skip to content

Commit 108eba4

Browse files
committed
Import Chat from ui, not shinychat
1 parent c572df9 commit 108eba4

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

tests/playwright/shiny/components/chat/basic/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from shinychat.express import Chat
2-
31
from shiny.express import render, ui
42

53
# Set some Shiny page options
64
ui.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
1210
chat.ui(messages=["Hello! How can I help you today?"])

tests/playwright/shiny/components/chat/icon/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from pathlib import Path
33

44
import faicons
5-
from shinychat.express import Chat
65

76
from shiny.express import app_opts, input, ui
87

@@ -12,7 +11,7 @@
1211

1312
with 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")

tests/playwright/shiny/components/chat/input-suggestion/app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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

53
suggestions1 = """
64
<p>Here is the <span id="first" class='suggestion'>1st input suggestion</span>.
@@ -13,7 +11,7 @@
1311
And <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

1816
chat.ui(messages=[suggestions1, suggestion2])
1917

tests/playwright/shiny/components/chat/shiny_input/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from shinychat.express import Chat
2-
31
from shiny import reactive
42
from shiny.express import input, ui
53

@@ -18,7 +16,7 @@
1816
),
1917
)
2018

21-
chat = Chat(id="chat")
19+
chat = ui.Chat(id="chat")
2220
chat.ui(
2321
class_="mb-5",
2422
messages=[welcome],

tests/playwright/shiny/components/chat/shiny_output/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import ipyleaflet as ipyl # pyright: ignore[reportMissingTypeStubs]
22
import pandas as pd
33
import plotly.express as px # pyright: ignore[reportMissingTypeStubs]
4-
from shinychat.express import Chat
54
from shinywidgets import render_plotly, render_widget
65

76
from 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

2524
chat.ui(messages=[map_ui])
2625

0 commit comments

Comments
 (0)