nyasukun's picture
initial
8773015
raw
history blame contribute delete
696 Bytes
import chainlit as cl
@cl.on_chat_start
async def start():
"""
This function is called when a new chat starts.
You can use it to initialize any variables or models.
"""
# Initialize any variables or models here
await cl.Message(
content="Welcome to the chatbot! How can I help you today?"
).send()
@cl.on_message
async def main(message: str):
"""
This function is called every time a user inputs a message.
Args:
message: The user's message
"""
# Process the user's message here
response = f"You said: {message.content}"
# Send a response back to the user
await cl.Message(
content=response
).send()