17 lines
464 B
Python
17 lines
464 B
Python
# start with the following comando: panel serve panel_test.py
|
|
|
|
import panel as pn
|
|
|
|
pn.extension(design="material")
|
|
|
|
def callback(contents: str, user: str, instance: pn.chat.ChatInterface):
|
|
message = f"Echoing {user}: {contents}"
|
|
return message
|
|
|
|
chat_interface = pn.chat.ChatInterface(callback=callback)
|
|
chat_interface.send(
|
|
"Enter a message in the TextInput below and receive an echo!",
|
|
user="System",
|
|
respond=False,
|
|
)
|
|
chat_interface.servable() |