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

17 lines
464 B
Python
Raw Normal View History

2024-05-03 14:17:59 +00:00
# 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()