Last active
February 25, 2018 01:01
-
-
Save edwardleoni/813f407461ecf72eaa38495ae1d04c73 to your computer and use it in GitHub Desktop.
This file contains 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
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