Deploy website online with ngrok

Hey guys, I made a bot that works on my pc. I put it on my website and tried to communicate with ngrok but without success. Could you help me where I’m wrong?

rasa run --enable-api --endpoints endpoints.yml --port 5005 --credentials credentials.yml --cors “*” --debug

Every help is welcome

@RodrigoLima As you are using scalable mind chatwidget and status on ngrok is giving 200 which is fine.

Can you use this command:

rasa run -m models --enable-api --cors "*" --debug

Please share endpoints.yml and are you using database for fetching or inserting data?

Hi! tks Nik.

Yes, I am using mysql database to return with the requested information. Typing 3000 he returns the bot name “Duda” and all conversation for that company. 1000 returns “Elis”…

@RodrigoLima your rasa --version? and you chatbot is working fine on rasa shell?

Rasa Version : 2.8.16 Minimum Compatible Version: 2.8.9 Rasa SDK Version : 2.8.2 Rasa X Version : 1.1.0.dev20211217 Python Version : 3.8.10

Yes, on my pc it works fine

@RodrigoLima can you share the error you getting on the terminal of 5005 when you run the above-mentioned command?

That’s the problem, it doesn’t return any errors. I will try other ways

@RodrigoLima you are able to see but you are not able to talk? right?

@RodrigoLima share the rasa action and rasa server logs ? use --debug

Always mention me @ nik202 for fast replies.

@nik202

thanks for all the support. It is helping me a lot and sorry for my google translator english. LOL That last image looks like I got an answer in ngrok with return intent. I will test it on other devices and find out if it works well on chrome, firefox and edge. this is the link https://ecfacil.com.br/bot/index4.html

is connected to ngrok and just type 1000 and the bot information will appear actions.txt (2.6 KB) logs.txt (176.4 KB)

@RodrigoLima Ok, no worries you are fine with English :slight_smile:

Confirm me few things?

  1. This is your website: https://ecfacil.com.br and you want to deploy a chatbot on this site?
  2. Is you ok with any chat widget?
  3. You want a welcome message that should automatically show or what is 1000 and 3000?

here are some hits. LOL

@nik202

chat widget I’m still testing but I must use another one.

So: the idea of ​​the bot is to be multi-user. I provide digital catalog service and I’m making this bot to offer together. I have a total of 8 companies that I serve, each of them will have an access code. The initial idea is to have the initialpayload:1000 3000 4000 5000…

each one will bring the information of that supplier. If you initially type 1000 it returns information about a cosmetics company

3000 a clothing company.

Now if you type 3000 at the beginning it returns the initial information of the bot but if you type any number later it will search the database for product information with this code

@RodrigoLima means one chatbot, one database, and 8 companies? Is this bot giving you results yes r no?

@RodrigoLima Are you aware of rasawebchat? GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront

@nik202 In the tests I’m doing, it’s working but I have to put it into production with my clients after finishing the bot

in Chatroom.js I tried to put the initialpayload but I couldn’t I’m testing it in others too

I used the one you sent me but I had to correct a line in socketio.py to make sending buttons work.

This one worked fine is the model of rasa itself

https://ecfacil.com.br/bot/index5.html

and this one worked fine too

@RodrigoLima Ok, Just follow my instructions and you will be able to get the chatbot widget on your site ok ?

Step: 1 Try copying this snippet code from the rep: GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront and change the version to 1. 0.1

Step: 2: I hope you have mentioned this in credentials.yml

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

Step 3: run both rasa and rasa action servers on ports 5005 and 5055 respectively

Step 4: Run the ngrok server for port 5005 using the command ngrok http 5005

Step 5: Copy the generate https link of ngrok and paste it in socketURL of the snippet code

replace this socketUrl: "https://ngrok"

Step 6: If you have your website login, install insert header and footer plugin (I have wordpress) and paste the snippet code

Step 7: Tada you will be able to see the bot on your website.

Extra: Now initialpayload message.

You create buttons for 1000, 3000 etc for all 8 companies using custom actions which will be able to give the seperate output.

And inside the snippet code just mention this :slight_smile:

initPayload={"/select_company"}

It will first show you the default menu to select the company

and then in your custom code or domain.yml you can initial the payload for all 8 companies which will perform the tasks.

I hope you getting my points and if you have any issue please mention me ok :slight_smile:

@RodrigoLima Any update??? You suddenly silent :smile: Is that I gave difficult solution?

hi @nik202 tks for all help.

Sorry for not replying sooner, I was at the beach. Hahahaha

I’m doing the steps you sent me and I’ll tell you how it turned out. now in the initialpayload to put the intent would use: initPayload={"/digitando_numeros=3000"}?

@RodrigoLima no no only one initPayload={"/select_company"}?

As you told me you have 8 companies.

Let me give one example:

responses:
  utter_hello:
   - text: Hello how can I help you? 
  utter_company_menu:
    - buttons:
        - payload: /one -< custom action for first company 
          title: 'Company 1000'
        - payload: /two -< custom action for second company 
          title: 'Company 2000'
        - payload: /three -< custom action for third company 
          title: 'Company 3000'
      text: Select the company and continue with your question below.
- story: company menu
   steps:
     - intent: get_started
     - action: utter_hello
     - action: utter_company_menu

initPayload={"/get_started"}?. \

Note: initPayload is used for automatic welcome or any message as bot open.

Ref: Rasa chatbot website integration | Quick tutorial - YouTube (using rasawebchat)

Got it now?

So, if it was just the buttons and the user chose it, it would be easier, but that’s where the problem lies. My client 3000 is not interested in its users seeing the content of client 1000. That’s why I was looking for a solution with initialpayload of the type /intent= value of the intent this way would load only the company information 3000

another solution I was looking for was direct with javascript. ex: site.com?q=3000

some way for me to read the 3000 on the client side and I can just go with the story for that client