pinecone-io / pinecone-python-client

The Pinecone Python client
https://www.pinecone.io/docs
Apache License 2.0
309 stars 80 forks source link

Object of type QueryResponse is not JSON serializable #126

Closed slicksammy closed 1 year ago

slicksammy commented 1 year ago

I'm unable to serialize the query response

response = index.query(vector=embedding, top_k=5, include_metadata=True)
json.dumps(response)

And I get Object of type QueryResponse is not JSON serializable. Is there a recommendation on how to serialize this object?

gdj0nes commented 1 year ago

@slicksammy thanks for reaching out! The response itself should not be assumed to be JSON serializable. I recommend unpacking the object first. Let us know if that works for you