Skip to content

Commit

Permalink
Merge branch 'webhooks-for-alerts-v2' of https://github.com/groundlig…
Browse files Browse the repository at this point in the history
…ht/python-sdk into webhooks-for-alerts-v2
  • Loading branch information
f-wright committed Jan 18, 2025
2 parents 1d01177 + 6fb8d7a commit 2676495
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/groundlight/experimental_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def create_alert( # pylint: disable=too-many-locals # noqa: PLR0913
:param name: A unique name to identify this alert
:param condition: The condition to use for the alert
:param actions: The actions to use for the alert. Optional if webhook_actions are provided (default None)
:param webhook_actions: The webhook actions to use for the alert. Optional if actions are provided (default
:param webhook_actions: The webhook actions to use for the alert. Optional if actions are provided (default
None)
:param enabled: Whether the alert should be active when created (default True)
:param snooze_time_enabled: Enable notification snoozing to prevent alert spam (default False)
Expand Down
4 changes: 1 addition & 3 deletions test/unit/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def test_create_alert_multiple_webhook_actions(gl_experimental: ExperimentalApi)
webhook_action_1 = gl_experimental.make_webhook_action("https://groundlight.ai", include_image=True)
webhook_action_2 = gl_experimental.make_webhook_action("https://example.com/webhook", include_image=False)
webhook_actions = [webhook_action_1, webhook_action_2]
alert = gl_experimental.create_alert(
det, f"test_alert_{name}", condition, webhook_actions=webhook_actions
)
alert = gl_experimental.create_alert(det, f"test_alert_{name}", condition, webhook_actions=webhook_actions)
assert len(alert.webhook_action) == len(webhook_actions)
assert len(alert.action.root) == 0

Expand Down

0 comments on commit 2676495

Please sign in to comment.