Rasa bot integration with Facebook Messenger

Can you pip show rasa for me?

I feel like you might have been doing what I was, and if you visit this post Facebook Setup - Webhook not resolving - #6 by ManyChat - then you’ll see how I dealt with a similar situation.

I am also assuming you have credentials.yml already filled out too. After that, you’ll need to fix the endpoints.yml file and uncomment the webhook endpoint. Then run rasa with the following command:

rasa run -m models --credentials credentials.yml --enable-api --log-file out.log --endpoints endpoints.yml

Tried following your method but still the same error. Also can you tell me is it necessary to enable SSL certificate for setting up the webhook and if so which of the ones available online should I purchase?

@erohmensing any thoughts on what might be going wrong?

Hey @RenuDighe, ssl shouldn’t be necessary just to set it up.

I think things are getting confused with your versions – you have rasa installed but also rasa_core and rasa_nlu. It looks like you’re still using the old versions because you were using python -m rasa-core.run .... which is for the old rasa_core.

I think the best thing is to get your bot completely migrated to rasa and then uninstall rasa_core and rasa_nlu.

I usually run the bot using “npm start”

Not sure how this became a thing, but (once you are migrated) you should be starting the bot with a rasa run command

Ok, I will try that!

I unistalled rasas nlu and core and had the chatbot train on rasa, now when I run it I get an error in the browser saying “requested url not found”

That should be fine, there’s no UI for that. Can you try the ngrok stuff and connecting to facebook again? If you use rasa shell your bot works, right?

Hi, it worked! Will you just confirm from the screenshots below if everything has been done correctly or not?

Apparently Facebook is reviewing the chatbot for which they sent me a legal contract as well. Is this all the normal procedure?

I’m not sure about the legal contract stuff – I’ve set up a facebook chatbot in test mode but have never actually deployed one. I do remember it saying something about needing permission though.

the Ignoring message as there is no agent to handle it message doesn’t look good though. How did you train your model and what does your config look like?

I trained it using “rasa train --data data/nlu_data.md --out models --verbose nlu” and then “rasa run --enable-api --log-file out.log --endpoints endpoints.yml --credentials credentials.yml”.

Config file -

language: en

pipeline: supervised_embeddings

policies:

  • name: KerasPolicy epochs: 200 batch_size: 50 max_training_samples: 300
  • name: FallbackPolicy
  • name: MemoizationPolicy
  • name: MappingPolicy

Ah, so you’re only training an NLU model there I believe (you’re only passing nlu data and, althought you put a bunch of args in between, are still running rasa train nlu. So there will be no core/dialogue management – is this intentional?

I assume not – if not you want to make sure your stories are in your data folder and then train with rasa train --data data/ --out models --verbose (which by the way is the same as just rasa train --verbose)

Ok, so I have stories in data folder and when I run “rasa train --verbose” I get this output

Looks like you have some cleaning up to do – are the messages unclear?

I don’t think so. It is running well on the server. What do you mean by cleaning up? I can always try doing so

I mean you have to read the error messages and do what they say – i.e. add FormPolicy to your policy ensemble and add utterances for utter_time, utter_name, etc

You can also look with rasa data validate to get even more info

So I resolved the errors and when I train and run, I get this

If I go to the localhost in browser I see this

Is it working fine now? However the bot is not running on the server, can you tell me why?

Again just as a heads up, it works if I say “npm start”

I suppose you must have a completely different setup than normal because we don’t use npm at all. If it works, it works though, I guess

Umm okay. Can you tell me what this error means?