diff --git a/ahnlich/Cargo.lock b/ahnlich/Cargo.lock index 1117eb1b..62ceee41 100644 --- a/ahnlich/Cargo.lock +++ b/ahnlich/Cargo.lock @@ -33,7 +33,7 @@ dependencies = [ [[package]] name = "ahnlich_client_rs" -version = "0.2.0" +version = "0.2.1" dependencies = [ "ahnlich_types", "ai", @@ -76,7 +76,7 @@ dependencies = [ [[package]] name = "ahnlich_types" -version = "0.2.0" +version = "0.2.1" dependencies = [ "ascii85", "prost 0.13.5", diff --git a/ahnlich/client/Cargo.toml b/ahnlich/client/Cargo.toml index f6e48f1f..d315ecf3 100644 --- a/ahnlich/client/Cargo.toml +++ b/ahnlich/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ahnlich_client_rs" -version = "0.2.0" +version = "0.2.1" authors = ["Diretnan Domnan "] categories = ["database-implementations", "database", "web-programming"] keywords = ["ahnlich", "in-memory", "ai"] diff --git a/ahnlich/client/src/ai.rs b/ahnlich/client/src/ai.rs index 89328e92..9563064f 100644 --- a/ahnlich/client/src/ai.rs +++ b/ahnlich/client/src/ai.rs @@ -3,9 +3,9 @@ use ahnlich_types::{ pipeline::{AiQuery, AiRequestPipeline, AiResponsePipeline, ai_query::Query}, query::{ ConvertStoreInputToEmbeddings, CreateNonLinearAlgorithmIndex, CreatePredIndex, - CreateStore, DelKey, DropNonLinearAlgorithmIndex, DropPredIndex, DropStore, GetKey, - GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, PurgeStores, - Set, + CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropStore, + GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, + PurgeStores, Set, }, server::{ AiStoreInfo, ClientList, CreateIndex, Del, Get, GetSimN as GetSimNResult, Pong, @@ -87,6 +87,10 @@ impl AiPipeline { self.queries.push(Query::DelKey(params)); } + pub fn del_pred(&mut self, params: DelPred) { + self.queries.push(Query::DelPred(params)); + } + pub fn drop_store(&mut self, params: DropStore) { self.queries.push(Query::DropStore(params)); } @@ -296,6 +300,17 @@ impl AiClient { .into_inner()) } + pub async fn del_pred( + &self, + params: DelPred, + tracing_id: Option, + ) -> Result { + let mut req = tonic::Request::new(params); + add_trace_parent(&mut req, tracing_id); + add_auth_header(&mut req, &self.auth_token); + Ok(self.client.clone().del_pred(req).await?.into_inner()) + } + pub async fn del_key( &self, params: DelKey, diff --git a/ahnlich/types/Cargo.toml b/ahnlich/types/Cargo.toml index 96529089..7e701b56 100644 --- a/ahnlich/types/Cargo.toml +++ b/ahnlich/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ahnlich_types" -version = "0.2.0" +version = "0.2.1" authors = ["Diretnan Domnan "] categories = ["database-implementations", "database", "web-programming"] keywords = ["ahnlich", "in-memory", "ai"]