Skip to content

Commit

Permalink
Refactor for runtime performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Jan 11, 2024
1 parent ccab269 commit 9e300ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/bolt_listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ def respond_to_new_message(
context, parent_message
)

if is_thread_for_this_app is False:
return

messages = []
user_id = context.actor_user_id or context.user_id
last_assistant_idx = -1
Expand All @@ -313,9 +316,6 @@ def respond_to_new_message(
messages = maybe_new_messages
last_assistant_idx = idx

if is_thread_for_this_app is False:
return

if is_in_dm_with_bot is True or last_assistant_idx == -1:
# To know whether this app needs to start a new convo
if not next(filter(lambda msg: msg["role"] == "system", messages), None):
Expand Down

0 comments on commit 9e300ca

Please sign in to comment.