Skip to content

I am unable to send non JSON Serializable content as response #24

@ahsanmemon

Description

@ahsanmemon

I'm trying to send a numpy array back as a response using the following code

return {
    'embeddings': msgpack.packb(np.random.rand(10,100).tobytes())
}

It won't send it. It throws an error saying that "TypeError: Object of type bytes is not JSON serializable"

It's important to send bytes back because it saves up on network load. Need an option to be able to support mimetype='application/msgpack'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions