-
Notifications
You must be signed in to change notification settings - Fork 607
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
Support byte string return values from predict() #913
Comments
Is it possible to grab this one? |
Absolutely! @vishalbollu and I will discuss tomorrow whether we want to also pass strings through or continue encoding them as json, so we will update you on our thoughts there. But passing the bytes through definitely makes sense since right now that isn't even possible. |
@RobertLucian I spoke with Vishal, and here's what we're thinking:
The error message if encoding fails should list the user's three options. We decided to close #910 for now, since using the built-in json makes it easier for users to understand the behavior, and search for error messages. Does this behavior make sense to you? |
@deliahu I just saw your comment here. So, let me iterate what #915 already has:
And here's an example of the error's message in case the JSON serialization fails:
Out of all these 4 things (the first 3 points and the error message), the only difference is in that Here are my thoughts:
What do you think? |
Yes, I definitely agree with using the Our thinking regarding passing strings through is that the json dumping/loading is unnecessary, since it's already a string (you might as well just read it from the body directly). E.g. currently, if you return |
@RobertLucian also, I just pushed a few small changes to the docs and the error message, feel free to edit them back or further if you'd like |
@deliahu Hmm, I see the logic behind that - eliminating yet another step when it's about strings. I think that makes sense, although, I think it still has to be decoded on the receiving end. I'd give it a |
@RobertLucian good call on the This PR looks good to me, I will allow @vishalbollu to do a final pass, weigh in on the error message, and LGTM |
Description
starlette.response
, send that through unmodifiedstring
orbytes
, send that through to the user, and do not set themedia_type
headerjson
package, and set the "application/json" media type headerThe error message if encoding fails should list the user's three options.
The text was updated successfully, but these errors were encountered: