omniscientframework / chainlit_app.py
NexusInstruments's picture
Create chainlit_app.py
346527c verified
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()