I'm part of a team that is trying to integrate AWS Lex into one of our web applications. Currently, the approach that we are going for is one where the user asks Lex to run a SQL query. Lex will then decide the appropriate intent based on the user's question (I.E if user wants to search using value A, Lex will choose intent A) and send this information back to our web application which will then run the appropriate method for executing the SQL query (where method name matches the intent name).
To recap, what we want to do is as follows:
1) User tells Lex that they want to search for data using Value A
2) Lex determines the correct intent (Intent A)
3) Lex sends this information to Lambda which then returns the intent name to the web client
4) Our web application intercepts this response from Lambda and executes the correct method
5) Results shown to the user via Lex.
My question is whether or not this is possible, particularly the intercepting of the Lambda response. If so, can anyone please point me to the relevant information as to where I can read up on how to implement this? I've been searching for the last couple of days and have not found any relevant materials for this particular use case.
Thanks a lot!