Skip to content

Commit 7f6afaa

Browse files
committed
refactor: completion running check for generate title method
1 parent faaa79b commit 7f6afaa

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

basilisk/gui/conversation_tab.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
MessageRoleEnum,
3737
SystemMessage,
3838
)
39-
from basilisk.decorators import ensure_no_task_running
4039
from basilisk.provider_ai_model import ProviderAIModel
4140
from basilisk.provider_capability import ProviderCapability
4241
from basilisk.sound_manager import play_sound, stop_sound
@@ -683,7 +682,6 @@ def on_stop_completion(self, event: wx.CommandEvent):
683682
"""
684683
self.completion_handler.stop_completion()
685684

686-
@ensure_no_task_running
687685
def generate_conversation_title(self):
688686
"""Generate a title for the conversation tab by using the AI model to analyze the conversation content.
689687
@@ -692,6 +690,15 @@ def generate_conversation_title(self):
692690
Returns:
693691
A generated conversation title if successful, or None if title generation fails.
694692
"""
693+
if self.completion_handler.is_running():
694+
wx.MessageBox(
695+
_(
696+
"A completion is already in progress. Please wait until it finishes."
697+
),
698+
_("Error"),
699+
wx.OK | wx.ICON_ERROR,
700+
)
701+
return
695702
if not self.conversation.messages:
696703
return
697704
model = self.current_model

0 commit comments

Comments
 (0)