I created a lex bot to call weather API from a lambda. The lambda works fine giving the temperature of the city.
I am able to call a lambdb from lex bot thanks to for the help from "Reegz"
Now I get this message "intent findingweather is fulfilled" instead of getting the weather of the city. The lambda when I test, works fine, I provide the city name and lambda brings the temperature
import json
import boto3
from pprint import pprint
import urllib3
def weatherfunc(city_name):
api_key = '9100010fc2b045080a7exxf42051e547bdxx'
base_url = 'http://api.openweathermap.org/data/2.5/weather?'
finalurl = base_url + 'appid=' + api_key + '&q=' + city_name
httprequest = urllib3.PoolManager()
response = httprequest.request('GET',finalurl)
#pprint(response.data)
weather_status = json.loads(response.data.decode('utf-8'))
return weather_status["main"]["temp"]
def lambda_handler(event, context):
city = event['City']
a = weatherfunc(city)
