Return correct Detect API error #51
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
The correct missing data fields are currently not being presented to the user in error handling:
https://github.com/protectai/rebuff/blob/main/server/pages/api/detect.ts#L69-L73
From
https://github.com/protectai/rebuff/blob/main/javascript-sdk/src/api.ts#L76-L78
Returns
{"error":"bad_request","message":"userInput is required"}
Though it should be throwing:
{"error":"bad_request","message":"userInputBase64 is required"}
Since this works:
The text was updated successfully, but these errors were encountered: