Created
August 21, 2017 11:51
-
-
Save amn41/adc35932a723306989bf2e0470a8233e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rasa_dm.actions import Action | |
import requests | |
class ActionHTTPRequest(Action): | |
def name(self): | |
return "make_request" | |
def run(self, dispatcher, tracker, domain): | |
url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json' | |
result = requests.get(url).json() | |
dispatcher.utter_template("result : {}".format(result)) | |
return [] | |
a = ActionHTTPRequest() | |
a.run( None, None, None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yup I completely understand that, once I have the REST or Web service created I can make a call like this. But again my question exists how can I set up RASA Core as HTTP api or as web service which I can then consume using above action method. I hope you are able to get my question what I am trying to convey you?