-
Notifications
You must be signed in to change notification settings - Fork 0
/
lex.py
43 lines (37 loc) · 980 Bytes
/
lex.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import boto3
import requests, json
#------------------------ for lex bot 'TestBot' ----------------------#
# lex = boto3.client('lex-runtime')
# response = lex.post_text(
# botName='TestBot',
# botAlias='aliasOne',
# userId='655701873205',
# sessionAttributes={
# 'string': 'string'
# },
# requestAttributes={
# 'string': 'string'
# },
# inputText='hi'
# )
# print(response['message'])
# -------------------- for lex bot 'UniChatBot' -----------------------#
lex = boto3.client(
'lex-runtime',
region_name='us-east-1',
aws_access_key_id='AKIAJH52Z3SLPZAJ2ELQ',
aws_secret_access_key='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'
)
response = lex.post_text(
botName='UniChatBot',
botAlias='aliasTwo',
userId='655701873205',
sessionAttributes={
'string': 'string'
},
requestAttributes={
'string': 'string'
},
inputText='can you tell'
)
print(response['message'])