Skip to content

Object of type QueryResponse is not JSON serializable #126

Closed

Description

@slicksammy

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?

Activity

  1. gdj0nes commented on Feb 1, 2023

    @gdj0nes
    Contributor

    @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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions