-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Create multiple actions on alert #302
Conversation
…ight/python-sdk into create_multiple_actions_on_alert
…ight/python-sdk into create_multiple_actions_on_alert
@@ -37,7 +37,8 @@ def is_valid_display_result(result: Any) -> bool: | |||
and not isinstance(result, MultiClassificationResult) | |||
): | |||
return False | |||
if not is_valid_display_label(result.label): |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
src/groundlight/experimental_api.py
Outdated
|
||
: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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:param include_image: Whether to include the triggering image in notifications | |
:param include_image: Whether to include the triggering image in alerts |
src/groundlight/experimental_api.py
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
src/groundlight/experimental_api.py
Outdated
|
||
: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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:param enabled: Whether the rule should be active when created (default True) | |
:param enabled: Whether the alert should be active when created (default True) |
src/groundlight/experimental_api.py
Outdated
) | ||
|
||
:param detector: The detector ID or Detector object to add the rule to | ||
:param name: A unique name to identify this rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:param name: A unique name to identify this rule | |
:param name: A unique name to identify this alert |
src/groundlight/experimental_api.py
Outdated
|
||
gl = ExperimentalApi() | ||
|
||
# Create an action for a rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Create an action for a rule | |
# Create an action |
…ight/python-sdk into create_multiple_actions_on_alert
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.