repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import os |
| #2 | |
| #3 | import chainlit as cl |
| #4 | |
| #5 | from embedchain import App |
| #6 | |
| #7 | os.environ["OPENAI_API_KEY"] = "sk-xxx" |
| #8 | |
| #9 | |
| #10 | @cl.on_chat_start |
| #11 | async def on_chat_start(): |
| #12 | app = App.from_config( |
| #13 | config={ |
| #14 | "app": {"config": {"name": "chainlit-app"}}, |
| #15 | "llm": { |
| #16 | "config": { |
| #17 | "stream": True, |
| #18 | } |
| #19 | }, |
| #20 | } |
| #21 | ) |
| #22 | # import your data here |
| #23 | app.add("https://www.forbes.com/profile/elon-musk/") |
| #24 | app.collect_metrics = False |
| #25 | cl.user_session.set("app", app) |
| #26 | |
| #27 | |
| #28 | @cl.on_message |
| #29 | async def on_message(message: cl.Message): |
| #30 | app = cl.user_session.get("app") |
| #31 | msg = cl.Message(content="") |
| #32 | for chunk in await cl.make_async(app.chat)(message.content): |
| #33 | await msg.stream_token(chunk) |
| #34 | |
| #35 | await msg.send() |
| #36 |