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

MalliLabs: Tasks resolved #101

Closed
wants to merge 5 commits into from
Closed

MalliLabs: Tasks resolved #101

wants to merge 5 commits into from

Conversation

GuilhermeCMartins
Copy link

Task 1

Greet Somebody in Different Languages

  • Created an object with possible translations.
  • Iterated through the object with the language passed in the query.

Endpoint: /task1/greet/{name}

Task 2 - Convert snake_case to camelCase

  • Created a camelize function that splits on underscores and returns the camelCase version.

Endpoint: POST /task2/camelize

Task 3 - Handle User Actions

  • Created an intent_mapping for possible words that trigger an intent.
  • Used spaCy for natural language processing (NLP).
  • Created a function called identify_intent that iterates through the mapping and returns the actual intent.
  • Created a function called extract_call_name to identify the name of the friend who should make a call.
  • In the main function, used a conditional structure to call the intent handlers or return an ActionResponse for an action taker not registered.
  • Defined four handlers for the four possible intents: call, reminder, timer, and unknown.

Endpoint: POST /task3/action

Task 4 - Security

  • Created validation to check who is accessing the token (the user must exist to get a Bearer token).
  • Created a function called get_user that returns the user from the fake database.
  • Created a function called get_current_user to verify and return the user from the token.
  • In the main function, created a verification to check if the user exists and if they own the secret.

Token Retrieval Endpoint: POST /task4/token
User Secret Endpoint: GET /task4/users/{username}/secret

@GuilhermeCMartins GuilhermeCMartins closed this by deleting the head repository Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant