Hey, I integrated my Rasa bot in Slack. I have some buttons defined in my domain file :
utter_otherQuestions:
text: “Do you have any other question?”
buttons:
title: “Yes”
payload: ‘/affirm’
title: “No”
payload: ‘/deny’
I followed all the instructions, after running rasa and hitting the button in slack, I get the error: 2020-04-05 13:30:51 WARNING rasa.core.channels.slack - Received message on unsupported channel: D010VBL775H
[2020-04-05 13:30:56 +0200] [1376] [ERROR] Exception occurred while handling uri: ‘http://ac8cc757.ngrok.io/webhooks/slack/webhook’
So basically when I hit the button in slack, nothing happens.
Can someone help me here?
@athenasaurav Hey, Thanks for the help. I did add the channel specific response in my domain file:
responses:
utter_greet:
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
channel: "slack"
custom:
- # payload for Slack buttons
- title: "Location of the product"
payload: '/Where{"productNumber": "None"}'
- title: "Business step of the product"
payload: '/why{"location": "None"}'
- title: "Products in the location"
payload: '/what{"location": "None"}'
But still, I get the same error:
2020-04-06 10:51:10 WARNING rasa.core.channels.slack - Received message on unsupported channel: D010VBL775H
[2020-04-06 10:51:13 +0200] [24009] [ERROR] Exception occurred while handling uri: 'http://ea7a90fb.ngrok.io/webhooks/slack/webhook'
Traceback (most recent call last):
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 173, in load_json
self.parsed_json = loads(self.body)
ValueError: Expected object or value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/home/assistant/lib/python3.7/site-packages/sanic/app.py", line 976, in handle_request
response = await response
File "/home/home/assistant/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 356, in webhook
metadata = self.get_metadata(request)
File "/home/home/assistant/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 329, in get_metadata
slack_event = request.json
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 167, in json
self.load_json()
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 177, in load_json
raise InvalidUsage("Failed when parsing body as json")
sanic.exceptions.InvalidUsage: Failed when parsing body as json
Any Idea how I can get rid of this error? I am trying to solve it for 4 days, but were not successfull.
@athenasaurav yes, the buttons appear. I hit one and then nothing happens.
when I run ra run --enable-api --cors "*" --debug in my terminal, I also get this:
2020-04-06 11:45:30 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model for 'ResponseSelector'. Maybe you did not provide enough training data and no model was trained or the path '/tmp/tmpcaixaoxb/nlu' doesn't exist?
And then comes the error I mentioned above.
intents:
- greet
- goodbye
- affirm
- deny
- what
- where
- why
- inform
entities:
- productNumber
- location
slots:
location:
type: unfeaturized
auto_fill: True
productNumber:
type: unfeaturized
auto_fill: True
actions:
- utter_greet
- utter_goodbye
- utter_otherQuestions
- utter_suggestions
- utter_ask_location
- utter_ask_productNumber
- action_location_search
- action_bizStep_search
- action_product_search
responses:
utter_greet:
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
channel: "SlackBot"
custom:
- # payload for Slack buttons
buttons:
- title: "Location of the product"
payload: '/where'
- title: "Business step of the product"
payload: '/why'
- title: "Products in the location"
payload: '/what'
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
buttons:
- title: "Location of the product"
payload: '/Where'
- title: "Business step of the product"
payload: '/why'
- title: "Products in the location"
payload: '/what'
utter_ask_location:
- text: "Please tell me a valid location name."
utter_ask_productNumber:
- text: "Please tell me a valid product number."
utter_goodbye:
- text: "Bye!"
utter_otherQuestions:
- text: "Do you have any other question?"
channel: "SlackBot"
custom:
- # payload for Slack buttons
buttons:
- title: "Yes"
payload: '/affirm'
- title: "No"
payload: '/deny'
- text: "Do you have any other question?"
buttons:
- title: "Yes"
payload: '/affirm'
- title: "No"
payload: '/deny'
utter_suggestions:
- text: "What would you like to know?"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: false
rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials
slack:
slack_token: "xoxb-631506400631-1xxxxxx4-TR7ZcBsY5gvXyGlrw6eodw5w"
slack_channel: "#vui-design"
slack_retry_reason_header: "x-slack-retry-reason" # Slack HTTP header name indicating reason that slack send retry request. This configuration is optional.
slack_retry_number_header: "x-slack-retry-num" # Slack HTTP header name indicating the attempt number. This configuration is optional.
errors_ignore_retry: None # Any error codes given by Slack included in this list will be ignored. Error codes are listed `here <https://api.slack.com/events-api#errors>`_.
rasa:
url: "http://localhost:5002/api"
@athenasaurav I corrected the channel name to slack, but still the same error.
here is my nlu data:
## intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
- hello assistant
- hey assistant
- hi assistant
- hi rasa
- hi digital assistant
- hello rasa
- hello digital assistant
## intent:goodbye
- bye
- goodbye
- see you around
- see you later
- thanks
- that's all. thanks
## intent:affirm
- yes
- indeed
- of course
- that sounds good
- correct
## intent:deny
- no
- never
- I don't think so
- don't like that
- no way
- not really
## intent:what
- what is in [storage](location)
- which product is in [robot](location)
- tell me the products in [tiling](location)
- what product is under [installation](location)
- tell me the products in [Pod Tiling](location)
- what can you find in the [Storage Area](location)
- tell me a list of all products in the [Cold Storage](location)
- i want to know a list of products in this location
- i need to know the products currently [entering](location)
- What's in the [tiling area](location) at the moment
- products in the [Cold](location) area
- Give me a list of all products that are [exiting](location)
- tell me which products are in the [Robot Area](location)?
- what is in the [robot area](location)
- what is in [Robot area](location)?
- what is in [robot area](location)
- what is in the [storage area](location)
- what is in the [storage](location)
- products in the [Tiling](location)
- which products are they [installing](location)
- list of products in [tiling area](location)
- inform me about all products in [pod tiling](location)
- what is [entering and exiting](location)
- what is in currently [entering](location:Cold storage)
- what is in the [room number one](location)
- what is in the [kitchen](location)
- what is in the [business location](location)
- I want to know the products in the [business area](location)
- I want to know the list of products in the [shop floor area](location)
- what else is in this location?
- Products in the location
## intent:where
- Where's the product [LB-4488-3-A1101](productNumber) at the moment
- Find [LB-4488-3-A1102](productNumber)
- Where can I find [LB-4488-3-A1103](productNumber)
- Help me to find the product [LB-4488-3-A1103](productNumber)
- I want to know the current location of the product [LB-4488-3-A1104](productNumber)
- Location of [LB-4488-3-A1102](productNumber)
- Tell me where is [LB-4488-3-A1102](productNumber)
- Let's find [LB-4488-3-A1101](productNumber)
- Tell me in which business location is [LB-4488-3-A1103](productNumber)
- where is [LB-4488-3-A1102](productNumber)
- where is [A1102] (productNumber)
- where is the product [1102](productNumber)
- Location of the product
- Location of a product
- business location
## intent:why
- What is happening to [LB-4488-3-A1101](productNumber)
- [LB-4488-3-A1102](productNumber)
- business step for [LB-4488-3-A1103](productNumber)
- what is the business step for [LB-4488-3-A1103](productNumber)
- at which business step is [A1103](productNumber)
- why is it there?
- Business step of the product
- what is happening to it?
- what is happening to this product
- what is the business step
- business step
## intent:inform
- [LB-4488-3-A1101](productNumber)
- [LB-4488-3-A1104](productNumber)
- [LB-4488-3-A1103](productNumber)
- [LB-4488-3-A1102](productNumber)
- [1103](productNumber)
- [A1113](productNumber)
- the product number is [LB-4488-3-A1101](productNumber)
- the product number is [LB-4488-3-A1105](productNumber)
- the location is [robot area](location)
- the location is [cold storage](location)
- [robot](location)
- [storage](location)
- [storage area](location)
- [entering](location)
- [exiting](location)
- [installation](location)
- [tiling](location)
- [pod tiling area](location)
- [pod tiling](location)
- [shop floor](location)
## synonym:Cold storage
- exiting
- cold area
- cold storage
- entering and exiting
- entering
- cold storage area
- Cold Storage
- Cold
- Storage Area
- storage
- storage area
## synonym:Pod Tiling area
- Tiling
- Pod Tiling
- installing
- tiling
- pod tiling
- installation
- tiling area
- pod tiling area
## synonym:Robot area
- robot area
- Robot Area
- robot
Okay i got it. You custom channel payload is incorrect. Your payload should be like.
utter_greet:
- text : "Wecome to Rasa digital assistant"
channel: "Slack"
custom:
- text : "what would u like to know?"
buttons:
- title: "Location of the product"
payload: '/Where's the product LB-4488-3-A1101 at the moment'
- title: "Business step of the product"
payload: '/why is it there?'
- title: "Products in the location"
payload: '/what is in storage.'
Thank you for the help so far. However, the problem persists. I investigated the error further and drilled down to slack.py and request.py. The lowest-level error I found is this: “Failed when parsing body as json” in the request.py. line 173. I cannot parse the body of the response and outputting the body reveals to me that the body is not a valid json.
It looks like this (xxx I used to replace real data):