diff --git a/src/dispatch/plugins/dispatch_slack/case/messages.py b/src/dispatch/plugins/dispatch_slack/case/messages.py index d604fd3720a0..aedf77be8f3c 100644 --- a/src/dispatch/plugins/dispatch_slack/case/messages.py +++ b/src/dispatch/plugins/dispatch_slack/case/messages.py @@ -287,7 +287,9 @@ def create_action_buttons_message( return Message(blocks=signal_metadata_blocks).build()["blocks"] -def create_genai_signal_message_metadata_blocks(signal_metadata_blocks: list[Block], message: str) -> list[Block]: +def create_genai_signal_message_metadata_blocks( + signal_metadata_blocks: list[Block], message: str +) -> list[Block]: signal_metadata_blocks.append( Section(text=f":magic_wand: *GenAI Alert Analysis*\n\n{message}"), ) @@ -326,7 +328,7 @@ def create_genai_signal_analysis_message( if not first_instance_id or not first_instance_signal: message = "Unable to generate GenAI signal analysis. No signal instances found." log.warning(message) - return create_signal_metadata_blocks(signal_metadata_blocks, message) + return create_genai_signal_message_metadata_blocks(signal_metadata_blocks, message) # Fetch related cases related_cases = [] @@ -383,12 +385,12 @@ def create_genai_signal_analysis_message( "Unable to generate GenAI signal analysis. No artificial-intelligence plugin enabled." ) log.warning(message) - return create_signal_metadata_blocks(signal_metadata_blocks, message) + return create_genai_signal_message_metadata_blocks(signal_metadata_blocks, message) if not signal_instance.signal.genai_prompt: message = f"Unable to generate GenAI signal analysis. No GenAI prompt defined for {signal_instance.signal.name}" log.warning(message) - return create_signal_metadata_blocks(signal_metadata_blocks, message) + return create_genai_signal_message_metadata_blocks(signal_metadata_blocks, message) response = genai_plugin.instance.chat_completion( prompt=f""" @@ -416,7 +418,7 @@ def create_genai_signal_analysis_message( message = "Unable to generate GenAI signal analysis. We received an empty response from the artificial-intelligence plugin." log.warning(message) - return create_signal_metadata_blocks(signal_metadata_blocks, message) + return create_genai_signal_message_metadata_blocks(signal_metadata_blocks, message) def create_signal_engagement_message(