qdrant / rust-client

Rust client for Qdrant vector search engine
https://crates.io/crates/qdrant-client
Apache License 2.0
222 stars 45 forks source link

Simplify JSON to/from Payload conversions #148

Closed timvisee closed 3 months ago

timvisee commented 3 months ago

This simplifies conversions between JSON and Payload in both directions. It adds a new error variant (QdrantError::JsonToPayload) and replaces the convoluted and isolated error type we had for this before.

It also replaces the Payload::from_json_object I had added with Payload::try_from.

I've added documentation for this to clearly show how to convert between the types:

image

The change does not introduce any new problems with the top 12 crates using qdrant_client. It therefore seems good enough in terms of backwards compatibility.

All Submissions:

New Feature Submissions:

  1. [x] Does your submission pass tests?
  2. [x] Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. [x] Have you checked your code using cargo clippy --all --all-features command?