Skip to content

Commit 95bba31

Browse files
committed
fix potential changing thread_id bug
1 parent fd0d3fd commit 95bba31

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bin/chat-chainlit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ async def chat_profiles() -> list[cl.ChatProfile]:
5757

5858
@cl.on_chat_start
5959
async def start() -> None:
60-
thread_id: str = cl.user_session.get("id")
61-
cl.user_session.set("thread_id", thread_id)
60+
if cl.user_session.get("thread_id") is None:
61+
cl.user_session.set("thread_id", cl.user_session.get("id"))
6262
await static_messages(config, TriggerEvent.on_chat_start)
6363

6464

0 commit comments

Comments
 (0)