Aasher commited on
Commit
175ac2f
Β·
1 Parent(s): d7e1a69

Fix: Chainlit Step removed

Browse files
Files changed (3) hide show
  1. app.py +1 -7
  2. chainlit.md +14 -0
  3. uv.lock +0 -0
app.py CHANGED
@@ -2,7 +2,7 @@
2
  import chainlit as cl
3
  from agent import make_graph
4
 
5
- from langchain_core.messages import AIMessageChunk, ToolMessage
6
  import uuid
7
 
8
  @cl.on_chat_start
@@ -12,8 +12,6 @@ async def on_chat_start():
12
 
13
  cl.user_session.set("thread_id", thread_id)
14
 
15
- await cl.Message(content="Hello! You can start chatting with the AI.").send()
16
-
17
  @cl.on_message
18
  async def on_message(message: cl.Message):
19
  agent = cl.user_session.get("agent") # Retrieve the agent from user session
@@ -30,10 +28,6 @@ async def on_message(message: cl.Message):
30
 
31
  if isinstance(stream, AIMessageChunk) and stream.content:
32
  await msg.stream_token(stream.content)
33
- elif isinstance(stream, ToolMessage) and stream.content:
34
- async with cl.Step(type="tool") as step:
35
-
36
- step.output = stream.content
37
 
38
  await msg.send()
39
 
 
2
  import chainlit as cl
3
  from agent import make_graph
4
 
5
+ from langchain_core.messages import AIMessageChunk
6
  import uuid
7
 
8
  @cl.on_chat_start
 
12
 
13
  cl.user_session.set("thread_id", thread_id)
14
 
 
 
15
  @cl.on_message
16
  async def on_message(message: cl.Message):
17
  agent = cl.user_session.get("agent") # Retrieve the agent from user session
 
28
 
29
  if isinstance(stream, AIMessageChunk) and stream.content:
30
  await msg.stream_token(stream.content)
 
 
 
 
31
 
32
  await msg.send()
33
 
chainlit.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to Chainlit! πŸš€πŸ€–
2
+
3
+ Hi there, Developer! πŸ‘‹ We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs.
4
+
5
+ ## Useful Links πŸ”—
6
+
7
+ - **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) πŸ“š
8
+ - **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/k73SQ3FyUh) to ask questions, share your projects, and connect with other developers! πŸ’¬
9
+
10
+ We can't wait to see what you create with Chainlit! Happy coding! πŸ’»πŸ˜Š
11
+
12
+ ## Welcome screen
13
+
14
+ To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.
uv.lock ADDED
The diff for this file is too large to render. See raw diff