From 531b545c8725c6eaa7d98a98b43c3e7ae4e7d0b4 Mon Sep 17 00:00:00 2001 From: cvauclair Date: Tue, 12 Nov 2024 19:23:06 -0500 Subject: [PATCH] devops: Add rig-qdrant to workspace (#101) * devops: Add rig-qdrant to workspace * fix: example docstring --- Cargo.lock | 293 ++++++++++++++++++-- Cargo.toml | 1 + rig-qdrant/examples/qdrant_vector_search.rs | 2 +- 3 files changed, 278 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b618cca..3012597b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -364,6 +364,28 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "async-trait" version = "0.1.83" @@ -725,6 +747,53 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.1", + "tower 0.5.1", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", +] + [[package]] name = "backoff" version = "0.4.0" @@ -1624,6 +1693,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.79", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -2270,6 +2370,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2309,6 +2410,20 @@ dependencies = [ "tokio", "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.6", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.4.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] @@ -2326,9 +2441,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -2567,7 +2682,7 @@ dependencies = [ "moka", "object_store", "pin-project", - "prost", + "prost 0.12.6", "prost-build", "rand", "roaring", @@ -2626,7 +2741,7 @@ dependencies = [ "num_cpus", "object_store", "pin-project", - "prost", + "prost 0.12.6", "rand", "roaring", "serde_json", @@ -2660,7 +2775,7 @@ dependencies = [ "lance-core", "lazy_static", "log", - "prost", + "prost 0.12.6", "snafu", "tokio", ] @@ -2689,9 +2804,9 @@ dependencies = [ "lance-core", "log", "num-traits", - "prost", + "prost 0.12.6", "prost-build", - "prost-types", + "prost-types 0.12.6", "rand", "snafu", "tokio", @@ -2725,9 +2840,9 @@ dependencies = [ "log", "num-traits", "object_store", - "prost", + "prost 0.12.6", "prost-build", - "prost-types", + "prost-types 0.12.6", "roaring", "snafu", "tempfile", @@ -2773,7 +2888,7 @@ dependencies = [ "moka", "num-traits", "object_store", - "prost", + "prost 0.12.6", "prost-build", "rand", "rayon", @@ -2819,7 +2934,7 @@ dependencies = [ "object_store", "path_abs", "pin-project", - "prost", + "prost 0.12.6", "prost-build", "rand", "shellexpand", @@ -2880,9 +2995,9 @@ dependencies = [ "lazy_static", "log", "object_store", - "prost", + "prost 0.12.6", "prost-build", - "prost-types", + "prost-types 0.12.6", "rand", "rangemap", "roaring", @@ -3148,6 +3263,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "md-5" version = "0.10.6" @@ -3847,7 +3968,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive 0.13.3", ] [[package]] @@ -3864,8 +3995,8 @@ dependencies = [ "once_cell", "petgraph", "prettyplease", - "prost", - "prost-types", + "prost 0.12.6", + "prost-types 0.12.6", "regex", "syn 2.0.79", "tempfile", @@ -3884,13 +4015,35 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost", + "prost 0.12.6", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost 0.13.3", ] [[package]] @@ -3904,6 +4057,24 @@ dependencies = [ "unicase", ] +[[package]] +name = "qdrant-client" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbff72d38eac3860f5888f02d4688690de6cdc77c901112d3b0788694afc1d37" +dependencies = [ + "anyhow", + "derive_builder", + "futures-util", + "prost 0.13.3", + "prost-types 0.13.3", + "reqwest 0.12.8", + "serde", + "serde_json", + "thiserror", + "tonic", +] + [[package]] name = "quanta" version = "0.11.1" @@ -4211,6 +4382,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots 0.26.6", "windows-registry", ] @@ -4294,6 +4466,18 @@ dependencies = [ "tracing", ] +[[package]] +name = "rig-qdrant" +version = "0.1.1" +dependencies = [ + "anyhow", + "qdrant-client", + "rig-core", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "ring" version = "0.17.8" @@ -4420,6 +4604,7 @@ version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -5431,6 +5616,80 @@ dependencies = [ "tokio", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "flate2", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost 0.13.3", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", + "socket2 0.5.7", + "tokio", + "tokio-rustls 0.26.0", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" diff --git a/Cargo.toml b/Cargo.toml index 01e003d0..c8d75273 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,5 @@ resolver = "2" members = [ "rig-core", "rig-lancedb", "rig-mongodb", "rig-neo4j", + "rig-qdrant", ] diff --git a/rig-qdrant/examples/qdrant_vector_search.rs b/rig-qdrant/examples/qdrant_vector_search.rs index b23687cf..c9148d69 100644 --- a/rig-qdrant/examples/qdrant_vector_search.rs +++ b/rig-qdrant/examples/qdrant_vector_search.rs @@ -30,7 +30,7 @@ async fn main() -> Result<(), anyhow::Error> { let client = Qdrant::from_url("http://localhost:6334").build()?; // Create a collection with 1536 dimensions if it doesn't exist - // Note: Make sure the dimensions match the size of the embeddings returned by the + // Note: Make sure the dimensions match the size of the embeddings returned by the // model you are using if !client.collection_exists(COLLECTION_NAME).await? { client