MCPcopy Create free account
hub / github.com/serverless/examples / lucky_number

Function lucky_number

aws-python-alexa-skill/handler.py:11–31  ·  view source on GitHub ↗
(event, context)

Source from the content-addressed store, hash-verified

9
10
11def lucky_number(event, context):
12 print(event)
13 upperLimitDict = event['request']['intent']['slots']['UpperLimit']
14 upperLimit = None
15 if 'value' in upperLimitDict:
16 upperLimit = parseInt(upperLimitDict['value'])
17 else:
18 upperLimit = 100
19
20 number = random.randint(0, upperLimit)
21 response = {
22 'version': '1.0',
23 'response': {
24 'outputSpeech': {
25 'type': 'PlainText',
26 'text': 'Your lucky number is ' + str(number),
27 }
28 }
29 }
30
31 return response

Callers

nothing calls this directly

Calls 1

parseIntFunction · 0.85

Tested by

no test coverage detected