Figured out an alternative. Looks like AWS Lex doesn't allow interacting with internal systems unless we explicitly open up the port. I have decided to use Microsoft LUIS. This allows for calling Intent identification from an internal system as an API.
Following Python code allows me to connect to a configured LUIS service from my local system.
########### Python 3.6 #############
import requests
headers = {
# Request headers
'Ocp-Apim-Subscription-Key': 'xxxxxxxxxxxxxxx',
}
params ={
# Query parameter
'q': 'Can I book a travel ticket from LA to Chicago',
# Optional request parameters, set to default values
'timezoneOffset': '0',
'verbose': 'true',
'spellCheck': 'false',
'staging': 'true',
}
try:
r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/XXX-XXX-XXX-XXX',headers=headers, params=params)
print(r.json())
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))