Hi,
I’m using InMemoryTracker all the while and my chatbot needs some user info before chatting. I passed the info using HTTP POST request to URL http://{{url}}/conversations/test/tracker/events
and the body as below
[
{
"event": "slot",
"name": "username",
"value": "isaac",
"timestamp": 0
}
]
It works fine and my custom actions able to retrieve the slot value using tracker.get_slot("username")
Now, I’m trying to switch the tracker to PostgresSQL. I added the tracker_store in endpoints.yml as below
tracker_store:
type: SQL
dialect: "postgresql"
url: "localhost"
port: 5432
db: "rasa"
username: "postgres"
password: "password"
When I use POST request to set the slot, the response looks ok.
{
"sender_id": "test",
"slots": {
"username": "isaac",
"session_started_metadata": null
},
"latest_message": {
"intent": {},
"entities": [],
"text": null,
"message_id": null,
"metadata": {}
},
"latest_event_time": 1643003770.6138699055,
"followup_action": null,
"paused": false,
"events": [
{
"event": "session_started",
"timestamp": 1643003758.7425978184
},
{
"event": "action",
"timestamp": 1643003758.7426223755,
"name": "action_listen",
"policy": null,
"confidence": null,
"action_text": null,
"hide_rule_turn": false
},
{
"event": "slot",
"timestamp": 1643003770.6138174534,
"name": "username",
"value": "isaac"
}
],
"latest_input_channel": null,
"active_loop": {},
"latest_action": {
"action_name": "action_listen"
},
"latest_action_name": "action_listen"
}
However, my custom action gets null value for the slot. I check via GET request with URL http://{{url}}/conversations/test/tracker
, it seems like the slot wasn’t set.
{
"sender_id": "test",
"slots": {
"username": null,
"session_started_metadata": null
},
"latest_message": {
"intent": {},
"entities": [],
"text": null,
"message_id": null,
"metadata": {}
},
"latest_event_time": 1643004317.804153204,
"followup_action": null,
"paused": false,
"events": [
{
"event": "session_started",
"timestamp": 1643004317.8041362762
},
{
"event": "action",
"timestamp": 1643004317.804153204,
"name": "action_listen",
"policy": null,
"confidence": null,
"action_text": null,
"hide_rule_turn": false
}
],
"latest_input_channel": null,
"active_loop": {},
"latest_action": {
"action_name": "action_listen"
},
"latest_action_name": "action_listen"
}
Below is the debug message from RASA OSS
2022-01-24 14:05:17 DEBUG rasa.core.lock_store - Issuing ticket for conversation 'test'.
2022-01-24 14:05:17 DEBUG rasa.core.lock_store - Acquiring lock for conversation 'test'.
2022-01-24 14:05:17 DEBUG rasa.core.lock_store - Acquired lock for conversation 'test'.
2022-01-24 14:05:17 DEBUG rasa.core.tracker_store - Can't retrieve tracker matching sender id 'test' from SQL storage. Returning `None` instead.
2022-01-24 14:05:17 DEBUG rasa.core.tracker_store - Tracker with sender_id 'test' stored to database
2022-01-24 14:05:17 DEBUG rasa.core.processor - Starting a new session for conversation ID 'test'.
2022-01-24 14:05:17 DEBUG rasa.core.processor - Policy prediction ended with events '[]'.
2022-01-24 14:05:17 DEBUG rasa.core.processor - Action 'action_session_start' ended with events '[<rasa.shared.core.events.SessionStarted object at 0x7f3a5cf2fc70>, ActionExecuted(action: action_listen, policy: None, confidence: None)]'.
2022-01-24 14:05:17 DEBUG rasa.core.processor - Current slot values:
username: None
session_started_metadata: None
2022-01-24 14:05:17 DEBUG rasa.core.tracker_store - Tracker with sender_id 'test' stored to database
2022-01-24 14:05:17 DEBUG rasa.core.lock_store - Deleted lock for conversation 'test'.
2022-01-24 14:05:26 DEBUG rasa.core.tracker_store - Recreating tracker from sender id 'test'
If I run the POST request to set slot twice, the slot can be successfully recorded. Same behavior is happening with SQLite. I need help on why first HTTP POST request slot isn’t stored.
Below is my RASA version
Rasa Version : 2.8.16
Minimum Compatible Version: 2.8.9
Rasa SDK Version : 2.8.3
Rasa X Version : 0.42.0
Python Version : 3.8.10
Operating System : Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29
Thanks