Merged
Conversation
…ight/python-sdk into create_multiple_actions_on_alert
…ight/python-sdk into create_multiple_actions_on_alert
brandon-wada
commented
Jan 10, 2025
| and not isinstance(result, MultiClassificationResult) | ||
| ): | ||
| return False | ||
| if not is_valid_display_label(result.label): |
Collaborator
Author
There was a problem hiding this comment.
separate change that needed to get in to support different result types
f-wright
approved these changes
Jan 10, 2025
Contributor
f-wright
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Suggested change
| :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. |
Contributor
There was a problem hiding this comment.
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. |
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) |
Contributor
There was a problem hiding this comment.
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) |
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 |
Contributor
There was a problem hiding this comment.
Suggested change
| :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 |
Contributor
There was a problem hiding this comment.
Suggested change
| # Create an action for a rule | |
| # Create an action |
added 2 commits
January 10, 2025 15:50
…ight/python-sdk into create_multiple_actions_on_alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.