Skip to content

Unable to compile llm-chain-qdrant #302

@sriharshamadala

Description

@sriharshamadala

I am trying to build the example similarity_search_qdrant.rs. But I am getting the following error when trying to compile llm-chain-qdrant :

   Compiling llm-chain-qdrant v0.13.0
error[E0277]: a value of type `std::option::Option<Vec<Key>>` cannot be built from an iterator over elements of type `PointStruct`
    --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llm-chain-qdrant-0.13.0/src/lib.rs:168:14
     |
168  |             .collect();
     |              ^^^^^^^ value of type `std::option::Option<Vec<Key>>` cannot be built from `std::iter::Iterator<Item=PointStruct>`
     |
     = help: the trait `FromIterator<PointStruct>` is not implemented for `std::option::Option<Vec<Key>>`
             but trait `FromIterator<std::option::Option<Key>>` is implemented for it
     = help: for that trait implementation, expected `std::option::Option<Key>`, found `PointStruct`
note: the method call chain might not have had the expected associated types
    --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llm-chain-qdrant-0.13.0/src/lib.rs:159:14
     |
150  |           let embedding_vecs = self.embeddings.embed_texts(texts.clone()).await?;
     |                                ------------------------------------------------- this expression has type `Vec<Vec<f32>>`
...
156  |               .into_iter()
     |                ----------- `Iterator::Item` is `Vec<f32>` here
157  |               .zip(texts.into_iter())
     |                ---------------------- `Iterator::Item` changed to `(Vec<f32>, String)` here
158  |               .zip(ids.iter())
     |                --------------- `Iterator::Item` changed to `((Vec<f32>, String), &String)` here
159  |               .map(|((vec, text), uuid)| {
     |  ______________^
160  | |                 let mut payload = HashMap::new();
161  | |                 payload.insert(self.content_payload_key.clone(), text.into());
162  | |                 PointStruct {
...    |
166  | |                 }
167  | |             })
     | |______________^ `Iterator::Item` changed to `PointStruct` here
note: required by a bound in `std::iter::Iterator::collect`
    --> /home/tadatmya/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:1967:19
     |
1967 |     fn collect<B: FromIterator<Self::Item>>(self) -> B
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`

error[E0061]: this method takes 4 arguments but 3 arguments were supplied
   --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llm-chain-qdrant-0.13.0/src/lib.rs:170:14
    |
170 |             .upsert_points(self.collection_name.clone(), points, None)
    |              ^^^^^^^^^^^^^                                       ---- argument #3 of type `Vec<PointStruct>` is missing
    |
note: method defined here
   --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/qdrant-client-1.13.0/src/client/points.rs:115:18
    |
115 |     pub async fn upsert_points(
    |                  ^^^^^^^^^^^^^
help: provide the argument
    |
170 |             .upsert_points(self.collection_name.clone(), points, /* Vec<PointStruct> */, None)
    |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0061]: this method takes 4 arguments but 3 arguments were supplied
   --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llm-chain-qdrant-0.13.0/src/lib.rs:212:14
    |
212 |             .upsert_points(self.collection_name.clone(), points, None)
    |              ^^^^^^^^^^^^^--------------------------------------------
    |                           |                              |       |
    |                           |                              |       expected `Vec<PointStruct>`, found `std::option::Option<_>`
    |                           |                              expected `std::option::Option<Vec<Key>>`, found `Vec<PointStruct>`
    |                           argument #4 of type `std::option::Option<WriteOrdering>` is missing
    |
note: method defined here
   --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/qdrant-client-1.13.0/src/client/points.rs:115:18
    |
115 |     pub async fn upsert_points(
    |                  ^^^^^^^^^^^^^
help: did you mean
    |
212 |             .upsert_points(self.collection_name.clone(), None, points, /* std::option::Option<WriteOrdering> */)
    |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0063]: missing fields `shard_key_selector`, `sparse_indices` and `timeout` in initializer of `SearchPoints`
   --> /home/tadatmya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llm-chain-qdrant-0.13.0/src/lib.rs:227:29
    |
227 |             .search_points(&SearchPoints {
    |                             ^^^^^^^^^^^^ missing `shard_key_selector`, `sparse_indices` and `timeout`

Some errors have detailed explanations: E0061, E0063, E0277.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `llm-chain-qdrant` (lib) due to 4 previous errors

My rust compiler version is 1.84.0. and my relavant cargo.toml section is

llm-chain = "0.13.0"
llm-chain-openai = "0.13.0"
llm-chain-qdrant = "0.13.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions