This repository has been archived on 2024-08-28. You can view files and clone it, but cannot push or open issues or pull requests.
crew-ai-codecollection/panel_test.py
2024-05-03 16:17:59 +02:00

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()