Hi,
Is there a way to convert QuerySearchReturnType object directly to json out of the box?
For query.near_text in python v3 we could directly do
print(json.dumps(response))
but for python v4, the returned object is not serializable
TypeError: Object of type QueryReturn is not JSON serializable
Example coode:
questions = client.collections.get("Question")
response = questions.query.near_text(
query="biology",
limit=2,
return_properties=["category", "question", "answer"],
return_metadata=MetadataQuery(distance=True)
)
json.dumps(response) # this would fail