File size: 652 Bytes
346527c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import chainlit as cl
import sys, os

# ─── Ensure utils/ is importable ──────────────────────────────
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
if ROOT_PATH not in sys.path:
    sys.path.insert(0, ROOT_PATH)

from utils.backend import run_llm

@cl.on_chat_start
async def start():
    await cl.Message(content="Hello 👋, I’m Omniscient! Ask me anything about logs, files, or scripts.").send()

@cl.on_message
async def main(message: cl.Message):
    ai_input = message.content
    reply = run_llm(ai_input)

    # Send reply
    await cl.Message(content=reply).send()