ai-station/.venv/lib/python3.12/site-packages/chainlit/sample/hello.py

13 lines
416 B
Python
Raw Permalink Normal View History

# This is a simple example of a chainlit app.
from chainlit import AskUserMessage, Message, on_chat_start
@on_chat_start
async def main():
res = await AskUserMessage(content="What is your name?", timeout=30).send()
if res:
await Message(
content=f"Your name is: {res['output']}.\nChainlit installation is working!\nYou can now start building your own chainlit apps!",
).send()