the order flowers blueprint runs fine on lex through console but when the lambda blueprint is attached
the test fails with "Invalid Lambda Response: Received error response from Lambda: Unhandled"
the log shows the error:
[ERROR] KeyError: 'userId'
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 206, in lambda_handler
return dispatch(event)
File "/var/task/lambda_function.py", line 182, in dispatch
logger.debug('dispatch userId=
{}
, intentName=
{}
'.format(intent_request['userId'], intent_request['currentIntent']['name']))
[ERROR] KeyError: 'userId' Traceback (most recent call last): File "/var/task/lambda_function.py", line 206, in lambda_handler return dispatch(event) File "/var/task/lambda_function.py", line 182, in dispatch logger.debug('dispatch userId={}, intentName={}'.format(intent_request['userId'], intent_request['currentIntent']['name']))
the reuse of the function for fulfillment and validation is very hard to follow because the doc says:
In the Editor, choose AWS Lambda function as Fulfillment, and select the Lambda function that you created in the preceding step (OrderFlowersCodeHook). Choose OK to give Amazon Lex permission to invoke the Lambda function.
..... the problem is there is no choice for the lambda function in that form nor is there one in the
validation form!!!
there is a reference to the function being stored in an alias but i cant find a way to tie this together.
i have really tried to follow the documentation systematically but cant get through it.
where am i going off the rails??? shouldnt the blueprint run without this stumbling block?
this has cost me a month of hair pulling agony and is really the first step in building an index
for my knowledge system already running on aws where a session could build a compound
index such as "Application:Billing\Function:Encounters\Process:Create\Plan:BlueCross\Product:PPO\Coverage:Medical\Service:Physical\FromDate:01-01-2022"
it seems like a natural way to specify types and values in a modern interface.
Thanks, AEH