Евгений Чумак
def handler(event, context):
"""
Entry-point for Serverless Function.
:param event: request payload.
:param context: information about current execution context.
:return: response to be serialized as JSON.
"""
if event['request']get'original_utterance'=='привет':
text='привет'
else
text='1'
return {
'version': event['version'],
'session': event['session'],
'response': {
# Respond with the original request or welcome the user if this is the beginning of the dialog and the request has not yet been made.
'text': text,
# Don't finish the session after this response.
'end_session': 'false'
},
}
Всё равно ошибка.
У тебя питонячий синтаксис по-прежнему сильно поломан. В частности, в первой строке get
- это функция, её аргумент нужно в круглые скобки заворачивать. А после else тоже нужно двоеточие.
Попробуй этот код вставить в какую-нибудь среду разработки типа pycharm, она тебе ошибки подчеркнёт и даже немножко объяснит.
Ну и если с питоном раньше не работал, стоит какой-нибудь быстрый курс пройти.