GithubHelp home page GithubHelp logo

amazon-lex-v2-lambdahook-for-booktripbot's Introduction

Lambda Hook for Amazon Lex V2 Book Trip Blueprint

This project provides a sample Python Lambda Hook, that is compatible with the Amazon Lex V2 data structure, and can be used with the Book Trip Blueprint that is described in the “Bot Examples” section of the Amazon Lex Developers Guide (https://docs.aws.amazon.com/lex/latest/dg/ex-book-trip.html). This Lambda Hook can be invoked at the Fulfillment section of both intents included in the bot configuration (BookHotel and BookCar), as well as an initialization and validation function at each turn of the dialog. It includes a sample json to be configured as Test Event for the Lambda Hook, simulating the payload that will be sent by Amazon Lex, when invoking the function.

In the current version of this code, the fulfillment messages have been set in Spanish. The English version of the texts is commented in lines 442 and 517.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

amazon-lex-v2-lambdahook-for-booktripbot's People

Contributors

amazon-auto avatar sita158 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rubenafo

amazon-lex-v2-lambdahook-for-booktripbot's Issues

Running this example for BookHotel and an invalid city does't show the reason.

I have

  1. created an example bot in Lex v2.
  2. add the Lambda function
  3. Activated the code-hook in BookHotel
  4. run the Test Bot with the Lambda Funktion.

Asking for a Hotel with a invalid city like 'Hamburg', doesn't return the message "We currently do not support Hamburg as a valid destination. Can you try a different city?"

close function not working

there is a bug in close function

def close(session_attributes, active_contexts, fulfillment_state, intent, message):
response = {
'sessionState': {
'activeContexts':[{
'name': 'intentContext',
'contextAttributes': active_contexts,
'timeToLive': {
'timeToLiveInSeconds': 600,
'turnsToLive': 1
}
}],
'sessionAttributes': session_attributes,
'dialogAction': {
'type': 'Close',
},
'intent': intent
},
'messages': [message]
}

return response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.