Improve return field selection and serialization
Closed this issue · 1 comments
tylerhutcherson commented
Right now in order to deserialize an embedding field, you need to call:
qry.return_field("embedding", decode_field=False)
qry.return_fields("title","year")
which is less ideally from a UX perspective. This feature was added as a simple wrapper around the redis-py classes. But we can try to simplify this ux for sure.
bsbodden commented
What about something like:
# Single field skip
query.return_fields("title", "year", "embedding", skip_decode=["embedding"])
# Multiple field
query.return_fields("title", "year", "embedding", "image_data",
skip_decode=["embedding", "image_data"])
# All decoded (default behavior)
query.return_fields("title", "year", "description")
# Keep backwards compat
query.return_field("embedding", decode_field=False)
query.return_fields("title", "year")
``` ?