Message
import chainlit as cl @cl.on_message async def main(message: cl.Message): await cl.Message( content=f"Received: {message.content}", ).send()
import chainlit as cl token_list = ["the", "quick", "brown", "fox"] @cl.on_chat_start async def main(): msg = cl.Message(content="") for token in token_list: await msg.stream_token(token) await msg.send()
import chainlit as cl @cl.on_chat_start async def main(): msg = cl.Message(content="Hello!") await msg.send() await cl.sleep(2) msg.content = "Hello again!" await msg.update()
import chainlit as cl @cl.on_chat_start async def main(): msg = cl.Message(content="Message 1") await msg.send() await cl.sleep(2) await msg.remove()
Was this page helpful?