### Import Section ### | |
""" | |
IMPORTS HERE | |
""" | |
### Global Section ### | |
""" | |
GLOBAL CODE HERE | |
""" | |
# Initialize a language model or chain globally | |
llm = ChatOpenAI(temperature=0.9) | |
conversation_chain = ConversationChain(llm=llm) | |
# Any global variables like API keys, configurations, etc. | |
# API_KEY = "your_api_key_here" | |
### On Chat Start (Session Start) Section ### | |
async def on_chat_start(): | |
""" SESSION SPECIFIC CODE HERE """ | |
await cl.Message(content="Welcome! How can I assist you today?").send() | |
### Rename Chains ### | |
def rename(orig_author: str): | |
""" RENAME CODE HERE """ | |
### On Message Section ### | |
async def main(message: cl.Message): | |
""" | |
MESSAGE CODE HERE | |
""" |