Skip to content

Commit

Permalink
chore(shuttle-qdrant): update to qdrant 1.10 (#1821)
Browse files Browse the repository at this point in the history
Dreaming-Codes authored Jul 15, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
1 parent d60c310 commit 69fb9ed
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion resources/qdrant/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ keywords = ["shuttle-service", "qdrant"]

[dependencies]
async-trait = "0.1.56"
qdrant-client = "1.7.0"
qdrant-client = "1.10.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
shuttle-service = { path = "../../service", version = "0.46.0" }
14 changes: 7 additions & 7 deletions resources/qdrant/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use async_trait::async_trait;
use qdrant_client::prelude::*;
use serde::{Deserialize, Serialize};
use shuttle_service::{
error::{CustomError, Error},
@@ -70,7 +69,7 @@ impl ResourceInputBuilder for Qdrant {
serde_json::to_value(ContainerRequest {
project_name: md.project_name,
container_name: "qdrant".to_string(),
image: "docker.io/qdrant/qdrant:v1.7.4".to_string(),
image: "docker.io/qdrant/qdrant:v1.10.0".to_string(),
port: "6334/tcp".to_string(),
env: vec![],
})
@@ -98,17 +97,18 @@ pub struct QdrantClientConfigWrap {
}

#[async_trait]
impl IntoResource<QdrantClient> for OutputWrapper {
async fn into_resource(self) -> Result<QdrantClient, Error> {
impl IntoResource<qdrant_client::Qdrant> for OutputWrapper {
async fn into_resource(self) -> Result<qdrant_client::Qdrant, Error> {
let config = match self {
Self::Container(output) => QdrantClientConfigWrap {
url: format!("http://localhost:{}", output.output.host_port),
api_key: None,
},
Self::Config(c) => c,
};
Ok(QdrantClientConfig::from_url(&config.url)
.with_api_key(config.api_key)
.build()?)
Ok(qdrant_client::config::QdrantConfig::from_url(&config.url)
.api_key(config.api_key)
.build()
.map_err(|err| Error::Custom(err.into()))?)
}
}

0 comments on commit 69fb9ed

Please sign in to comment.