| import chainlit as cl | |
| 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() | |
| 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() | |