You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdk/plugins.md
+28-11Lines changed: 28 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,19 @@ plugin_folder
19
19
|__ helper.py
20
20
```
21
21
22
-
The plugin you are going to upload has to contain a `class PluginHandler(PluginCore)` (in the case of the module type plugin it has to be inside `main.py`) that implements two methods for the different types of events:
23
22
24
-
-`on_submit`
25
-
-`on_review`
23
+
> **Note**: `on_submit` and `on_review` handlers are deprecated. Please use `on_event` instead. If your plugin was already uploaded with thoses handlers, it will still work. If you want the same behavior as `on_submit` and `on_review`, when you upload your plugin, you can use `event_matcher=["labels.created.submit"]` for `on_submit` and `event_matcher=["labels.created.review"]` for `on_review` events.
26
24
27
-
These methods have a predefined set of parameters:
28
25
29
-
- the `label` submitted (a dictionary containing the fields of the GraphQL type [Label](https://api-docs.kili-technology.com/types/objects/label/))
30
-
- the `asset_id` of the asset labeled
26
+
The plugin you are going to upload has to contain a `class PluginHandler(PluginCore)` (in the case of the module type plugin it has to be inside `main.py`) that implements one method for the different types of events:
27
+
28
+
-`on_event`
29
+
30
+
These methods have a predefined set of parameter:
31
+
32
+
- the `payload` submitted (a dictionary containing the fields for your plugins)
33
+
-`payload.event` the name of the event (ex: for submit : `labels.created.submit`, for review `labels.created.review`)
34
+
-`payload.label` the label containing the fields of the GraphQL type [Label](https://api-docs.kili-technology.com/types/objects/label/)
31
35
32
36
You can add custom methods in your class as well.
33
37
@@ -53,12 +57,18 @@ class PluginHandler(PluginCore):
Copy file name to clipboardExpand all lines: docs/sdk/tutorials/plugins_library.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
In this section you can find multiple examples of use-cases where our system of plugins can help you in the Kili projects.
6
6
7
-
You can also refer to our [tutorial](./plugins_development.md) to develop your plugin and iterate on it locally, before uploading the final version to Kili.
7
+
You can also refer to our [tutorial](./plugins_example.md) to develop your plugin and iterate on it locally, before uploading the final version to Kili.
8
8
9
9
For further information concerning the Kili plugins, refer to the [Reference page](../plugins.md)
0 commit comments