I have integrated my chatbot with slack. When I send simple messages like “hi” the response come quick and smooth.
But when some actions are involved, things get a little weird. For example, in the following bot where I am looking for restaurants, when the bot tries to make an api call to zomato, to get the restaurants suitable to my criteria, it never gives the response back to slack.
This image may add clarity
If you see this image, for a single message of mine in slack, slack is hitting my ngrok endpoint multiple times.
Also, after I wait for a while, ngrok shows that the requests have been handled but I never get the response.
This image shows the same - I wait for long, ngrok is finished with responding yet no response in slack.
Here is the code for app
from rasa_core.channels.slack import SlackInput from rasa_core.agent import Agent from rasa_core.interpreter import RasaNLUInterpreter import yaml from rasa_core.utils import EndpointConfig nlu_interpreter = RasaNLUInterpreter('./models/current/nlu') action_endpoint = EndpointConfig(url="http://localhost:5055/webhook") agent = Agent.load('./models/current/dialogue', interpreter = nlu_interpreter, action_endpoint = action_endpoint) input_channel = SlackInput('xoxb-609656943046-599490439985-37Q7nhNcH2plLlkrSSWKGDom' #your bot user authentication token ) agent.handle_channels([input_channel], 5004, serve_forever=True)
The bot is working fine on command line. Any help would be appreciated.