Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the lambda function to call the split, emotion, sentiment, and question APIs #123

Closed
toddysm opened this issue Mar 4, 2022 · 3 comments · Fixed by #182 · May be fixed by #176
Closed

Modify the lambda function to call the split, emotion, sentiment, and question APIs #123

toddysm opened this issue Mar 4, 2022 · 3 comments · Fixed by #182 · May be fixed by #176
Assignees
Milestone

Comments

@toddysm
Copy link
Contributor

toddysm commented Mar 4, 2022

The Lambda function needs to call #118 #119 #120 #121 for the feedback, collect all the information for the feedback and reply back using the SWagger specified response.

Update the Swagger to make sure what is returned from the API is also specified in the Swagger.

@fikirmulu
Copy link
Contributor

fikirmulu commented Mar 17, 2022

Time Spent until now:
Research on Lambda functions: 2hrs
Implementing simple lambda function: 2 hrs
Using Lambda function to call child lambda function: 4hrs

Awaiting update on #119, #120, and #121 to have callable endpoints to continue development of my lambda function.
This is the lambda function I have developed.
image

To test, simple pass an empty json, and it shall call the child lambda function.

@fikirmulu
Copy link
Contributor

Below screenshot shows how I am calling Steven's "sw-test" lambda function.
I'm using the function ARN to send and receive a Payload from the child lambda function: sw-test
image

@fikirmulu
Copy link
Contributor

Due to a dependency on tasks #119, #120, #121, we have decided to change the scope of this issue.

Update:

Scope of the infrastructure used to implement this has changed.

The latest code I have developed has finished this implementation for #118 as well #120. For the remaining tasks, we have decided to proceed by integrating these features into a single Lambda function, as explained by @shipitsteven in his Pull request to close #162

Work completed:

Parent_Lambda_2 currently has integrated the feature to call two of the initially planned issues - #118, as well as #120.
Following are the activities that I did as part of this Issue:

  1. Ensured that the role "Lambda_role" had the privileges required to call other Lambda functions (Ref: [here]
    (https://www.sqlshack.com/calling-an-aws-lambda-function-from-another-lambda-function/#:~:text=In%20order%20to%20allow%20the,role%20to%20the%20lambda%20function.))
  2. Configure the inputs expected by the child lambda functions, this was done by individually finding the json input expected for the Event Handlers in the individual lambda functions
  3. Use the function ARN of the child lambda functions, along with "invoke" function from boto3's client function.
  4. Configure the expected output in accordance with the output required for the frontend to work on this.

Testing:

Parent_Lambda_2 can be tested by giving any sample input as JSON to trigger it.
Ȏutput:
image

However, I have created a pull request to close this Issue by making some modifications to improve the documentation present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment