File size: 435 Bytes
220a7fc
393e1ec
220a7fc
 
 
3a2f547
67bc0df
 
 
3a2f547
220a7fc
 
393e1ec
d40a83a
393e1ec
d40a83a
b256d24
393e1ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import chainlit as cl
from extract_app import extract_information


@cl.on_chat_start
def start():
    """
    This is called when the Chainlit chat is started!
    """
    cl.Message("Welcome to the information extraction chat!")

@cl.on_message
def main(message: cl.Message):
    """
    This is called when a message is received!
    """
    res = extract_information().invoke({"input": message})["text"]
    cl.Message(content=res)