Spaces:
Sleeping
Sleeping
File size: 531 Bytes
9253faf 78fb5d7 9253faf 78fb5d7 85824c0 78fb5d7 9253faf 78fb5d7 9253faf 78fb5d7 9253faf 78fb5d7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import chainlet as cl
import sys
sys.path.append(".")
from earnings_app import extract_information
@cl.on_chat_start
async def start():
cl.user_session.set("chain", extract_information())
await cl.Message(content="Welcome to Earnings chat!").send()
@cl.on_message
async def main(message: cl.Message):
chain = cl.user_session.get("chain")
res = chain.chat(message)
# res = await chain.aiinvoke({"input": message})
# res = res["text"]
out = ''.join(str(res))
await cl.Message(content=out).send()
|