API unexpected behavior (bug?)

It appears if you set slots via API (events) and then converse with the bot it is in error. This appears to be rectified after talking to it once or twice. The following takes the ‘rasa init’ bot and adds 10 slots, the script sets the slots and then say ‘hi’ to the bot, without response.

Steps to reproduce:

  • Start with ‘rasa init’ project
  • add slot_a through slot_j to domain.yml as slots (all unfeaturized)
  • train the model
  • run rasa with api exposed (default port 5005)

run the following bash script:

curl -X POST -d '{ "event" : "slot", "name" : "slot_a", "value" : "8,700" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_b", "value" : "test" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_c", "value" : "Microsoft" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_d", "value" : "red" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_e", "value" : "1,332.55" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_f", "value" : "3821937" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_g", "value" : "Dodge" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_h", "value" : "Challanger" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_i", "value" : "52951267" }' http://localhost:5005/conversations/111222333444/tracker/events

curl -X POST -d '{ "event" : "slot", "name" : "slot_j", "value" : "32.65" }' http://localhost:5005/conversations/111222333444/tracker/events

printf "\n\n\n\n"

curl -X POST -d '{ "sender" : "111222333444", "message" : "hi" }' http://localhost:5005/webhooks/rest/webhook

Tried to replicate this - to make it readable just ran with newlines between each. Got a response at the end:

curl -X POST -d '{ "event" : "slot", "name" : "slot_a", "value" : "8,700" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_b", "value" : "test" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_c", "value" : "Microsoft" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_d", "value" : "red" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_e", "value" : "1,332.55" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_f", "value" : "3821937" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_g", "value" : "Dodge" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_h", "value" : "Challanger" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_i", "value" : "52951267" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
curl -X POST -d '{ "event" : "slot", "name" : "slot_j", "value" : "32.65" }' http://localhost:5005/conversations/111222333444/tracker/events
printf "\n\n\n\n"
printf "\n\n\n\n"

curl -X POST -d '{ "sender" : "111222333444", "message" : "hi" }' http://localhost:5005/webhooks/rest/webhook

I wonder if when you ran them all in a row, syntactically something got concatenated resulting in the null response?

this only happens the first time you run it with the unique tracker ID, if you run the same ID twice it works the second time. I think this has to do with running in API slot_set on a new tracker.

I used your script with the newest version of RASA and it still shows a blank response on first run of the script.

Can you confirm you ran the script more than once ? Only follow as stated, meaning run the script once without that tracker number being used on the server before.

I also think (think) it has to do with the TED Policy (without history?). I’m working to debug, but the learning curve is steep :slight_smile:

Thanks for the update! Sorry I’m only seeing this now. I’ll see if I can reproduce what you’re seeing.

Yup, you’re right, that is what happens the first time.

I definitely get the same. Is this intended behavior or a bug? Does the Rasa team have a workaround? @chaneyjd did you make any progress on your own debugging? I’ve been chasing this for awhile.

@chaneyjd @atxai this indeed seems to be a bug - we’re looking into this. In the meantime, you can track the progress of the issue here: Setting slots before conversation starts leads to empty bot responses · Issue #6721 · RasaHQ/rasa · GitHub

1 Like

Please check the bug listed by ricwo as I have possible solution.