I have created a simple bot. I also have a simple HTTP server working on another host and a couple of custom actions on that server. I specified the action endpoint in my enpoints.yml file as following
action_endpoint:
url: "http://172.17.0.3:8080/"
My talk.py file is
def talk_with_nlu():
agent = Agent.load('models/dialogue', interpreter='./models/nlu/default/simplebotnlu/', action_endpoint='./endpoints.yml')
print("Your bot is ready to talk! Type your messages here or send 'stop'")
while True:
a = input()
if a == 'stop':
break
responses = agent.handle_message(a)
for response in responses:
print(response["text"])
talk_with_nlu()
When I run this script I don’t see any request post to my HTTP server. I also tried to run by
You simply run a (simple) HTTP server, say, on 172.17.0.3:8080, which would process incoming requests, in particular POST requests since RASA sends POST requests (see documentation). The body of the requests is in JSON format and so your response should also be in JSON format.
Define an intent in your domain file, for example custom.intent. Do not type anything related to the custom.intent in your stories file. When RASA detects this intent and finds nothing related to this intent in your stories file it automatically sends a requests to your remote action server with all necessary information packed in JSON format. The rest is up to you how to process it and what to response.
Also do not forget to specify the endpoint in your python file when you create an agent, e.g.,