Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAUTURE]
argilla
: working with webhooks (#5502)
# Description <!-- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. --> This PR adds the `argilla.webhooks` module to work with webhooks from the SDK. With the changes on this PR, users can easily create webhook listeners using the python SDK. For example, listening changes can be defined as follows: ```python import argilla as rg @rg.webhook_listener(events="response.updated") async def on_response_updated(response: rg.UserResponse, **kwargs): ... # do your work @rg.webhook_listener(events=["dataset.created", "dataset.updated", "dataset.published"]) async def on_dataset_event( type: str, timestamp: datetime, dataset: rg.Dataset, **kwargs, ): print(f"Event type {type} at {timestamp}") print(dataset.settings) ``` You can find a fully basic example using webhooks [here](https://github.com/argilla-io/argilla/tree/feat/argilla/working-with-webhooks/examples/webhooks/basic-webhooks) This is still a draft PR and the final feature may change. Refs: #4658 **Type of change** <!-- Please delete options that are not relevant. Remember to title the PR according to the type of change --> - New feature (non-breaking change which adds functionality) **How Has This Been Tested** <!-- Please add some reference about how your feature has been tested. --> **Checklist** <!-- Please go over the list and make sure you've taken everything into account --> - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: David Berenstein <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sara Han <[email protected]> Co-authored-by: José Francisco Calvo <[email protected]>
- Loading branch information