Skip to content

Commit cad0fc0

Browse files
authored
Merge pull request RasaHQ#4813 from RasaHQ/events-metadata
Allow metadata to be attached to any tracker Event
2 parents aae0710 + 2edfc2a commit cad0fc0

File tree

10 files changed

+227
-65
lines changed

10 files changed

+227
-65
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ events.db
8484
*.coverage*
8585
env
8686
venv
87+
.dir-locals.el

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Added
1818
- Added documentation for ``AugmentedMemoizationPolicy``
1919
- Fall back to ``InMemoryTrackerStore`` in case there is any problem with the current
2020
tracker store
21+
- Arbitrary metadata can now be attached to any ``Event`` subclass. The data must be
22+
stored under the ``metadata`` key when reading the event from a JSON object or
23+
dictionary.
2124
- Add command line argument ``rasa x --config CONFIG``, to specify path to the policy and
2225
NLU pipeline configuration of your bot (default: ``config.yml``)
2326
- Added a new NLU featurizer - ``ConveRTFeaturizer`` based on `ConveRT <https://github.com/PolyAI-LDN/polyai-models>`_ model released by PolyAI.

data/test_trackers/tracker_moodbot.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
{
4141
"timestamp": 1517821726.200036,
42+
"metadata": {},
4243
"parse_data": {
4344
"entities": [],
4445
"intent": {
@@ -63,7 +64,7 @@
6364
},
6465
"event": "user",
6566
"text": "/greet",
66-
"input_channel": null, "message_id": null, "metadata": null
67+
"input_channel": null, "message_id": null, "metadata": {}
6768
},
6869
{
6970
"timestamp": 1517821726.200373,
@@ -81,6 +82,7 @@
8182
},
8283
{
8384
"timestamp": 1517821726.209836,
85+
"metadata": {},
8486
"parse_data": {
8587
"entities": [],
8688
"intent": {
@@ -105,7 +107,7 @@
105107
},
106108
"event": "user",
107109
"text": "/mood_great",
108-
"input_channel": null, "message_id": null, "metadata": null
110+
"input_channel": null, "message_id": null, "metadata": {}
109111
},
110112
{
111113
"timestamp": 1517821726.209908,

0 commit comments

Comments
 (0)