Open seanpmorgan opened 11 months ago
Part of #45
The python SDK marks this as optional since the encoding is handled by the SDK: https://github.com/protectai/rebuff/blob/707e5b6ed5f7d9925b66dcdb445fa483f37f8296/python-sdk/rebuff/rebuff.py#L9-L10
But the API endpoint requires b64 and not the userInput
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: