Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves error handling, logging, and messaging in Slack plugin #5288

Merged
merged 6 commits into from
Oct 4, 2024

Conversation

mvilanova
Copy link
Contributor

This pull request includes several updates to the dispatch_slack plugin to improve the handling of case messages, specifically around signal analysis and action buttons. The most important changes include updating function arguments to use case objects instead of case_id, enhancing the GenAI signal analysis message generation, and improving error handling and logging.

Updates to function arguments and imports:

  • Changed function arguments from case_id to case to streamline data handling and improve code readability in create_signal_message, create_action_buttons_message, and create_genai_signal_analysis_message functions. (src/dispatch/plugins/dispatch_slack/case/messages.py) [1] [2] [3]
  • Added case_service import to facilitate fetching case details. (src/dispatch/plugins/dispatch_slack/case/messages.py)

Enhancements to GenAI signal analysis:

  • Improved the GenAI signal analysis message generation by checking if signal instances exist and if the GenAI feature is enabled for the detection. Added detailed logging and error handling for better traceability. (src/dispatch/plugins/dispatch_slack/case/messages.py) [1] [2] [3]
  • Enhanced the generation of historical context by increasing the number of relevant messages fetched and included in the analysis. (src/dispatch/plugins/dispatch_slack/case/messages.py)
  • Added checks for the GenAI plugin's availability and prompt before generating the analysis. Improved logging to capture the plugin's response. (src/dispatch/plugins/dispatch_slack/case/messages.py)

Error handling and logging improvements:

  • Improved error handling and logging for GenAI signal analysis message generation to ensure any issues are properly logged and communicated. (src/dispatch/plugins/dispatch_slack/case/messages.py) [1] [2]
  • Updated the create_threaded function to handle potential errors when generating GenAI signal analysis messages and ensure the correct timestamp is used. (src/dispatch/plugins/dispatch_slack/plugin.py) [1] [2] [3]

@mvilanova mvilanova requested a review from wssheldon October 4, 2024 01:49
@mvilanova mvilanova added the enhancement New feature or request label Oct 4, 2024
@mvilanova mvilanova requested a review from whitdog47 October 4, 2024 01:56
@mvilanova mvilanova merged commit 2982a35 into master Oct 4, 2024
7 checks passed
@mvilanova mvilanova deleted the bugfixes/genai branch October 4, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants