Skip to content

Instantly share code, notes, and snippets.

@edwardleoni
Last active February 25, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardleoni/813f407461ecf72eaa38495ae1d04c73 to your computer and use it in GitHub Desktop.
Save edwardleoni/813f407461ecf72eaa38495ae1d04c73 to your computer and use it in GitHub Desktop.
import sys, boto3
aws_access_key_id=sys.argv[1]
aws_secret_access_key=sys.argv[2]
lex = boto3.client('lex-runtime', region_name="us-east-1", aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
while True:
var = input("")
lex_response = lex.post_text(botName='politics', botAlias='politicsbot', userId='sadsadsa', inputText=var)
if ('message' in lex_response):
print(lex_response['message'])
else:
print('Something is gone wrong, you broke me')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment