Spaces:
Running
Running
Commit
·
92fb19f
1
Parent(s):
34c71d7
Add some css to make it look like whatsapp
Browse files
app.py
CHANGED
@@ -33,9 +33,12 @@ def add_chunk_to_ai_message(chunk: str):
|
|
33 |
|
34 |
@solara.component
|
35 |
def Page():
|
36 |
-
|
37 |
-
|
38 |
-
solara.
|
|
|
|
|
|
|
39 |
user_message_count = len([m for m in messages.value if m["role"] == "user"])
|
40 |
|
41 |
def send(message):
|
@@ -55,8 +58,8 @@ def Page():
|
|
55 |
|
56 |
result = solara.lab.use_task(result, dependencies=[user_message_count]) # type: ignore
|
57 |
|
58 |
-
with solara.Column(
|
59 |
-
with solara.lab.ChatBox():
|
60 |
for item in messages.value:
|
61 |
with solara.lab.ChatMessage(
|
62 |
user=item["role"] == "user",
|
@@ -65,4 +68,4 @@ def Page():
|
|
65 |
border_radius="20px",
|
66 |
):
|
67 |
solara.Markdown(item["content"])
|
68 |
-
solara.lab.ChatInput(send_callback=send)
|
|
|
33 |
|
34 |
@solara.component
|
35 |
def Page():
|
36 |
+
title = "StreamBot"
|
37 |
+
with solara.Head():
|
38 |
+
solara.Title(f"{title}")
|
39 |
+
with solara.Column(align="center"):
|
40 |
+
solara.Markdown(f"#{title}")
|
41 |
+
|
42 |
user_message_count = len([m for m in messages.value if m["role"] == "user"])
|
43 |
|
44 |
def send(message):
|
|
|
58 |
|
59 |
result = solara.lab.use_task(result, dependencies=[user_message_count]) # type: ignore
|
60 |
|
61 |
+
with solara.Column(align="center"):
|
62 |
+
with solara.lab.ChatBox(style={"position": "fixed", "bottom": "10rem", "width": "70%"}):
|
63 |
for item in messages.value:
|
64 |
with solara.lab.ChatMessage(
|
65 |
user=item["role"] == "user",
|
|
|
68 |
border_radius="20px",
|
69 |
):
|
70 |
solara.Markdown(item["content"])
|
71 |
+
solara.lab.ChatInput(send_callback=send, style={"position": "fixed", "bottom": "3rem", "width": "70%"})
|