Skip to content

Commit 034ed42

Browse files
Merge pull request #20 from basedosdados/fix/thread-creation-check
fix: check for thread creation error only on thread creation
2 parents 52e59e6 + 0bd1181 commit 034ed42

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

frontend/components/chat_page.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,12 @@ def render(self):
338338

339339
# Create thread only in the first message
340340
if self.thread_id is None:
341-
created = self._create_thread_and_register(title=user_prompt)
342-
343-
if not created:
344-
# Setting this flag to False doesn't seem necessary here, but it might
345-
# prevent unexpected issues. Keeping it for safety until the underlying
346-
# behavior is better understood.
347-
st.session_state[self.waiting_key] = False
348-
return
341+
if not self._create_thread_and_register(title=user_prompt):
342+
# Setting this flag to False doesn't seem necessary here, but it might
343+
# prevent unexpected issues. Keeping it for safety until the underlying
344+
# behavior is better understood.
345+
st.session_state[self.waiting_key] = False
346+
return
349347

350348
message_pair = self.api.send_message(
351349
access_token=st.session_state["access_token"],

0 commit comments

Comments
 (0)