Skip to content

doble196/Robo_Advisor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Challenge_15

Robo-Advisor

Enhance the Robo Advisor with an Amazon Lambda Function

In this section, you will create an Amazon Lambda function that will validate the data provided by the user on the Robo Advisor.

  1. Start by creating a new Lambda function from scratch and name it recommendPortfolio. Select Python 3.7 as runtime.

  2. In the Lambda function code editor, continue by deleting the AWS generated default lines of code, then paste in the starter code provided in lambda_function.py.

  3. Complete the recommend_portfolio() function by adding these validation rules:

    • The age should be greater than zero and less than 65.
    • The investment_amount should be equal to or greater than 5000.
  4. Once the intent is fulfilled, the bot should respond with an investment recommendation based on the selected risk level as follows:

    • none: "100% bonds (AGG), 0% equities (SPY)"
    • low: "60% bonds (AGG), 40% equities (SPY)"
    • medium: "40% bonds (AGG), 60% equities (SPY)"
    • high: "20% bonds (AGG), 80% equities (SPY)"

Hint: Be creative while coding your solution, you can have all the code on the recommend_portfolio() function, or you can split the functionality across different functions, put your Python coding skills in action!

  1. Once you finish coding your Lambda function, test it using the sample test events provided for this Challenge.

  2. After successfully testing your code, open the Amazon Lex Console and navigate to the recommendPortfolio bot configuration, integrate your new Lambda function by selecting it in the “Lambda initialization and validation” and “Fulfillment” sections.

  3. Build your bot, and test it with valid and invalid data for the slots.

"""

Intents Handlers

def recommend_portfolio(intent_request): """ Performs dialog management and fulfillment for recommending a portfolio. """

About

Robo-Advisor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages