Skip to content

Conversation

@brandon-wada
Copy link
Collaborator

A followup for later, we will completely replace 'rule' with 'alert'. Once renamed we can move alert functions into the standard client. This requires a bit of backend modelling updates.

I'm not a huge fan of root as the attribute of ActionList, but that matches the style of datamodel-codegen.

and not isinstance(result, MultiClassificationResult)
):
return False
if not is_valid_display_label(result.label):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate change that needed to get in to support different result types

@brandon-wada brandon-wada requested a review from f-wright January 10, 2025 23:26
Copy link
Contributor

@f-wright f-wright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a few suggestions to remove references to rules in the new create_alert function. If we're switching to use exclusively "alert", that seems like it could become confusing.

:param channel: The notification channel to use. One of "EMAIL" or "TEXT"
:param recipient: The email address or phone number to send notifications to
:param include_image: Whether to include the triggering image in notifications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param include_image: Whether to include the triggering image in notifications
:param include_image: Whether to include the triggering image in alerts

such as when a detector's prediction changes or maintains a particular state.
.. note::
Currently, only binary mode detectors (YES/NO answers) are supported for notification rules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently, only binary mode detectors (YES/NO answers) are supported for notification rules.
Currently, only binary mode detectors (YES/NO answers) are supported for alerts.

:param detector: The detector ID or Detector object to add the rule to
:param name: A unique name to identify this rule
:param enabled: Whether the rule should be active when created (default True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param enabled: Whether the rule should be active when created (default True)
:param enabled: Whether the alert should be active when created (default True)

)
:param detector: The detector ID or Detector object to add the rule to
:param name: A unique name to identify this rule
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param name: A unique name to identify this rule
:param name: A unique name to identify this alert

gl = ExperimentalApi()
# Create an action for a rule
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Create an action for a rule
# Create an action

brandon added 2 commits January 10, 2025 15:50
…ight/python-sdk into create_multiple_actions_on_alert
@brandon-wada brandon-wada merged commit c849543 into main Jan 13, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants