Skip to content

Commit

Permalink
Updates rasa actions
Browse files Browse the repository at this point in the history
  • Loading branch information
klpanagi committed May 18, 2024
1 parent 5114ae5 commit fbf04e9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,15 @@ def extract_answer2(self, dispatcher, tracker, domain):
if answer != None and answer2 == None:
answer = tracker.get_slot('answer')
city_slot = tracker.get_slot('city_slot')
city = f"{ city_slot }"
language = f"English"
try:
response = requests.get(f"http://services.issel.ee.auth.gr/general_information/weather_openweather/{city}/{language}",
response = requests.get(f"http://services.issel.ee.auth.gr/general_information/weather_openweather",
headers = {'access_token': 'Q5eJZ8sSLEX6XNmOHyMlWagI'},
params = {}
params = {'city': f"{city_slot}", 'language': 'English'}
)
answer2 = response.json()['temp']
output["answer2"] = answer2
except:
print(f'Error retrieving response from http://services.issel.ee.auth.gr/general_information/weather_openweather/{city}/{language} with code {response.status_code}.')
print(f'Error retrieving response from http://services.issel.ee.auth.gr/general_information/weather_openweather with code {response.status_code}.')
dispatcher.utter_message(text = "Apologies, something went wrong.")
return output

Expand Down

0 comments on commit fbf04e9

Please sign in to comment.