Vectors only support `f32` - should also support `f64`
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
調査の方向性
ベクトル変換が定義されている src/qdrant.rs の2037–2042行付近から始め、PointStruct::new に必要な変換を追跡してください。示されている Ollama のフローから Vec の embedding を使ってコンパイラーエラーを再現し、その後、既存のベクトル変換を壊すことなく Vec が受け入れられることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
I noticed that the vectors only support f32 floats:
and I ran into an issue attempting to load PointStructs that are of Vec<f64> (using embeddings generated from an ollama rust client.
/// An embeddings generation response from Ollama.
#[derive(Debug, Deserialize, Clone)]
pub struct GenerateEmbeddingsResponse {
#[serde(rename = "embedding")]
#[allow(dead_code)]
pub embeddings: Vec<f64>,
}
Trying to use this vec f64 results in:
error[E0277]: the trait bound `qdrant_client::qdrant::Vectors: From<Vec<f64>>` is not satisfied
--> src/main.rs:99:42
|
99 | let point = vec![PointStruct::new(0, embedding_resp.embeddings, payload)];
| ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Vec<f64>>` is not implemented for `qdrant_client::qdrant::Vectors`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `From<T>`:
<qdrant_client::qdrant::Vectors as From<HashMap<std::string::String, qdrant_client::qdrant::Vector>>>
<qdrant_client::qdrant::Vectors as From<HashMap<std::string::String, Vec<f32>>>>
<qdrant_client::qdrant::Vectors as From<HashMap<std::string::String, Vec<(u32, f32)>>>>
<qdrant_client::qdrant::Vectors as From<HashMap<std::string::String, &[(u32, f32)]>>>
<qdrant_client::qdrant::Vectors as From<Vec<f32>>>
= note: required for `Vec<f64>` to implement `Into<qdrant_client::qdrant::Vectors>`
note: required by a bound in `client::<impl qdrant_client::prelude::PointStruct>::new`
--> /home/jmcb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/qdrant-client-1.8.0/src/client.rs:1927:54
|
1927 | pub fn new(id: impl Into<PointId>, vectors: impl Into<Vectors>, payload: Payload) -> Self {
| ^^^^^^^^^^^^^ required by this bound in `client::<impl PointStruct>::new`
For more information about this error, try `rustc --explain E0277`.
warning: `nvim-llama-qdrant-ctl` (bin "nvim-llama-qdrant-ctl") generated 1 warning
error: could not compile `nvim-llama-qdrant-ctl` (bin "nvim-llama-qdrant-ctl") due to 1 previous error; 1 warning emitted
Steps to reproduce
- Bootstrap qdrant client, collection, etc.
let qdrant_client = QdrantClient::from_url("http://localhost:6334").build()?;
let collection_name = "test";
qdrant_client
.create_collection(&CreateCollection {
collection_name: collection_name.into(),
vectors_config: Some(VectorsConfig {
config: Some(Config::Params(VectorParams {
size: 384, // size of the all-minilm embeddings
distance: Distance::Cosine.into(),
..Default::default()
})),
}),
..Default::default()
})
.await?;
- Bootstrap olllama client:
let ollama = Ollama::default();
let ollama = Ollama::new("http://localhost".to_string(), 11434);
- Generate an embedding using the ollama client - this is a
Vec<f64>
let embedding_model = "all-minilm".to_string();
let embedding_prompt = "Woof woof, bark bark".to_string();
let embedding_resp = ollama
.generate_embeddings(embedding_model, embedding_prompt, None)
.await
.unwrap();
- Attempt to use it in a
PointStructand notice error.
let payload: Payload = json!(
{
"test": "this is a test",
}
)
.try_into()
.unwrap();
let point = vec![PointStruct::new(0, embedding_resp.embeddings, payload)];
client
.upsert_points_blocking(collection_name, None, point, None)
.await?;
- 主要言語
- Rust
- スター
- 425
- フォーク
- 89
- 平均マージ
- 2時間 48分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
qdrant/rust-client のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
qdrant/rust-client#320 ·
-
upsert_points deep-clones the whole request on every call, not only on retry再び着手できるかも @NullSense が 7 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
qdrant/rust-client#316 · コメント 3 件 ·
-
Option to set TLS domain name and :authority origin (client behind a tunnel/proxy)再び着手できるかも @inamdarmihir が 37 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
qdrant/rust-client#306 · コメント 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
qdrant/rust-client#289 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
qdrant/rust-client#272 · リアクション 2 件 ·
qdrant/rust-client の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
foundry-rs/starknet-foundry#4733 ·
メンテナーはふだん 4 日以内に返信
-
autofix:working
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
libracoder/kiri#1138 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信