calpoly-csai / api

Official API for the NIMBUS Voice Assistant accessible via HTTP REST protocol.
https://nimbus.api.calpolycsai.com/
GNU General Public License v3.0
9 stars 4 forks source link

Empty string answers now return None 👍 #199

Closed ethanahlquist closed 3 years ago

ethanahlquist commented 3 years ago

What's New?

I added a quick check to see if the NLP returns an empty string to the answer field. Instead return 'None' when this occurs.

Fixes #198

Type of change (pick-one)

How Has This Been Tested?

I ran the following request, which had initially contained an empty answer:

curl --location --request POST 'localhost:8080/ask' --header 'Content-Type: application/json' --data-raw '{ "question": "How would I see Dr. Ventura now?" }'

Now, it returns:

{
  "answer": "I'm sorry, I understand your question but was unable to find an answer. Please try another question.",
  "session": "SOME_NEW_TOKEN"
}

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication