1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct RetrievalFilters {
4 #[prost(string, tag = "1")]
5 pub collection: ::prost::alloc::string::String,
6 #[prost(string, repeated, tag = "2")]
7 pub document_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8 #[prost(string, tag = "3")]
9 pub user_id: ::prost::alloc::string::String,
10 #[prost(string, tag = "4")]
11 pub session_id: ::prost::alloc::string::String,
12 #[prost(string, tag = "5")]
13 pub scope: ::prost::alloc::string::String,
14 #[prost(string, tag = "6")]
15 pub namespace: ::prost::alloc::string::String,
16}
17#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
18pub struct RetrievalPlan {
19 #[prost(string, tag = "1")]
20 pub query: ::prost::alloc::string::String,
21 #[prost(string, repeated, tag = "2")]
22 pub keywords: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
23 #[prost(string, repeated, tag = "3")]
24 pub alternate_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
25 #[prost(string, repeated, tag = "4")]
26 pub entity_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
27 #[prost(string, tag = "5")]
28 pub retrieval_mode: ::prost::alloc::string::String,
29 #[prost(message, optional, tag = "6")]
30 pub filters: ::core::option::Option<RetrievalFilters>,
31}
32#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
33pub struct RetrievalDecision {
34 #[prost(string, tag = "1")]
35 pub requested_mode: ::prost::alloc::string::String,
36 #[prost(string, tag = "2")]
37 pub effective_mode: ::prost::alloc::string::String,
38 #[prost(bool, tag = "3")]
39 pub use_graph: bool,
40 #[prost(string, tag = "4")]
41 pub reason: ::prost::alloc::string::String,
42}
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct GraphRagChunkResult {
45 #[prost(string, tag = "1")]
46 pub id: ::prost::alloc::string::String,
47 #[prost(string, tag = "2")]
48 pub document_id: ::prost::alloc::string::String,
49 #[prost(string, tag = "3")]
50 pub content: ::prost::alloc::string::String,
51 #[prost(double, tag = "4")]
52 pub score: f64,
53 #[prost(double, tag = "5")]
54 pub base_score: f64,
55 #[prost(double, tag = "6")]
56 pub rerank_score: f64,
57 #[prost(string, repeated, tag = "7")]
58 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
59}
60#[derive(Clone, PartialEq, ::prost::Message)]
61pub struct ToolEntityInput {
62 #[prost(string, tag = "1")]
63 pub id: ::prost::alloc::string::String,
64 #[prost(string, tag = "2")]
65 pub name: ::prost::alloc::string::String,
66 #[prost(string, tag = "3")]
67 pub r#type: ::prost::alloc::string::String,
68 #[prost(string, tag = "4")]
69 pub description: ::prost::alloc::string::String,
70 #[prost(string, repeated, tag = "5")]
71 pub chunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
72 #[prost(map = "string, string", tag = "6")]
73 pub metadata: ::std::collections::HashMap<
74 ::prost::alloc::string::String,
75 ::prost::alloc::string::String,
76 >,
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct ToolRelationInput {
80 #[prost(string, tag = "1")]
81 pub from: ::prost::alloc::string::String,
82 #[prost(string, tag = "2")]
83 pub to: ::prost::alloc::string::String,
84 #[prost(string, tag = "3")]
85 pub r#type: ::prost::alloc::string::String,
86 #[prost(double, tag = "4")]
87 pub weight: f64,
88 #[prost(string, repeated, tag = "5")]
89 pub chunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
90 #[prost(map = "string, string", tag = "6")]
91 pub metadata: ::std::collections::HashMap<
92 ::prost::alloc::string::String,
93 ::prost::alloc::string::String,
94 >,
95 #[prost(bool, tag = "7")]
96 pub inferred: bool,
97 #[prost(string, tag = "8")]
98 pub provenance: ::prost::alloc::string::String,
99 #[prost(string, tag = "9")]
100 pub rule_id: ::prost::alloc::string::String,
101 #[prost(string, repeated, tag = "10")]
102 pub support_edge_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
103}
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct KnowledgeRecord {
106 #[prost(string, tag = "1")]
107 pub id: ::prost::alloc::string::String,
108 #[prost(string, tag = "2")]
109 pub title: ::prost::alloc::string::String,
110 #[prost(string, tag = "3")]
111 pub content: ::prost::alloc::string::String,
112 #[prost(string, tag = "4")]
113 pub source_url: ::prost::alloc::string::String,
114 #[prost(string, tag = "5")]
115 pub author: ::prost::alloc::string::String,
116 #[prost(string, tag = "6")]
117 pub collection: ::prost::alloc::string::String,
118 #[prost(map = "string, string", tag = "7")]
119 pub metadata: ::std::collections::HashMap<
120 ::prost::alloc::string::String,
121 ::prost::alloc::string::String,
122 >,
123 #[prost(string, repeated, tag = "8")]
124 pub chunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
125 #[prost(string, repeated, tag = "9")]
126 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
127 #[prost(message, optional, tag = "10")]
128 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
129 #[prost(message, optional, tag = "11")]
130 pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
131}
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct SaveKnowledgeRequest {
134 #[prost(string, tag = "1")]
135 pub knowledge_id: ::prost::alloc::string::String,
136 #[prost(string, tag = "2")]
137 pub title: ::prost::alloc::string::String,
138 #[prost(string, tag = "3")]
139 pub content: ::prost::alloc::string::String,
140 #[prost(string, tag = "4")]
141 pub source_url: ::prost::alloc::string::String,
142 #[prost(string, tag = "5")]
143 pub author: ::prost::alloc::string::String,
144 #[prost(string, tag = "6")]
145 pub collection: ::prost::alloc::string::String,
146 #[prost(int32, tag = "7")]
147 pub chunk_size: i32,
148 #[prost(int32, tag = "8")]
149 pub chunk_overlap: i32,
150 #[prost(map = "string, string", tag = "9")]
151 pub metadata: ::std::collections::HashMap<
152 ::prost::alloc::string::String,
153 ::prost::alloc::string::String,
154 >,
155 #[prost(message, repeated, tag = "10")]
156 pub entities: ::prost::alloc::vec::Vec<ToolEntityInput>,
157 #[prost(message, repeated, tag = "11")]
158 pub relations: ::prost::alloc::vec::Vec<ToolRelationInput>,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct SaveKnowledgeResponse {
162 #[prost(message, optional, tag = "1")]
163 pub knowledge: ::core::option::Option<KnowledgeRecord>,
164 #[prost(string, tag = "2")]
165 pub document_node_id: ::prost::alloc::string::String,
166 #[prost(string, repeated, tag = "3")]
167 pub entity_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
168 #[prost(string, repeated, tag = "4")]
169 pub relation_edge_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
170}
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct UpdateKnowledgeRequest {
173 #[prost(string, tag = "1")]
174 pub knowledge_id: ::prost::alloc::string::String,
175 #[prost(string, optional, tag = "2")]
176 pub title: ::core::option::Option<::prost::alloc::string::String>,
177 #[prost(string, optional, tag = "3")]
178 pub content: ::core::option::Option<::prost::alloc::string::String>,
179 #[prost(string, optional, tag = "4")]
180 pub source_url: ::core::option::Option<::prost::alloc::string::String>,
181 #[prost(string, optional, tag = "5")]
182 pub author: ::core::option::Option<::prost::alloc::string::String>,
183 #[prost(string, optional, tag = "6")]
184 pub collection: ::core::option::Option<::prost::alloc::string::String>,
185 #[prost(int32, optional, tag = "7")]
186 pub chunk_size: ::core::option::Option<i32>,
187 #[prost(int32, optional, tag = "8")]
188 pub chunk_overlap: ::core::option::Option<i32>,
189 #[prost(map = "string, string", tag = "9")]
190 pub metadata: ::std::collections::HashMap<
191 ::prost::alloc::string::String,
192 ::prost::alloc::string::String,
193 >,
194 #[prost(message, repeated, tag = "10")]
195 pub entities: ::prost::alloc::vec::Vec<ToolEntityInput>,
196 #[prost(message, repeated, tag = "11")]
197 pub relations: ::prost::alloc::vec::Vec<ToolRelationInput>,
198}
199#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
200pub struct GetKnowledgeRequest {
201 #[prost(string, tag = "1")]
202 pub knowledge_id: ::prost::alloc::string::String,
203}
204#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct GetKnowledgeResponse {
206 #[prost(message, optional, tag = "1")]
207 pub knowledge: ::core::option::Option<KnowledgeRecord>,
208}
209#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
210pub struct DeleteKnowledgeRequest {
211 #[prost(string, tag = "1")]
212 pub knowledge_id: ::prost::alloc::string::String,
213}
214#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
215pub struct DeleteKnowledgeResponse {
216 #[prost(string, tag = "1")]
217 pub knowledge_id: ::prost::alloc::string::String,
218 #[prost(bool, tag = "2")]
219 pub deleted: bool,
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct SearchKnowledgeRequest {
223 #[prost(string, tag = "1")]
224 pub query: ::prost::alloc::string::String,
225 #[prost(string, tag = "2")]
226 pub collection: ::prost::alloc::string::String,
227 #[prost(int32, tag = "3")]
228 pub top_k: i32,
229 #[prost(int32, tag = "4")]
230 pub max_hops: i32,
231 #[prost(int32, tag = "5")]
232 pub max_related_chunks: i32,
233 #[prost(int32, tag = "6")]
234 pub max_context_chunks: i32,
235 #[prost(int32, tag = "7")]
236 pub max_context_chars: i32,
237 #[prost(int32, tag = "8")]
238 pub per_document_limit: i32,
239 #[prost(double, tag = "9")]
240 pub diversity_lambda: f64,
241 #[prost(bool, tag = "10")]
242 pub disable_rerank: bool,
243 #[prost(string, repeated, tag = "11")]
244 pub entity_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
245 #[prost(string, repeated, tag = "12")]
246 pub keywords: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
247 #[prost(string, repeated, tag = "13")]
248 pub alternate_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
249 #[prost(string, tag = "14")]
250 pub retrieval_mode: ::prost::alloc::string::String,
251 #[prost(bool, tag = "15")]
252 pub disable_graph: bool,
253 #[prost(bool, tag = "16")]
254 pub graph_light: bool,
255 #[prost(int32, tag = "17")]
256 pub max_expansion_seeds: i32,
257 #[prost(int32, tag = "18")]
258 pub max_traversal_nodes: i32,
259 #[prost(int32, tag = "19")]
260 pub max_entities_per_chunk: i32,
261 #[prost(message, optional, tag = "20")]
262 pub plan: ::core::option::Option<RetrievalPlan>,
263}
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct KnowledgeSearchHit {
266 #[prost(string, tag = "1")]
267 pub knowledge_id: ::prost::alloc::string::String,
268 #[prost(string, tag = "2")]
269 pub title: ::prost::alloc::string::String,
270 #[prost(string, tag = "3")]
271 pub source_url: ::prost::alloc::string::String,
272 #[prost(string, tag = "4")]
273 pub author: ::prost::alloc::string::String,
274 #[prost(string, tag = "5")]
275 pub snippet: ::prost::alloc::string::String,
276 #[prost(double, tag = "6")]
277 pub score: f64,
278 #[prost(string, repeated, tag = "7")]
279 pub chunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
280 #[prost(string, repeated, tag = "8")]
281 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
282 #[prost(map = "string, string", tag = "9")]
283 pub metadata: ::std::collections::HashMap<
284 ::prost::alloc::string::String,
285 ::prost::alloc::string::String,
286 >,
287}
288#[derive(Clone, PartialEq, ::prost::Message)]
289pub struct SearchKnowledgeResponse {
290 #[prost(string, tag = "1")]
291 pub query: ::prost::alloc::string::String,
292 #[prost(message, optional, tag = "2")]
293 pub plan: ::core::option::Option<RetrievalPlan>,
294 #[prost(message, optional, tag = "3")]
295 pub decision: ::core::option::Option<RetrievalDecision>,
296 #[prost(message, repeated, tag = "4")]
297 pub results: ::prost::alloc::vec::Vec<KnowledgeSearchHit>,
298 #[prost(message, repeated, tag = "5")]
299 pub chunks: ::prost::alloc::vec::Vec<GraphRagChunkResult>,
300 #[prost(string, repeated, tag = "6")]
301 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
302 #[prost(string, tag = "7")]
303 pub context: ::prost::alloc::string::String,
304}
305pub mod knowledge_service_client {
307 #![allow(
308 unused_variables,
309 dead_code,
310 missing_docs,
311 clippy::wildcard_imports,
312 clippy::let_unit_value,
313 )]
314 use tonic::codegen::*;
315 use tonic::codegen::http::Uri;
316 #[derive(Debug, Clone)]
317 pub struct KnowledgeServiceClient<T> {
318 inner: tonic::client::Grpc<T>,
319 }
320 impl KnowledgeServiceClient<tonic::transport::Channel> {
321 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
323 where
324 D: TryInto<tonic::transport::Endpoint>,
325 D::Error: Into<StdError>,
326 {
327 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
328 Ok(Self::new(conn))
329 }
330 }
331 impl<T> KnowledgeServiceClient<T>
332 where
333 T: tonic::client::GrpcService<tonic::body::Body>,
334 T::Error: Into<StdError>,
335 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
336 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
337 {
338 pub fn new(inner: T) -> Self {
339 let inner = tonic::client::Grpc::new(inner);
340 Self { inner }
341 }
342 pub fn with_origin(inner: T, origin: Uri) -> Self {
343 let inner = tonic::client::Grpc::with_origin(inner, origin);
344 Self { inner }
345 }
346 pub fn with_interceptor<F>(
347 inner: T,
348 interceptor: F,
349 ) -> KnowledgeServiceClient<InterceptedService<T, F>>
350 where
351 F: tonic::service::Interceptor,
352 T::ResponseBody: Default,
353 T: tonic::codegen::Service<
354 http::Request<tonic::body::Body>,
355 Response = http::Response<
356 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
357 >,
358 >,
359 <T as tonic::codegen::Service<
360 http::Request<tonic::body::Body>,
361 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
362 {
363 KnowledgeServiceClient::new(InterceptedService::new(inner, interceptor))
364 }
365 #[must_use]
370 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
371 self.inner = self.inner.send_compressed(encoding);
372 self
373 }
374 #[must_use]
376 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
377 self.inner = self.inner.accept_compressed(encoding);
378 self
379 }
380 #[must_use]
384 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
385 self.inner = self.inner.max_decoding_message_size(limit);
386 self
387 }
388 #[must_use]
392 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
393 self.inner = self.inner.max_encoding_message_size(limit);
394 self
395 }
396 pub async fn save_knowledge(
397 &mut self,
398 request: impl tonic::IntoRequest<super::SaveKnowledgeRequest>,
399 ) -> std::result::Result<
400 tonic::Response<super::SaveKnowledgeResponse>,
401 tonic::Status,
402 > {
403 self.inner
404 .ready()
405 .await
406 .map_err(|e| {
407 tonic::Status::unknown(
408 format!("Service was not ready: {}", e.into()),
409 )
410 })?;
411 let codec = tonic_prost::ProstCodec::default();
412 let path = http::uri::PathAndQuery::from_static(
413 "/cortexdb.v1.KnowledgeService/SaveKnowledge",
414 );
415 let mut req = request.into_request();
416 req.extensions_mut()
417 .insert(
418 GrpcMethod::new("cortexdb.v1.KnowledgeService", "SaveKnowledge"),
419 );
420 self.inner.unary(req, path, codec).await
421 }
422 pub async fn update_knowledge(
423 &mut self,
424 request: impl tonic::IntoRequest<super::UpdateKnowledgeRequest>,
425 ) -> std::result::Result<
426 tonic::Response<super::SaveKnowledgeResponse>,
427 tonic::Status,
428 > {
429 self.inner
430 .ready()
431 .await
432 .map_err(|e| {
433 tonic::Status::unknown(
434 format!("Service was not ready: {}", e.into()),
435 )
436 })?;
437 let codec = tonic_prost::ProstCodec::default();
438 let path = http::uri::PathAndQuery::from_static(
439 "/cortexdb.v1.KnowledgeService/UpdateKnowledge",
440 );
441 let mut req = request.into_request();
442 req.extensions_mut()
443 .insert(
444 GrpcMethod::new("cortexdb.v1.KnowledgeService", "UpdateKnowledge"),
445 );
446 self.inner.unary(req, path, codec).await
447 }
448 pub async fn get_knowledge(
449 &mut self,
450 request: impl tonic::IntoRequest<super::GetKnowledgeRequest>,
451 ) -> std::result::Result<
452 tonic::Response<super::GetKnowledgeResponse>,
453 tonic::Status,
454 > {
455 self.inner
456 .ready()
457 .await
458 .map_err(|e| {
459 tonic::Status::unknown(
460 format!("Service was not ready: {}", e.into()),
461 )
462 })?;
463 let codec = tonic_prost::ProstCodec::default();
464 let path = http::uri::PathAndQuery::from_static(
465 "/cortexdb.v1.KnowledgeService/GetKnowledge",
466 );
467 let mut req = request.into_request();
468 req.extensions_mut()
469 .insert(GrpcMethod::new("cortexdb.v1.KnowledgeService", "GetKnowledge"));
470 self.inner.unary(req, path, codec).await
471 }
472 pub async fn search_knowledge(
473 &mut self,
474 request: impl tonic::IntoRequest<super::SearchKnowledgeRequest>,
475 ) -> std::result::Result<
476 tonic::Response<super::SearchKnowledgeResponse>,
477 tonic::Status,
478 > {
479 self.inner
480 .ready()
481 .await
482 .map_err(|e| {
483 tonic::Status::unknown(
484 format!("Service was not ready: {}", e.into()),
485 )
486 })?;
487 let codec = tonic_prost::ProstCodec::default();
488 let path = http::uri::PathAndQuery::from_static(
489 "/cortexdb.v1.KnowledgeService/SearchKnowledge",
490 );
491 let mut req = request.into_request();
492 req.extensions_mut()
493 .insert(
494 GrpcMethod::new("cortexdb.v1.KnowledgeService", "SearchKnowledge"),
495 );
496 self.inner.unary(req, path, codec).await
497 }
498 pub async fn delete_knowledge(
499 &mut self,
500 request: impl tonic::IntoRequest<super::DeleteKnowledgeRequest>,
501 ) -> std::result::Result<
502 tonic::Response<super::DeleteKnowledgeResponse>,
503 tonic::Status,
504 > {
505 self.inner
506 .ready()
507 .await
508 .map_err(|e| {
509 tonic::Status::unknown(
510 format!("Service was not ready: {}", e.into()),
511 )
512 })?;
513 let codec = tonic_prost::ProstCodec::default();
514 let path = http::uri::PathAndQuery::from_static(
515 "/cortexdb.v1.KnowledgeService/DeleteKnowledge",
516 );
517 let mut req = request.into_request();
518 req.extensions_mut()
519 .insert(
520 GrpcMethod::new("cortexdb.v1.KnowledgeService", "DeleteKnowledge"),
521 );
522 self.inner.unary(req, path, codec).await
523 }
524 }
525}
526#[derive(Clone, PartialEq, ::prost::Message)]
527pub struct MemoryRecord {
528 #[prost(string, tag = "1")]
529 pub id: ::prost::alloc::string::String,
530 #[prost(string, tag = "2")]
531 pub user_id: ::prost::alloc::string::String,
532 #[prost(string, tag = "3")]
533 pub session_id: ::prost::alloc::string::String,
534 #[prost(string, tag = "4")]
535 pub scope: ::prost::alloc::string::String,
536 #[prost(string, tag = "5")]
537 pub namespace: ::prost::alloc::string::String,
538 #[prost(string, tag = "6")]
539 pub role: ::prost::alloc::string::String,
540 #[prost(string, tag = "7")]
541 pub content: ::prost::alloc::string::String,
542 #[prost(message, optional, tag = "8")]
543 pub metadata: ::core::option::Option<::prost_types::Struct>,
544 #[prost(double, tag = "9")]
545 pub importance: f64,
546 #[prost(int32, tag = "10")]
547 pub ttl_seconds: i32,
548 #[prost(message, optional, tag = "11")]
549 pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
550 #[prost(message, optional, tag = "12")]
551 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
552}
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct SaveMemoryRequest {
555 #[prost(string, tag = "1")]
556 pub memory_id: ::prost::alloc::string::String,
557 #[prost(string, tag = "2")]
558 pub user_id: ::prost::alloc::string::String,
559 #[prost(string, tag = "3")]
560 pub session_id: ::prost::alloc::string::String,
561 #[prost(string, tag = "4")]
562 pub scope: ::prost::alloc::string::String,
563 #[prost(string, tag = "5")]
564 pub namespace: ::prost::alloc::string::String,
565 #[prost(string, tag = "6")]
566 pub role: ::prost::alloc::string::String,
567 #[prost(string, tag = "7")]
568 pub content: ::prost::alloc::string::String,
569 #[prost(message, optional, tag = "8")]
570 pub metadata: ::core::option::Option<::prost_types::Struct>,
571 #[prost(double, tag = "9")]
572 pub importance: f64,
573 #[prost(int32, tag = "10")]
574 pub ttl_seconds: i32,
575}
576#[derive(Clone, PartialEq, ::prost::Message)]
577pub struct SaveMemoryResponse {
578 #[prost(message, optional, tag = "1")]
579 pub memory: ::core::option::Option<MemoryRecord>,
580}
581#[derive(Clone, PartialEq, ::prost::Message)]
582pub struct UpdateMemoryRequest {
583 #[prost(string, tag = "1")]
584 pub memory_id: ::prost::alloc::string::String,
585 #[prost(string, optional, tag = "2")]
586 pub content: ::core::option::Option<::prost::alloc::string::String>,
587 #[prost(message, optional, tag = "3")]
588 pub metadata: ::core::option::Option<::prost_types::Struct>,
589 #[prost(double, optional, tag = "4")]
590 pub importance: ::core::option::Option<f64>,
591 #[prost(int32, optional, tag = "5")]
592 pub ttl_seconds: ::core::option::Option<i32>,
593}
594#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
595pub struct GetMemoryRequest {
596 #[prost(string, tag = "1")]
597 pub memory_id: ::prost::alloc::string::String,
598}
599#[derive(Clone, PartialEq, ::prost::Message)]
600pub struct GetMemoryResponse {
601 #[prost(message, optional, tag = "1")]
602 pub memory: ::core::option::Option<MemoryRecord>,
603}
604#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
605pub struct DeleteMemoryRequest {
606 #[prost(string, tag = "1")]
607 pub memory_id: ::prost::alloc::string::String,
608}
609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
610pub struct DeleteMemoryResponse {
611 #[prost(string, tag = "1")]
612 pub memory_id: ::prost::alloc::string::String,
613 #[prost(bool, tag = "2")]
614 pub deleted: bool,
615}
616#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
617pub struct SearchMemoryRequest {
618 #[prost(string, tag = "1")]
619 pub query: ::prost::alloc::string::String,
620 #[prost(string, tag = "2")]
621 pub user_id: ::prost::alloc::string::String,
622 #[prost(string, tag = "3")]
623 pub session_id: ::prost::alloc::string::String,
624 #[prost(string, tag = "4")]
625 pub scope: ::prost::alloc::string::String,
626 #[prost(string, tag = "5")]
627 pub namespace: ::prost::alloc::string::String,
628 #[prost(int32, tag = "6")]
629 pub top_k: i32,
630 #[prost(string, repeated, tag = "7")]
631 pub keywords: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
632 #[prost(string, repeated, tag = "8")]
633 pub alternate_queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
634 #[prost(string, tag = "9")]
635 pub retrieval_mode: ::prost::alloc::string::String,
636 #[prost(message, optional, tag = "10")]
637 pub plan: ::core::option::Option<RetrievalPlan>,
638}
639#[derive(Clone, PartialEq, ::prost::Message)]
640pub struct MemorySearchHit {
641 #[prost(message, optional, tag = "1")]
642 pub memory: ::core::option::Option<MemoryRecord>,
643 #[prost(double, tag = "2")]
644 pub score: f64,
645}
646#[derive(Clone, PartialEq, ::prost::Message)]
647pub struct SearchMemoryResponse {
648 #[prost(string, tag = "1")]
649 pub query: ::prost::alloc::string::String,
650 #[prost(message, optional, tag = "2")]
651 pub plan: ::core::option::Option<RetrievalPlan>,
652 #[prost(message, optional, tag = "3")]
653 pub decision: ::core::option::Option<RetrievalDecision>,
654 #[prost(message, repeated, tag = "4")]
655 pub results: ::prost::alloc::vec::Vec<MemorySearchHit>,
656}
657pub mod memory_service_client {
659 #![allow(
660 unused_variables,
661 dead_code,
662 missing_docs,
663 clippy::wildcard_imports,
664 clippy::let_unit_value,
665 )]
666 use tonic::codegen::*;
667 use tonic::codegen::http::Uri;
668 #[derive(Debug, Clone)]
669 pub struct MemoryServiceClient<T> {
670 inner: tonic::client::Grpc<T>,
671 }
672 impl MemoryServiceClient<tonic::transport::Channel> {
673 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
675 where
676 D: TryInto<tonic::transport::Endpoint>,
677 D::Error: Into<StdError>,
678 {
679 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
680 Ok(Self::new(conn))
681 }
682 }
683 impl<T> MemoryServiceClient<T>
684 where
685 T: tonic::client::GrpcService<tonic::body::Body>,
686 T::Error: Into<StdError>,
687 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
688 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
689 {
690 pub fn new(inner: T) -> Self {
691 let inner = tonic::client::Grpc::new(inner);
692 Self { inner }
693 }
694 pub fn with_origin(inner: T, origin: Uri) -> Self {
695 let inner = tonic::client::Grpc::with_origin(inner, origin);
696 Self { inner }
697 }
698 pub fn with_interceptor<F>(
699 inner: T,
700 interceptor: F,
701 ) -> MemoryServiceClient<InterceptedService<T, F>>
702 where
703 F: tonic::service::Interceptor,
704 T::ResponseBody: Default,
705 T: tonic::codegen::Service<
706 http::Request<tonic::body::Body>,
707 Response = http::Response<
708 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
709 >,
710 >,
711 <T as tonic::codegen::Service<
712 http::Request<tonic::body::Body>,
713 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
714 {
715 MemoryServiceClient::new(InterceptedService::new(inner, interceptor))
716 }
717 #[must_use]
722 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
723 self.inner = self.inner.send_compressed(encoding);
724 self
725 }
726 #[must_use]
728 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
729 self.inner = self.inner.accept_compressed(encoding);
730 self
731 }
732 #[must_use]
736 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
737 self.inner = self.inner.max_decoding_message_size(limit);
738 self
739 }
740 #[must_use]
744 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
745 self.inner = self.inner.max_encoding_message_size(limit);
746 self
747 }
748 pub async fn save_memory(
749 &mut self,
750 request: impl tonic::IntoRequest<super::SaveMemoryRequest>,
751 ) -> std::result::Result<
752 tonic::Response<super::SaveMemoryResponse>,
753 tonic::Status,
754 > {
755 self.inner
756 .ready()
757 .await
758 .map_err(|e| {
759 tonic::Status::unknown(
760 format!("Service was not ready: {}", e.into()),
761 )
762 })?;
763 let codec = tonic_prost::ProstCodec::default();
764 let path = http::uri::PathAndQuery::from_static(
765 "/cortexdb.v1.MemoryService/SaveMemory",
766 );
767 let mut req = request.into_request();
768 req.extensions_mut()
769 .insert(GrpcMethod::new("cortexdb.v1.MemoryService", "SaveMemory"));
770 self.inner.unary(req, path, codec).await
771 }
772 pub async fn update_memory(
773 &mut self,
774 request: impl tonic::IntoRequest<super::UpdateMemoryRequest>,
775 ) -> std::result::Result<
776 tonic::Response<super::SaveMemoryResponse>,
777 tonic::Status,
778 > {
779 self.inner
780 .ready()
781 .await
782 .map_err(|e| {
783 tonic::Status::unknown(
784 format!("Service was not ready: {}", e.into()),
785 )
786 })?;
787 let codec = tonic_prost::ProstCodec::default();
788 let path = http::uri::PathAndQuery::from_static(
789 "/cortexdb.v1.MemoryService/UpdateMemory",
790 );
791 let mut req = request.into_request();
792 req.extensions_mut()
793 .insert(GrpcMethod::new("cortexdb.v1.MemoryService", "UpdateMemory"));
794 self.inner.unary(req, path, codec).await
795 }
796 pub async fn get_memory(
797 &mut self,
798 request: impl tonic::IntoRequest<super::GetMemoryRequest>,
799 ) -> std::result::Result<
800 tonic::Response<super::GetMemoryResponse>,
801 tonic::Status,
802 > {
803 self.inner
804 .ready()
805 .await
806 .map_err(|e| {
807 tonic::Status::unknown(
808 format!("Service was not ready: {}", e.into()),
809 )
810 })?;
811 let codec = tonic_prost::ProstCodec::default();
812 let path = http::uri::PathAndQuery::from_static(
813 "/cortexdb.v1.MemoryService/GetMemory",
814 );
815 let mut req = request.into_request();
816 req.extensions_mut()
817 .insert(GrpcMethod::new("cortexdb.v1.MemoryService", "GetMemory"));
818 self.inner.unary(req, path, codec).await
819 }
820 pub async fn search_memory(
821 &mut self,
822 request: impl tonic::IntoRequest<super::SearchMemoryRequest>,
823 ) -> std::result::Result<
824 tonic::Response<super::SearchMemoryResponse>,
825 tonic::Status,
826 > {
827 self.inner
828 .ready()
829 .await
830 .map_err(|e| {
831 tonic::Status::unknown(
832 format!("Service was not ready: {}", e.into()),
833 )
834 })?;
835 let codec = tonic_prost::ProstCodec::default();
836 let path = http::uri::PathAndQuery::from_static(
837 "/cortexdb.v1.MemoryService/SearchMemory",
838 );
839 let mut req = request.into_request();
840 req.extensions_mut()
841 .insert(GrpcMethod::new("cortexdb.v1.MemoryService", "SearchMemory"));
842 self.inner.unary(req, path, codec).await
843 }
844 pub async fn delete_memory(
845 &mut self,
846 request: impl tonic::IntoRequest<super::DeleteMemoryRequest>,
847 ) -> std::result::Result<
848 tonic::Response<super::DeleteMemoryResponse>,
849 tonic::Status,
850 > {
851 self.inner
852 .ready()
853 .await
854 .map_err(|e| {
855 tonic::Status::unknown(
856 format!("Service was not ready: {}", e.into()),
857 )
858 })?;
859 let codec = tonic_prost::ProstCodec::default();
860 let path = http::uri::PathAndQuery::from_static(
861 "/cortexdb.v1.MemoryService/DeleteMemory",
862 );
863 let mut req = request.into_request();
864 req.extensions_mut()
865 .insert(GrpcMethod::new("cortexdb.v1.MemoryService", "DeleteMemory"));
866 self.inner.unary(req, path, codec).await
867 }
868 }
869}
870#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
871pub struct RdfTerm {
872 #[prost(string, tag = "1")]
873 pub kind: ::prost::alloc::string::String,
874 #[prost(string, tag = "2")]
875 pub value: ::prost::alloc::string::String,
876 #[prost(string, tag = "3")]
877 pub datatype: ::prost::alloc::string::String,
878 #[prost(string, tag = "4")]
879 pub language: ::prost::alloc::string::String,
880}
881#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
882pub struct RdfTriple {
883 #[prost(string, tag = "1")]
884 pub id: ::prost::alloc::string::String,
885 #[prost(message, optional, tag = "2")]
886 pub subject: ::core::option::Option<RdfTerm>,
887 #[prost(message, optional, tag = "3")]
888 pub predicate: ::core::option::Option<RdfTerm>,
889 #[prost(message, optional, tag = "4")]
890 pub object: ::core::option::Option<RdfTerm>,
891 #[prost(message, optional, tag = "5")]
892 pub graph: ::core::option::Option<RdfTerm>,
893 #[prost(bool, tag = "6")]
894 pub inferred: bool,
895 #[prost(string, tag = "7")]
896 pub rule: ::prost::alloc::string::String,
897 #[prost(string, repeated, tag = "8")]
898 pub support_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
899}
900#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
901pub struct TriplePattern {
902 #[prost(message, optional, tag = "1")]
903 pub subject: ::core::option::Option<RdfTerm>,
904 #[prost(message, optional, tag = "2")]
905 pub predicate: ::core::option::Option<RdfTerm>,
906 #[prost(message, optional, tag = "3")]
907 pub object: ::core::option::Option<RdfTerm>,
908 #[prost(message, optional, tag = "4")]
909 pub graph: ::core::option::Option<RdfTerm>,
910 #[prost(bool, optional, tag = "5")]
911 pub inferred: ::core::option::Option<bool>,
912 #[prost(int32, tag = "6")]
913 pub limit: i32,
914}
915#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
916pub struct GraphNamespace {
917 #[prost(string, tag = "1")]
918 pub prefix: ::prost::alloc::string::String,
919 #[prost(string, tag = "2")]
920 pub uri: ::prost::alloc::string::String,
921}
922#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
923pub struct UpsertNamespaceRequest {
924 #[prost(string, tag = "1")]
925 pub prefix: ::prost::alloc::string::String,
926 #[prost(string, tag = "2")]
927 pub uri: ::prost::alloc::string::String,
928}
929#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
930pub struct UpsertNamespaceResponse {
931 #[prost(message, optional, tag = "1")]
932 pub namespace: ::core::option::Option<GraphNamespace>,
933}
934#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
935pub struct ListNamespacesRequest {}
936#[derive(Clone, PartialEq, ::prost::Message)]
937pub struct ListNamespacesResponse {
938 #[prost(message, repeated, tag = "1")]
939 pub namespaces: ::prost::alloc::vec::Vec<GraphNamespace>,
940}
941#[derive(Clone, PartialEq, ::prost::Message)]
942pub struct UpsertKnowledgeGraphRequest {
943 #[prost(message, repeated, tag = "1")]
944 pub triples: ::prost::alloc::vec::Vec<RdfTriple>,
945}
946#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
947pub struct UpsertKnowledgeGraphResponse {
948 #[prost(string, repeated, tag = "1")]
949 pub triple_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
950 #[prost(int32, tag = "2")]
951 pub count: i32,
952}
953#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
954pub struct FindKnowledgeGraphRequest {
955 #[prost(message, optional, tag = "1")]
956 pub pattern: ::core::option::Option<TriplePattern>,
957}
958#[derive(Clone, PartialEq, ::prost::Message)]
959pub struct FindKnowledgeGraphResponse {
960 #[prost(message, repeated, tag = "1")]
961 pub triples: ::prost::alloc::vec::Vec<RdfTriple>,
962}
963#[derive(Clone, PartialEq, ::prost::Message)]
964pub struct DeleteKnowledgeGraphRequest {
965 #[prost(string, repeated, tag = "1")]
966 pub triple_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
967 #[prost(message, repeated, tag = "2")]
968 pub triples: ::prost::alloc::vec::Vec<RdfTriple>,
969 #[prost(message, optional, tag = "3")]
970 pub pattern: ::core::option::Option<TriplePattern>,
971}
972#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
973pub struct DeleteKnowledgeGraphResponse {
974 #[prost(int32, tag = "1")]
975 pub deleted: i32,
976}
977#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
978pub struct ImportKnowledgeGraphRequest {
979 #[prost(string, tag = "1")]
980 pub format: ::prost::alloc::string::String,
981 #[prost(string, tag = "2")]
982 pub content: ::prost::alloc::string::String,
983}
984#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
985pub struct ImportKnowledgeGraphResponse {
986 #[prost(string, tag = "1")]
987 pub format: ::prost::alloc::string::String,
988 #[prost(int32, tag = "2")]
989 pub count: i32,
990}
991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
992pub struct ExportKnowledgeGraphRequest {
993 #[prost(string, tag = "1")]
994 pub format: ::prost::alloc::string::String,
995}
996#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
997pub struct ExportKnowledgeGraphResponse {
998 #[prost(string, tag = "1")]
999 pub format: ::prost::alloc::string::String,
1000 #[prost(string, tag = "2")]
1001 pub content: ::prost::alloc::string::String,
1002}
1003#[derive(Clone, PartialEq, ::prost::Message)]
1004pub struct SparqlBinding {
1005 #[prost(map = "string, message", tag = "1")]
1006 pub vars: ::std::collections::HashMap<::prost::alloc::string::String, RdfTerm>,
1007}
1008#[derive(Clone, PartialEq, ::prost::Message)]
1009pub struct SparqlResult {
1010 #[prost(string, tag = "1")]
1011 pub query_type: ::prost::alloc::string::String,
1012 #[prost(string, repeated, tag = "2")]
1013 pub vars: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1014 #[prost(message, repeated, tag = "3")]
1015 pub bindings: ::prost::alloc::vec::Vec<SparqlBinding>,
1016 #[prost(message, repeated, tag = "4")]
1017 pub triples: ::prost::alloc::vec::Vec<RdfTriple>,
1018 #[prost(bool, tag = "5")]
1019 pub boolean: bool,
1020 #[prost(int32, tag = "6")]
1021 pub count: i32,
1022}
1023#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1024pub struct QuerySparqlRequest {
1025 #[prost(string, tag = "1")]
1026 pub query: ::prost::alloc::string::String,
1027}
1028#[derive(Clone, PartialEq, ::prost::Message)]
1029pub struct QuerySparqlResponse {
1030 #[prost(message, optional, tag = "1")]
1031 pub result: ::core::option::Option<SparqlResult>,
1032}
1033#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1034pub struct ShaclValidationResult {
1035 #[prost(message, optional, tag = "1")]
1036 pub focus_node: ::core::option::Option<RdfTerm>,
1037 #[prost(message, optional, tag = "2")]
1038 pub path: ::core::option::Option<RdfTerm>,
1039 #[prost(message, optional, tag = "3")]
1040 pub value: ::core::option::Option<RdfTerm>,
1041 #[prost(string, tag = "4")]
1042 pub message: ::prost::alloc::string::String,
1043 #[prost(string, tag = "5")]
1044 pub severity: ::prost::alloc::string::String,
1045 #[prost(message, optional, tag = "6")]
1046 pub source_shape: ::core::option::Option<RdfTerm>,
1047}
1048#[derive(Clone, PartialEq, ::prost::Message)]
1049pub struct ShaclReport {
1050 #[prost(bool, tag = "1")]
1051 pub conforms: bool,
1052 #[prost(message, repeated, tag = "2")]
1053 pub results: ::prost::alloc::vec::Vec<ShaclValidationResult>,
1054}
1055#[derive(Clone, PartialEq, ::prost::Message)]
1056pub struct ValidateShaclRequest {
1057 #[prost(message, repeated, tag = "1")]
1058 pub shapes: ::prost::alloc::vec::Vec<RdfTriple>,
1059}
1060#[derive(Clone, PartialEq, ::prost::Message)]
1061pub struct ValidateShaclResponse {
1062 #[prost(message, optional, tag = "1")]
1063 pub report: ::core::option::Option<ShaclReport>,
1064}
1065#[derive(Clone, PartialEq, ::prost::Message)]
1066pub struct RefreshInferenceRequest {
1067 #[prost(string, tag = "1")]
1068 pub mode: ::prost::alloc::string::String,
1069 #[prost(string, repeated, tag = "2")]
1070 pub triple_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1071 #[prost(message, repeated, tag = "3")]
1072 pub triples: ::prost::alloc::vec::Vec<RdfTriple>,
1073 #[prost(message, optional, tag = "4")]
1074 pub pattern: ::core::option::Option<TriplePattern>,
1075}
1076#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1077pub struct InferenceRefreshResult {
1078 #[prost(int32, tag = "1")]
1079 pub explicit_count: i32,
1080 #[prost(int32, tag = "2")]
1081 pub inferred_count: i32,
1082 #[prost(bool, tag = "3")]
1083 pub incremental: bool,
1084 #[prost(int32, tag = "4")]
1085 pub affected_explicit_count: i32,
1086 #[prost(int32, tag = "5")]
1087 pub removed_inferred_count: i32,
1088}
1089#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1090pub struct RefreshInferenceResponse {
1091 #[prost(message, optional, tag = "1")]
1092 pub result: ::core::option::Option<InferenceRefreshResult>,
1093}
1094#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1095pub struct SummarizeInferenceRequest {}
1096#[derive(Clone, PartialEq, ::prost::Message)]
1097pub struct InferenceSummary {
1098 #[prost(int32, tag = "1")]
1099 pub explicit_count: i32,
1100 #[prost(int32, tag = "2")]
1101 pub inferred_count: i32,
1102 #[prost(map = "string, int32", tag = "3")]
1103 pub rules: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
1104}
1105#[derive(Clone, PartialEq, ::prost::Message)]
1106pub struct SummarizeInferenceResponse {
1107 #[prost(message, optional, tag = "1")]
1108 pub result: ::core::option::Option<InferenceSummary>,
1109}
1110#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1111pub struct InferenceExplanation {
1112 #[prost(message, optional, tag = "1")]
1113 pub triple: ::core::option::Option<RdfTriple>,
1114 #[prost(bool, tag = "2")]
1115 pub explicit: bool,
1116 #[prost(string, tag = "3")]
1117 pub rule: ::prost::alloc::string::String,
1118 #[prost(string, repeated, tag = "4")]
1119 pub support_triple_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1120}
1121#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1122pub struct InferenceTraceEntry {
1123 #[prost(string, tag = "1")]
1124 pub triple_id: ::prost::alloc::string::String,
1125 #[prost(string, tag = "2")]
1126 pub parent_triple_id: ::prost::alloc::string::String,
1127 #[prost(int32, tag = "3")]
1128 pub depth: i32,
1129 #[prost(message, optional, tag = "4")]
1130 pub explanation: ::core::option::Option<InferenceExplanation>,
1131 #[prost(bool, tag = "5")]
1132 pub truncated: bool,
1133}
1134#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1135pub struct ExplainInferenceRequest {
1136 #[prost(string, tag = "1")]
1137 pub triple_id: ::prost::alloc::string::String,
1138 #[prost(int32, tag = "2")]
1139 pub depth: i32,
1140}
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct ExplainInferenceResponse {
1143 #[prost(message, optional, tag = "1")]
1144 pub explanation: ::core::option::Option<InferenceExplanation>,
1145 #[prost(message, repeated, tag = "2")]
1146 pub trace: ::prost::alloc::vec::Vec<InferenceTraceEntry>,
1147}
1148#[derive(Clone, PartialEq, ::prost::Message)]
1149pub struct InferenceMatchExplanation {
1150 #[prost(message, optional, tag = "1")]
1151 pub explanation: ::core::option::Option<InferenceExplanation>,
1152 #[prost(message, repeated, tag = "2")]
1153 pub trace: ::prost::alloc::vec::Vec<InferenceTraceEntry>,
1154}
1155#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1156pub struct ExplainInferenceMatchRequest {
1157 #[prost(message, optional, tag = "1")]
1158 pub pattern: ::core::option::Option<TriplePattern>,
1159 #[prost(int32, tag = "2")]
1160 pub depth: i32,
1161}
1162#[derive(Clone, PartialEq, ::prost::Message)]
1163pub struct ExplainInferenceMatchResponse {
1164 #[prost(message, repeated, tag = "1")]
1165 pub matches: ::prost::alloc::vec::Vec<InferenceMatchExplanation>,
1166}
1167#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1168pub struct OntologyEntityType {
1169 #[prost(string, tag = "1")]
1170 pub name: ::prost::alloc::string::String,
1171 #[prost(string, tag = "2")]
1172 pub description: ::prost::alloc::string::String,
1173 #[prost(string, repeated, tag = "3")]
1174 pub required_properties: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1175}
1176#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1177pub struct OntologyRelationType {
1178 #[prost(string, tag = "1")]
1179 pub name: ::prost::alloc::string::String,
1180 #[prost(string, tag = "2")]
1181 pub description: ::prost::alloc::string::String,
1182 #[prost(string, repeated, tag = "3")]
1183 pub allowed_from_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1184 #[prost(string, repeated, tag = "4")]
1185 pub allowed_to_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1186 #[prost(string, repeated, tag = "5")]
1187 pub required_properties: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1188}
1189#[derive(Clone, PartialEq, ::prost::Message)]
1190pub struct OntologySchema {
1191 #[prost(string, tag = "1")]
1192 pub schema_id: ::prost::alloc::string::String,
1193 #[prost(string, tag = "2")]
1194 pub name: ::prost::alloc::string::String,
1195 #[prost(string, tag = "3")]
1196 pub description: ::prost::alloc::string::String,
1197 #[prost(int32, tag = "4")]
1198 pub version: i32,
1199 #[prost(bool, tag = "5")]
1200 pub active: bool,
1201 #[prost(map = "string, string", tag = "6")]
1202 pub metadata: ::std::collections::HashMap<
1203 ::prost::alloc::string::String,
1204 ::prost::alloc::string::String,
1205 >,
1206 #[prost(message, repeated, tag = "7")]
1207 pub entity_types: ::prost::alloc::vec::Vec<OntologyEntityType>,
1208 #[prost(message, repeated, tag = "8")]
1209 pub relation_types: ::prost::alloc::vec::Vec<OntologyRelationType>,
1210 #[prost(message, optional, tag = "9")]
1211 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1212 #[prost(message, optional, tag = "10")]
1213 pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
1214}
1215#[derive(Clone, PartialEq, ::prost::Message)]
1216pub struct SaveOntologySchemaRequest {
1217 #[prost(string, tag = "1")]
1218 pub schema_id: ::prost::alloc::string::String,
1219 #[prost(string, tag = "2")]
1220 pub name: ::prost::alloc::string::String,
1221 #[prost(string, tag = "3")]
1222 pub description: ::prost::alloc::string::String,
1223 #[prost(int32, tag = "4")]
1224 pub version: i32,
1225 #[prost(bool, tag = "5")]
1226 pub activate: bool,
1227 #[prost(bool, tag = "6")]
1228 pub deactivate: bool,
1229 #[prost(map = "string, string", tag = "7")]
1230 pub metadata: ::std::collections::HashMap<
1231 ::prost::alloc::string::String,
1232 ::prost::alloc::string::String,
1233 >,
1234 #[prost(message, repeated, tag = "8")]
1235 pub entity_types: ::prost::alloc::vec::Vec<OntologyEntityType>,
1236 #[prost(message, repeated, tag = "9")]
1237 pub relation_types: ::prost::alloc::vec::Vec<OntologyRelationType>,
1238}
1239#[derive(Clone, PartialEq, ::prost::Message)]
1240pub struct SaveOntologySchemaResponse {
1241 #[prost(message, optional, tag = "1")]
1242 pub schema: ::core::option::Option<OntologySchema>,
1243}
1244#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1245pub struct GetOntologySchemaRequest {
1246 #[prost(string, tag = "1")]
1247 pub schema_id: ::prost::alloc::string::String,
1248}
1249#[derive(Clone, PartialEq, ::prost::Message)]
1250pub struct GetOntologySchemaResponse {
1251 #[prost(message, optional, tag = "1")]
1252 pub schema: ::core::option::Option<OntologySchema>,
1253}
1254#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1255pub struct ListOntologySchemasRequest {
1256 #[prost(bool, tag = "1")]
1257 pub active_only: bool,
1258}
1259#[derive(Clone, PartialEq, ::prost::Message)]
1260pub struct ListOntologySchemasResponse {
1261 #[prost(message, repeated, tag = "1")]
1262 pub schemas: ::prost::alloc::vec::Vec<OntologySchema>,
1263}
1264#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1265pub struct DeleteOntologySchemaRequest {
1266 #[prost(string, tag = "1")]
1267 pub schema_id: ::prost::alloc::string::String,
1268}
1269#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1270pub struct DeleteOntologySchemaResponse {
1271 #[prost(string, tag = "1")]
1272 pub schema_id: ::prost::alloc::string::String,
1273 #[prost(bool, tag = "2")]
1274 pub deleted: bool,
1275}
1276pub mod knowledge_graph_service_client {
1278 #![allow(
1279 unused_variables,
1280 dead_code,
1281 missing_docs,
1282 clippy::wildcard_imports,
1283 clippy::let_unit_value,
1284 )]
1285 use tonic::codegen::*;
1286 use tonic::codegen::http::Uri;
1287 #[derive(Debug, Clone)]
1288 pub struct KnowledgeGraphServiceClient<T> {
1289 inner: tonic::client::Grpc<T>,
1290 }
1291 impl KnowledgeGraphServiceClient<tonic::transport::Channel> {
1292 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1294 where
1295 D: TryInto<tonic::transport::Endpoint>,
1296 D::Error: Into<StdError>,
1297 {
1298 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1299 Ok(Self::new(conn))
1300 }
1301 }
1302 impl<T> KnowledgeGraphServiceClient<T>
1303 where
1304 T: tonic::client::GrpcService<tonic::body::Body>,
1305 T::Error: Into<StdError>,
1306 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1307 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1308 {
1309 pub fn new(inner: T) -> Self {
1310 let inner = tonic::client::Grpc::new(inner);
1311 Self { inner }
1312 }
1313 pub fn with_origin(inner: T, origin: Uri) -> Self {
1314 let inner = tonic::client::Grpc::with_origin(inner, origin);
1315 Self { inner }
1316 }
1317 pub fn with_interceptor<F>(
1318 inner: T,
1319 interceptor: F,
1320 ) -> KnowledgeGraphServiceClient<InterceptedService<T, F>>
1321 where
1322 F: tonic::service::Interceptor,
1323 T::ResponseBody: Default,
1324 T: tonic::codegen::Service<
1325 http::Request<tonic::body::Body>,
1326 Response = http::Response<
1327 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1328 >,
1329 >,
1330 <T as tonic::codegen::Service<
1331 http::Request<tonic::body::Body>,
1332 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1333 {
1334 KnowledgeGraphServiceClient::new(InterceptedService::new(inner, interceptor))
1335 }
1336 #[must_use]
1341 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1342 self.inner = self.inner.send_compressed(encoding);
1343 self
1344 }
1345 #[must_use]
1347 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1348 self.inner = self.inner.accept_compressed(encoding);
1349 self
1350 }
1351 #[must_use]
1355 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1356 self.inner = self.inner.max_decoding_message_size(limit);
1357 self
1358 }
1359 #[must_use]
1363 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1364 self.inner = self.inner.max_encoding_message_size(limit);
1365 self
1366 }
1367 pub async fn upsert_namespace(
1368 &mut self,
1369 request: impl tonic::IntoRequest<super::UpsertNamespaceRequest>,
1370 ) -> std::result::Result<
1371 tonic::Response<super::UpsertNamespaceResponse>,
1372 tonic::Status,
1373 > {
1374 self.inner
1375 .ready()
1376 .await
1377 .map_err(|e| {
1378 tonic::Status::unknown(
1379 format!("Service was not ready: {}", e.into()),
1380 )
1381 })?;
1382 let codec = tonic_prost::ProstCodec::default();
1383 let path = http::uri::PathAndQuery::from_static(
1384 "/cortexdb.v1.KnowledgeGraphService/UpsertNamespace",
1385 );
1386 let mut req = request.into_request();
1387 req.extensions_mut()
1388 .insert(
1389 GrpcMethod::new(
1390 "cortexdb.v1.KnowledgeGraphService",
1391 "UpsertNamespace",
1392 ),
1393 );
1394 self.inner.unary(req, path, codec).await
1395 }
1396 pub async fn list_namespaces(
1397 &mut self,
1398 request: impl tonic::IntoRequest<super::ListNamespacesRequest>,
1399 ) -> std::result::Result<
1400 tonic::Response<super::ListNamespacesResponse>,
1401 tonic::Status,
1402 > {
1403 self.inner
1404 .ready()
1405 .await
1406 .map_err(|e| {
1407 tonic::Status::unknown(
1408 format!("Service was not ready: {}", e.into()),
1409 )
1410 })?;
1411 let codec = tonic_prost::ProstCodec::default();
1412 let path = http::uri::PathAndQuery::from_static(
1413 "/cortexdb.v1.KnowledgeGraphService/ListNamespaces",
1414 );
1415 let mut req = request.into_request();
1416 req.extensions_mut()
1417 .insert(
1418 GrpcMethod::new(
1419 "cortexdb.v1.KnowledgeGraphService",
1420 "ListNamespaces",
1421 ),
1422 );
1423 self.inner.unary(req, path, codec).await
1424 }
1425 pub async fn upsert_knowledge_graph(
1426 &mut self,
1427 request: impl tonic::IntoRequest<super::UpsertKnowledgeGraphRequest>,
1428 ) -> std::result::Result<
1429 tonic::Response<super::UpsertKnowledgeGraphResponse>,
1430 tonic::Status,
1431 > {
1432 self.inner
1433 .ready()
1434 .await
1435 .map_err(|e| {
1436 tonic::Status::unknown(
1437 format!("Service was not ready: {}", e.into()),
1438 )
1439 })?;
1440 let codec = tonic_prost::ProstCodec::default();
1441 let path = http::uri::PathAndQuery::from_static(
1442 "/cortexdb.v1.KnowledgeGraphService/UpsertKnowledgeGraph",
1443 );
1444 let mut req = request.into_request();
1445 req.extensions_mut()
1446 .insert(
1447 GrpcMethod::new(
1448 "cortexdb.v1.KnowledgeGraphService",
1449 "UpsertKnowledgeGraph",
1450 ),
1451 );
1452 self.inner.unary(req, path, codec).await
1453 }
1454 pub async fn find_knowledge_graph(
1455 &mut self,
1456 request: impl tonic::IntoRequest<super::FindKnowledgeGraphRequest>,
1457 ) -> std::result::Result<
1458 tonic::Response<super::FindKnowledgeGraphResponse>,
1459 tonic::Status,
1460 > {
1461 self.inner
1462 .ready()
1463 .await
1464 .map_err(|e| {
1465 tonic::Status::unknown(
1466 format!("Service was not ready: {}", e.into()),
1467 )
1468 })?;
1469 let codec = tonic_prost::ProstCodec::default();
1470 let path = http::uri::PathAndQuery::from_static(
1471 "/cortexdb.v1.KnowledgeGraphService/FindKnowledgeGraph",
1472 );
1473 let mut req = request.into_request();
1474 req.extensions_mut()
1475 .insert(
1476 GrpcMethod::new(
1477 "cortexdb.v1.KnowledgeGraphService",
1478 "FindKnowledgeGraph",
1479 ),
1480 );
1481 self.inner.unary(req, path, codec).await
1482 }
1483 pub async fn delete_knowledge_graph(
1484 &mut self,
1485 request: impl tonic::IntoRequest<super::DeleteKnowledgeGraphRequest>,
1486 ) -> std::result::Result<
1487 tonic::Response<super::DeleteKnowledgeGraphResponse>,
1488 tonic::Status,
1489 > {
1490 self.inner
1491 .ready()
1492 .await
1493 .map_err(|e| {
1494 tonic::Status::unknown(
1495 format!("Service was not ready: {}", e.into()),
1496 )
1497 })?;
1498 let codec = tonic_prost::ProstCodec::default();
1499 let path = http::uri::PathAndQuery::from_static(
1500 "/cortexdb.v1.KnowledgeGraphService/DeleteKnowledgeGraph",
1501 );
1502 let mut req = request.into_request();
1503 req.extensions_mut()
1504 .insert(
1505 GrpcMethod::new(
1506 "cortexdb.v1.KnowledgeGraphService",
1507 "DeleteKnowledgeGraph",
1508 ),
1509 );
1510 self.inner.unary(req, path, codec).await
1511 }
1512 pub async fn import_knowledge_graph(
1513 &mut self,
1514 request: impl tonic::IntoRequest<super::ImportKnowledgeGraphRequest>,
1515 ) -> std::result::Result<
1516 tonic::Response<super::ImportKnowledgeGraphResponse>,
1517 tonic::Status,
1518 > {
1519 self.inner
1520 .ready()
1521 .await
1522 .map_err(|e| {
1523 tonic::Status::unknown(
1524 format!("Service was not ready: {}", e.into()),
1525 )
1526 })?;
1527 let codec = tonic_prost::ProstCodec::default();
1528 let path = http::uri::PathAndQuery::from_static(
1529 "/cortexdb.v1.KnowledgeGraphService/ImportKnowledgeGraph",
1530 );
1531 let mut req = request.into_request();
1532 req.extensions_mut()
1533 .insert(
1534 GrpcMethod::new(
1535 "cortexdb.v1.KnowledgeGraphService",
1536 "ImportKnowledgeGraph",
1537 ),
1538 );
1539 self.inner.unary(req, path, codec).await
1540 }
1541 pub async fn export_knowledge_graph(
1542 &mut self,
1543 request: impl tonic::IntoRequest<super::ExportKnowledgeGraphRequest>,
1544 ) -> std::result::Result<
1545 tonic::Response<super::ExportKnowledgeGraphResponse>,
1546 tonic::Status,
1547 > {
1548 self.inner
1549 .ready()
1550 .await
1551 .map_err(|e| {
1552 tonic::Status::unknown(
1553 format!("Service was not ready: {}", e.into()),
1554 )
1555 })?;
1556 let codec = tonic_prost::ProstCodec::default();
1557 let path = http::uri::PathAndQuery::from_static(
1558 "/cortexdb.v1.KnowledgeGraphService/ExportKnowledgeGraph",
1559 );
1560 let mut req = request.into_request();
1561 req.extensions_mut()
1562 .insert(
1563 GrpcMethod::new(
1564 "cortexdb.v1.KnowledgeGraphService",
1565 "ExportKnowledgeGraph",
1566 ),
1567 );
1568 self.inner.unary(req, path, codec).await
1569 }
1570 pub async fn query_sparql(
1571 &mut self,
1572 request: impl tonic::IntoRequest<super::QuerySparqlRequest>,
1573 ) -> std::result::Result<
1574 tonic::Response<super::QuerySparqlResponse>,
1575 tonic::Status,
1576 > {
1577 self.inner
1578 .ready()
1579 .await
1580 .map_err(|e| {
1581 tonic::Status::unknown(
1582 format!("Service was not ready: {}", e.into()),
1583 )
1584 })?;
1585 let codec = tonic_prost::ProstCodec::default();
1586 let path = http::uri::PathAndQuery::from_static(
1587 "/cortexdb.v1.KnowledgeGraphService/QuerySparql",
1588 );
1589 let mut req = request.into_request();
1590 req.extensions_mut()
1591 .insert(
1592 GrpcMethod::new("cortexdb.v1.KnowledgeGraphService", "QuerySparql"),
1593 );
1594 self.inner.unary(req, path, codec).await
1595 }
1596 pub async fn validate_shacl(
1597 &mut self,
1598 request: impl tonic::IntoRequest<super::ValidateShaclRequest>,
1599 ) -> std::result::Result<
1600 tonic::Response<super::ValidateShaclResponse>,
1601 tonic::Status,
1602 > {
1603 self.inner
1604 .ready()
1605 .await
1606 .map_err(|e| {
1607 tonic::Status::unknown(
1608 format!("Service was not ready: {}", e.into()),
1609 )
1610 })?;
1611 let codec = tonic_prost::ProstCodec::default();
1612 let path = http::uri::PathAndQuery::from_static(
1613 "/cortexdb.v1.KnowledgeGraphService/ValidateShacl",
1614 );
1615 let mut req = request.into_request();
1616 req.extensions_mut()
1617 .insert(
1618 GrpcMethod::new("cortexdb.v1.KnowledgeGraphService", "ValidateShacl"),
1619 );
1620 self.inner.unary(req, path, codec).await
1621 }
1622 pub async fn refresh_inference(
1623 &mut self,
1624 request: impl tonic::IntoRequest<super::RefreshInferenceRequest>,
1625 ) -> std::result::Result<
1626 tonic::Response<super::RefreshInferenceResponse>,
1627 tonic::Status,
1628 > {
1629 self.inner
1630 .ready()
1631 .await
1632 .map_err(|e| {
1633 tonic::Status::unknown(
1634 format!("Service was not ready: {}", e.into()),
1635 )
1636 })?;
1637 let codec = tonic_prost::ProstCodec::default();
1638 let path = http::uri::PathAndQuery::from_static(
1639 "/cortexdb.v1.KnowledgeGraphService/RefreshInference",
1640 );
1641 let mut req = request.into_request();
1642 req.extensions_mut()
1643 .insert(
1644 GrpcMethod::new(
1645 "cortexdb.v1.KnowledgeGraphService",
1646 "RefreshInference",
1647 ),
1648 );
1649 self.inner.unary(req, path, codec).await
1650 }
1651 pub async fn summarize_inference(
1652 &mut self,
1653 request: impl tonic::IntoRequest<super::SummarizeInferenceRequest>,
1654 ) -> std::result::Result<
1655 tonic::Response<super::SummarizeInferenceResponse>,
1656 tonic::Status,
1657 > {
1658 self.inner
1659 .ready()
1660 .await
1661 .map_err(|e| {
1662 tonic::Status::unknown(
1663 format!("Service was not ready: {}", e.into()),
1664 )
1665 })?;
1666 let codec = tonic_prost::ProstCodec::default();
1667 let path = http::uri::PathAndQuery::from_static(
1668 "/cortexdb.v1.KnowledgeGraphService/SummarizeInference",
1669 );
1670 let mut req = request.into_request();
1671 req.extensions_mut()
1672 .insert(
1673 GrpcMethod::new(
1674 "cortexdb.v1.KnowledgeGraphService",
1675 "SummarizeInference",
1676 ),
1677 );
1678 self.inner.unary(req, path, codec).await
1679 }
1680 pub async fn explain_inference(
1681 &mut self,
1682 request: impl tonic::IntoRequest<super::ExplainInferenceRequest>,
1683 ) -> std::result::Result<
1684 tonic::Response<super::ExplainInferenceResponse>,
1685 tonic::Status,
1686 > {
1687 self.inner
1688 .ready()
1689 .await
1690 .map_err(|e| {
1691 tonic::Status::unknown(
1692 format!("Service was not ready: {}", e.into()),
1693 )
1694 })?;
1695 let codec = tonic_prost::ProstCodec::default();
1696 let path = http::uri::PathAndQuery::from_static(
1697 "/cortexdb.v1.KnowledgeGraphService/ExplainInference",
1698 );
1699 let mut req = request.into_request();
1700 req.extensions_mut()
1701 .insert(
1702 GrpcMethod::new(
1703 "cortexdb.v1.KnowledgeGraphService",
1704 "ExplainInference",
1705 ),
1706 );
1707 self.inner.unary(req, path, codec).await
1708 }
1709 pub async fn explain_inference_match(
1710 &mut self,
1711 request: impl tonic::IntoRequest<super::ExplainInferenceMatchRequest>,
1712 ) -> std::result::Result<
1713 tonic::Response<super::ExplainInferenceMatchResponse>,
1714 tonic::Status,
1715 > {
1716 self.inner
1717 .ready()
1718 .await
1719 .map_err(|e| {
1720 tonic::Status::unknown(
1721 format!("Service was not ready: {}", e.into()),
1722 )
1723 })?;
1724 let codec = tonic_prost::ProstCodec::default();
1725 let path = http::uri::PathAndQuery::from_static(
1726 "/cortexdb.v1.KnowledgeGraphService/ExplainInferenceMatch",
1727 );
1728 let mut req = request.into_request();
1729 req.extensions_mut()
1730 .insert(
1731 GrpcMethod::new(
1732 "cortexdb.v1.KnowledgeGraphService",
1733 "ExplainInferenceMatch",
1734 ),
1735 );
1736 self.inner.unary(req, path, codec).await
1737 }
1738 pub async fn save_ontology_schema(
1739 &mut self,
1740 request: impl tonic::IntoRequest<super::SaveOntologySchemaRequest>,
1741 ) -> std::result::Result<
1742 tonic::Response<super::SaveOntologySchemaResponse>,
1743 tonic::Status,
1744 > {
1745 self.inner
1746 .ready()
1747 .await
1748 .map_err(|e| {
1749 tonic::Status::unknown(
1750 format!("Service was not ready: {}", e.into()),
1751 )
1752 })?;
1753 let codec = tonic_prost::ProstCodec::default();
1754 let path = http::uri::PathAndQuery::from_static(
1755 "/cortexdb.v1.KnowledgeGraphService/SaveOntologySchema",
1756 );
1757 let mut req = request.into_request();
1758 req.extensions_mut()
1759 .insert(
1760 GrpcMethod::new(
1761 "cortexdb.v1.KnowledgeGraphService",
1762 "SaveOntologySchema",
1763 ),
1764 );
1765 self.inner.unary(req, path, codec).await
1766 }
1767 pub async fn get_ontology_schema(
1768 &mut self,
1769 request: impl tonic::IntoRequest<super::GetOntologySchemaRequest>,
1770 ) -> std::result::Result<
1771 tonic::Response<super::GetOntologySchemaResponse>,
1772 tonic::Status,
1773 > {
1774 self.inner
1775 .ready()
1776 .await
1777 .map_err(|e| {
1778 tonic::Status::unknown(
1779 format!("Service was not ready: {}", e.into()),
1780 )
1781 })?;
1782 let codec = tonic_prost::ProstCodec::default();
1783 let path = http::uri::PathAndQuery::from_static(
1784 "/cortexdb.v1.KnowledgeGraphService/GetOntologySchema",
1785 );
1786 let mut req = request.into_request();
1787 req.extensions_mut()
1788 .insert(
1789 GrpcMethod::new(
1790 "cortexdb.v1.KnowledgeGraphService",
1791 "GetOntologySchema",
1792 ),
1793 );
1794 self.inner.unary(req, path, codec).await
1795 }
1796 pub async fn list_ontology_schemas(
1797 &mut self,
1798 request: impl tonic::IntoRequest<super::ListOntologySchemasRequest>,
1799 ) -> std::result::Result<
1800 tonic::Response<super::ListOntologySchemasResponse>,
1801 tonic::Status,
1802 > {
1803 self.inner
1804 .ready()
1805 .await
1806 .map_err(|e| {
1807 tonic::Status::unknown(
1808 format!("Service was not ready: {}", e.into()),
1809 )
1810 })?;
1811 let codec = tonic_prost::ProstCodec::default();
1812 let path = http::uri::PathAndQuery::from_static(
1813 "/cortexdb.v1.KnowledgeGraphService/ListOntologySchemas",
1814 );
1815 let mut req = request.into_request();
1816 req.extensions_mut()
1817 .insert(
1818 GrpcMethod::new(
1819 "cortexdb.v1.KnowledgeGraphService",
1820 "ListOntologySchemas",
1821 ),
1822 );
1823 self.inner.unary(req, path, codec).await
1824 }
1825 pub async fn delete_ontology_schema(
1826 &mut self,
1827 request: impl tonic::IntoRequest<super::DeleteOntologySchemaRequest>,
1828 ) -> std::result::Result<
1829 tonic::Response<super::DeleteOntologySchemaResponse>,
1830 tonic::Status,
1831 > {
1832 self.inner
1833 .ready()
1834 .await
1835 .map_err(|e| {
1836 tonic::Status::unknown(
1837 format!("Service was not ready: {}", e.into()),
1838 )
1839 })?;
1840 let codec = tonic_prost::ProstCodec::default();
1841 let path = http::uri::PathAndQuery::from_static(
1842 "/cortexdb.v1.KnowledgeGraphService/DeleteOntologySchema",
1843 );
1844 let mut req = request.into_request();
1845 req.extensions_mut()
1846 .insert(
1847 GrpcMethod::new(
1848 "cortexdb.v1.KnowledgeGraphService",
1849 "DeleteOntologySchema",
1850 ),
1851 );
1852 self.inner.unary(req, path, codec).await
1853 }
1854 }
1855}
1856#[derive(Clone, PartialEq, ::prost::Message)]
1857pub struct InsertGraphDocumentRequest {
1858 #[prost(string, tag = "1")]
1859 pub id: ::prost::alloc::string::String,
1860 #[prost(string, tag = "2")]
1861 pub title: ::prost::alloc::string::String,
1862 #[prost(string, tag = "3")]
1863 pub content: ::prost::alloc::string::String,
1864 #[prost(map = "string, string", tag = "4")]
1865 pub metadata: ::std::collections::HashMap<
1866 ::prost::alloc::string::String,
1867 ::prost::alloc::string::String,
1868 >,
1869 #[prost(string, tag = "5")]
1871 pub collection: ::prost::alloc::string::String,
1872 #[prost(int32, tag = "6")]
1873 pub chunk_size: i32,
1874 #[prost(int32, tag = "7")]
1875 pub chunk_overlap: i32,
1876}
1877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1878pub struct InsertGraphDocumentResponse {
1879 #[prost(string, tag = "1")]
1880 pub document_node_id: ::prost::alloc::string::String,
1881 #[prost(string, repeated, tag = "2")]
1882 pub chunk_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1883 #[prost(string, repeated, tag = "3")]
1884 pub entity_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1885}
1886#[derive(Clone, PartialEq, ::prost::Message)]
1887pub struct SearchGraphRagRequest {
1888 #[prost(string, tag = "1")]
1889 pub query: ::prost::alloc::string::String,
1890 #[prost(string, tag = "2")]
1891 pub collection: ::prost::alloc::string::String,
1892 #[prost(int32, tag = "3")]
1893 pub top_k: i32,
1894 #[prost(int32, tag = "4")]
1895 pub max_hops: i32,
1896 #[prost(int32, tag = "5")]
1897 pub max_related_chunks: i32,
1898 #[prost(int32, tag = "6")]
1899 pub max_context_chunks: i32,
1900 #[prost(int32, tag = "7")]
1901 pub max_context_chars: i32,
1902 #[prost(int32, tag = "8")]
1903 pub per_document_limit: i32,
1904 #[prost(bool, tag = "9")]
1905 pub rerank: bool,
1906 #[prost(bool, tag = "10")]
1907 pub disable_rerank: bool,
1908 #[prost(double, tag = "11")]
1909 pub diversity_lambda: f64,
1910 #[prost(bool, tag = "12")]
1911 pub disable_graph: bool,
1912 #[prost(string, tag = "13")]
1913 pub retrieval_mode: ::prost::alloc::string::String,
1914 #[prost(bool, tag = "14")]
1915 pub graph_light: bool,
1916 #[prost(int32, tag = "15")]
1917 pub max_expansion_seeds: i32,
1918 #[prost(int32, tag = "16")]
1919 pub max_traversal_nodes: i32,
1920 #[prost(int32, tag = "17")]
1921 pub max_entities_per_chunk: i32,
1922 #[prost(message, optional, tag = "18")]
1923 pub plan: ::core::option::Option<RetrievalPlan>,
1924}
1925#[derive(Clone, PartialEq, ::prost::Message)]
1926pub struct SearchGraphRagResponse {
1927 #[prost(string, tag = "1")]
1928 pub query: ::prost::alloc::string::String,
1929 #[prost(message, optional, tag = "2")]
1930 pub plan: ::core::option::Option<RetrievalPlan>,
1931 #[prost(message, optional, tag = "3")]
1932 pub decision: ::core::option::Option<RetrievalDecision>,
1933 #[prost(message, repeated, tag = "4")]
1934 pub chunks: ::prost::alloc::vec::Vec<GraphRagChunkResult>,
1935 #[prost(string, repeated, tag = "5")]
1936 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1937 #[prost(string, tag = "6")]
1938 pub context: ::prost::alloc::string::String,
1939}
1940#[derive(Clone, PartialEq, ::prost::Message)]
1941pub struct InsertTextRequest {
1942 #[prost(string, tag = "1")]
1943 pub id: ::prost::alloc::string::String,
1944 #[prost(string, tag = "2")]
1945 pub text: ::prost::alloc::string::String,
1946 #[prost(map = "string, string", tag = "3")]
1947 pub metadata: ::std::collections::HashMap<
1948 ::prost::alloc::string::String,
1949 ::prost::alloc::string::String,
1950 >,
1951}
1952#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1953pub struct InsertTextResponse {}
1954#[derive(Clone, PartialEq, ::prost::Message)]
1955pub struct InsertTextBatchRequest {
1956 #[prost(map = "string, string", tag = "1")]
1957 pub texts: ::std::collections::HashMap<
1958 ::prost::alloc::string::String,
1959 ::prost::alloc::string::String,
1960 >,
1961 #[prost(map = "string, string", tag = "2")]
1962 pub metadata: ::std::collections::HashMap<
1963 ::prost::alloc::string::String,
1964 ::prost::alloc::string::String,
1965 >,
1966}
1967#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1968pub struct InsertTextBatchResponse {}
1969#[derive(Clone, PartialEq, ::prost::Message)]
1970pub struct ScoredText {
1971 #[prost(string, tag = "1")]
1972 pub id: ::prost::alloc::string::String,
1973 #[prost(string, tag = "2")]
1974 pub content: ::prost::alloc::string::String,
1975 #[prost(string, tag = "3")]
1976 pub doc_id: ::prost::alloc::string::String,
1977 #[prost(string, tag = "4")]
1978 pub collection: ::prost::alloc::string::String,
1979 #[prost(map = "string, string", tag = "5")]
1980 pub metadata: ::std::collections::HashMap<
1981 ::prost::alloc::string::String,
1982 ::prost::alloc::string::String,
1983 >,
1984 #[prost(double, tag = "6")]
1985 pub score: f64,
1986}
1987#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1988pub struct SearchTextRequest {
1989 #[prost(string, tag = "1")]
1990 pub query: ::prost::alloc::string::String,
1991 #[prost(string, tag = "2")]
1992 pub collection: ::prost::alloc::string::String,
1993 #[prost(int32, tag = "3")]
1994 pub top_k: i32,
1995}
1996#[derive(Clone, PartialEq, ::prost::Message)]
1997pub struct SearchTextResponse {
1998 #[prost(message, repeated, tag = "1")]
1999 pub results: ::prost::alloc::vec::Vec<ScoredText>,
2000}
2001#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2002pub struct HybridSearchTextRequest {
2003 #[prost(string, tag = "1")]
2004 pub query: ::prost::alloc::string::String,
2005 #[prost(int32, tag = "2")]
2006 pub top_k: i32,
2007}
2008#[derive(Clone, PartialEq, ::prost::Message)]
2009pub struct HybridSearchTextResponse {
2010 #[prost(message, repeated, tag = "1")]
2011 pub results: ::prost::alloc::vec::Vec<ScoredText>,
2012}
2013pub mod graph_rag_service_client {
2015 #![allow(
2016 unused_variables,
2017 dead_code,
2018 missing_docs,
2019 clippy::wildcard_imports,
2020 clippy::let_unit_value,
2021 )]
2022 use tonic::codegen::*;
2023 use tonic::codegen::http::Uri;
2024 #[derive(Debug, Clone)]
2025 pub struct GraphRagServiceClient<T> {
2026 inner: tonic::client::Grpc<T>,
2027 }
2028 impl GraphRagServiceClient<tonic::transport::Channel> {
2029 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2031 where
2032 D: TryInto<tonic::transport::Endpoint>,
2033 D::Error: Into<StdError>,
2034 {
2035 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2036 Ok(Self::new(conn))
2037 }
2038 }
2039 impl<T> GraphRagServiceClient<T>
2040 where
2041 T: tonic::client::GrpcService<tonic::body::Body>,
2042 T::Error: Into<StdError>,
2043 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2044 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2045 {
2046 pub fn new(inner: T) -> Self {
2047 let inner = tonic::client::Grpc::new(inner);
2048 Self { inner }
2049 }
2050 pub fn with_origin(inner: T, origin: Uri) -> Self {
2051 let inner = tonic::client::Grpc::with_origin(inner, origin);
2052 Self { inner }
2053 }
2054 pub fn with_interceptor<F>(
2055 inner: T,
2056 interceptor: F,
2057 ) -> GraphRagServiceClient<InterceptedService<T, F>>
2058 where
2059 F: tonic::service::Interceptor,
2060 T::ResponseBody: Default,
2061 T: tonic::codegen::Service<
2062 http::Request<tonic::body::Body>,
2063 Response = http::Response<
2064 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2065 >,
2066 >,
2067 <T as tonic::codegen::Service<
2068 http::Request<tonic::body::Body>,
2069 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2070 {
2071 GraphRagServiceClient::new(InterceptedService::new(inner, interceptor))
2072 }
2073 #[must_use]
2078 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2079 self.inner = self.inner.send_compressed(encoding);
2080 self
2081 }
2082 #[must_use]
2084 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2085 self.inner = self.inner.accept_compressed(encoding);
2086 self
2087 }
2088 #[must_use]
2092 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2093 self.inner = self.inner.max_decoding_message_size(limit);
2094 self
2095 }
2096 #[must_use]
2100 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2101 self.inner = self.inner.max_encoding_message_size(limit);
2102 self
2103 }
2104 pub async fn insert_graph_document(
2105 &mut self,
2106 request: impl tonic::IntoRequest<super::InsertGraphDocumentRequest>,
2107 ) -> std::result::Result<
2108 tonic::Response<super::InsertGraphDocumentResponse>,
2109 tonic::Status,
2110 > {
2111 self.inner
2112 .ready()
2113 .await
2114 .map_err(|e| {
2115 tonic::Status::unknown(
2116 format!("Service was not ready: {}", e.into()),
2117 )
2118 })?;
2119 let codec = tonic_prost::ProstCodec::default();
2120 let path = http::uri::PathAndQuery::from_static(
2121 "/cortexdb.v1.GraphRagService/InsertGraphDocument",
2122 );
2123 let mut req = request.into_request();
2124 req.extensions_mut()
2125 .insert(
2126 GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertGraphDocument"),
2127 );
2128 self.inner.unary(req, path, codec).await
2129 }
2130 pub async fn search_graph_rag(
2131 &mut self,
2132 request: impl tonic::IntoRequest<super::SearchGraphRagRequest>,
2133 ) -> std::result::Result<
2134 tonic::Response<super::SearchGraphRagResponse>,
2135 tonic::Status,
2136 > {
2137 self.inner
2138 .ready()
2139 .await
2140 .map_err(|e| {
2141 tonic::Status::unknown(
2142 format!("Service was not ready: {}", e.into()),
2143 )
2144 })?;
2145 let codec = tonic_prost::ProstCodec::default();
2146 let path = http::uri::PathAndQuery::from_static(
2147 "/cortexdb.v1.GraphRagService/SearchGraphRag",
2148 );
2149 let mut req = request.into_request();
2150 req.extensions_mut()
2151 .insert(
2152 GrpcMethod::new("cortexdb.v1.GraphRagService", "SearchGraphRag"),
2153 );
2154 self.inner.unary(req, path, codec).await
2155 }
2156 pub async fn insert_text(
2157 &mut self,
2158 request: impl tonic::IntoRequest<super::InsertTextRequest>,
2159 ) -> std::result::Result<
2160 tonic::Response<super::InsertTextResponse>,
2161 tonic::Status,
2162 > {
2163 self.inner
2164 .ready()
2165 .await
2166 .map_err(|e| {
2167 tonic::Status::unknown(
2168 format!("Service was not ready: {}", e.into()),
2169 )
2170 })?;
2171 let codec = tonic_prost::ProstCodec::default();
2172 let path = http::uri::PathAndQuery::from_static(
2173 "/cortexdb.v1.GraphRagService/InsertText",
2174 );
2175 let mut req = request.into_request();
2176 req.extensions_mut()
2177 .insert(GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertText"));
2178 self.inner.unary(req, path, codec).await
2179 }
2180 pub async fn insert_text_batch(
2181 &mut self,
2182 request: impl tonic::IntoRequest<super::InsertTextBatchRequest>,
2183 ) -> std::result::Result<
2184 tonic::Response<super::InsertTextBatchResponse>,
2185 tonic::Status,
2186 > {
2187 self.inner
2188 .ready()
2189 .await
2190 .map_err(|e| {
2191 tonic::Status::unknown(
2192 format!("Service was not ready: {}", e.into()),
2193 )
2194 })?;
2195 let codec = tonic_prost::ProstCodec::default();
2196 let path = http::uri::PathAndQuery::from_static(
2197 "/cortexdb.v1.GraphRagService/InsertTextBatch",
2198 );
2199 let mut req = request.into_request();
2200 req.extensions_mut()
2201 .insert(
2202 GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertTextBatch"),
2203 );
2204 self.inner.unary(req, path, codec).await
2205 }
2206 pub async fn search_text(
2207 &mut self,
2208 request: impl tonic::IntoRequest<super::SearchTextRequest>,
2209 ) -> std::result::Result<
2210 tonic::Response<super::SearchTextResponse>,
2211 tonic::Status,
2212 > {
2213 self.inner
2214 .ready()
2215 .await
2216 .map_err(|e| {
2217 tonic::Status::unknown(
2218 format!("Service was not ready: {}", e.into()),
2219 )
2220 })?;
2221 let codec = tonic_prost::ProstCodec::default();
2222 let path = http::uri::PathAndQuery::from_static(
2223 "/cortexdb.v1.GraphRagService/SearchText",
2224 );
2225 let mut req = request.into_request();
2226 req.extensions_mut()
2227 .insert(GrpcMethod::new("cortexdb.v1.GraphRagService", "SearchText"));
2228 self.inner.unary(req, path, codec).await
2229 }
2230 pub async fn hybrid_search_text(
2231 &mut self,
2232 request: impl tonic::IntoRequest<super::HybridSearchTextRequest>,
2233 ) -> std::result::Result<
2234 tonic::Response<super::HybridSearchTextResponse>,
2235 tonic::Status,
2236 > {
2237 self.inner
2238 .ready()
2239 .await
2240 .map_err(|e| {
2241 tonic::Status::unknown(
2242 format!("Service was not ready: {}", e.into()),
2243 )
2244 })?;
2245 let codec = tonic_prost::ProstCodec::default();
2246 let path = http::uri::PathAndQuery::from_static(
2247 "/cortexdb.v1.GraphRagService/HybridSearchText",
2248 );
2249 let mut req = request.into_request();
2250 req.extensions_mut()
2251 .insert(
2252 GrpcMethod::new("cortexdb.v1.GraphRagService", "HybridSearchText"),
2253 );
2254 self.inner.unary(req, path, codec).await
2255 }
2256 }
2257}
2258#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2259pub struct ToolDefinition {
2260 #[prost(string, tag = "1")]
2261 pub name: ::prost::alloc::string::String,
2262 #[prost(string, tag = "2")]
2263 pub description: ::prost::alloc::string::String,
2264 #[prost(string, tag = "3")]
2266 pub input_schema_json: ::prost::alloc::string::String,
2267}
2268#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2269pub struct ListToolsRequest {}
2270#[derive(Clone, PartialEq, ::prost::Message)]
2271pub struct ListToolsResponse {
2272 #[prost(message, repeated, tag = "1")]
2273 pub tools: ::prost::alloc::vec::Vec<ToolDefinition>,
2274}
2275#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2276pub struct CallToolRequest {
2277 #[prost(string, tag = "1")]
2278 pub name: ::prost::alloc::string::String,
2279 #[prost(string, tag = "2")]
2281 pub args_json: ::prost::alloc::string::String,
2282}
2283#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2284pub struct CallToolResponse {
2285 #[prost(string, tag = "1")]
2287 pub result_json: ::prost::alloc::string::String,
2288}
2289pub mod tools_service_client {
2291 #![allow(
2292 unused_variables,
2293 dead_code,
2294 missing_docs,
2295 clippy::wildcard_imports,
2296 clippy::let_unit_value,
2297 )]
2298 use tonic::codegen::*;
2299 use tonic::codegen::http::Uri;
2300 #[derive(Debug, Clone)]
2301 pub struct ToolsServiceClient<T> {
2302 inner: tonic::client::Grpc<T>,
2303 }
2304 impl ToolsServiceClient<tonic::transport::Channel> {
2305 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2307 where
2308 D: TryInto<tonic::transport::Endpoint>,
2309 D::Error: Into<StdError>,
2310 {
2311 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2312 Ok(Self::new(conn))
2313 }
2314 }
2315 impl<T> ToolsServiceClient<T>
2316 where
2317 T: tonic::client::GrpcService<tonic::body::Body>,
2318 T::Error: Into<StdError>,
2319 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2320 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2321 {
2322 pub fn new(inner: T) -> Self {
2323 let inner = tonic::client::Grpc::new(inner);
2324 Self { inner }
2325 }
2326 pub fn with_origin(inner: T, origin: Uri) -> Self {
2327 let inner = tonic::client::Grpc::with_origin(inner, origin);
2328 Self { inner }
2329 }
2330 pub fn with_interceptor<F>(
2331 inner: T,
2332 interceptor: F,
2333 ) -> ToolsServiceClient<InterceptedService<T, F>>
2334 where
2335 F: tonic::service::Interceptor,
2336 T::ResponseBody: Default,
2337 T: tonic::codegen::Service<
2338 http::Request<tonic::body::Body>,
2339 Response = http::Response<
2340 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2341 >,
2342 >,
2343 <T as tonic::codegen::Service<
2344 http::Request<tonic::body::Body>,
2345 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2346 {
2347 ToolsServiceClient::new(InterceptedService::new(inner, interceptor))
2348 }
2349 #[must_use]
2354 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2355 self.inner = self.inner.send_compressed(encoding);
2356 self
2357 }
2358 #[must_use]
2360 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2361 self.inner = self.inner.accept_compressed(encoding);
2362 self
2363 }
2364 #[must_use]
2368 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2369 self.inner = self.inner.max_decoding_message_size(limit);
2370 self
2371 }
2372 #[must_use]
2376 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2377 self.inner = self.inner.max_encoding_message_size(limit);
2378 self
2379 }
2380 pub async fn list_tools(
2381 &mut self,
2382 request: impl tonic::IntoRequest<super::ListToolsRequest>,
2383 ) -> std::result::Result<
2384 tonic::Response<super::ListToolsResponse>,
2385 tonic::Status,
2386 > {
2387 self.inner
2388 .ready()
2389 .await
2390 .map_err(|e| {
2391 tonic::Status::unknown(
2392 format!("Service was not ready: {}", e.into()),
2393 )
2394 })?;
2395 let codec = tonic_prost::ProstCodec::default();
2396 let path = http::uri::PathAndQuery::from_static(
2397 "/cortexdb.v1.ToolsService/ListTools",
2398 );
2399 let mut req = request.into_request();
2400 req.extensions_mut()
2401 .insert(GrpcMethod::new("cortexdb.v1.ToolsService", "ListTools"));
2402 self.inner.unary(req, path, codec).await
2403 }
2404 pub async fn call_tool(
2405 &mut self,
2406 request: impl tonic::IntoRequest<super::CallToolRequest>,
2407 ) -> std::result::Result<
2408 tonic::Response<super::CallToolResponse>,
2409 tonic::Status,
2410 > {
2411 self.inner
2412 .ready()
2413 .await
2414 .map_err(|e| {
2415 tonic::Status::unknown(
2416 format!("Service was not ready: {}", e.into()),
2417 )
2418 })?;
2419 let codec = tonic_prost::ProstCodec::default();
2420 let path = http::uri::PathAndQuery::from_static(
2421 "/cortexdb.v1.ToolsService/CallTool",
2422 );
2423 let mut req = request.into_request();
2424 req.extensions_mut()
2425 .insert(GrpcMethod::new("cortexdb.v1.ToolsService", "CallTool"));
2426 self.inner.unary(req, path, codec).await
2427 }
2428 }
2429}
2430#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2431pub struct HealthRequest {}
2432#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2433pub struct HealthResponse {
2434 #[prost(bool, tag = "1")]
2435 pub ok: bool,
2436}
2437#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2438pub struct InfoRequest {}
2439#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2440pub struct InfoResponse {
2441 #[prost(string, tag = "1")]
2442 pub version: ::prost::alloc::string::String,
2443 #[prost(string, tag = "2")]
2444 pub db_path: ::prost::alloc::string::String,
2445 #[prost(bool, tag = "3")]
2446 pub has_embedder: bool,
2447}
2448pub mod admin_service_client {
2450 #![allow(
2451 unused_variables,
2452 dead_code,
2453 missing_docs,
2454 clippy::wildcard_imports,
2455 clippy::let_unit_value,
2456 )]
2457 use tonic::codegen::*;
2458 use tonic::codegen::http::Uri;
2459 #[derive(Debug, Clone)]
2460 pub struct AdminServiceClient<T> {
2461 inner: tonic::client::Grpc<T>,
2462 }
2463 impl AdminServiceClient<tonic::transport::Channel> {
2464 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2466 where
2467 D: TryInto<tonic::transport::Endpoint>,
2468 D::Error: Into<StdError>,
2469 {
2470 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2471 Ok(Self::new(conn))
2472 }
2473 }
2474 impl<T> AdminServiceClient<T>
2475 where
2476 T: tonic::client::GrpcService<tonic::body::Body>,
2477 T::Error: Into<StdError>,
2478 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2479 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2480 {
2481 pub fn new(inner: T) -> Self {
2482 let inner = tonic::client::Grpc::new(inner);
2483 Self { inner }
2484 }
2485 pub fn with_origin(inner: T, origin: Uri) -> Self {
2486 let inner = tonic::client::Grpc::with_origin(inner, origin);
2487 Self { inner }
2488 }
2489 pub fn with_interceptor<F>(
2490 inner: T,
2491 interceptor: F,
2492 ) -> AdminServiceClient<InterceptedService<T, F>>
2493 where
2494 F: tonic::service::Interceptor,
2495 T::ResponseBody: Default,
2496 T: tonic::codegen::Service<
2497 http::Request<tonic::body::Body>,
2498 Response = http::Response<
2499 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2500 >,
2501 >,
2502 <T as tonic::codegen::Service<
2503 http::Request<tonic::body::Body>,
2504 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2505 {
2506 AdminServiceClient::new(InterceptedService::new(inner, interceptor))
2507 }
2508 #[must_use]
2513 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2514 self.inner = self.inner.send_compressed(encoding);
2515 self
2516 }
2517 #[must_use]
2519 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2520 self.inner = self.inner.accept_compressed(encoding);
2521 self
2522 }
2523 #[must_use]
2527 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2528 self.inner = self.inner.max_decoding_message_size(limit);
2529 self
2530 }
2531 #[must_use]
2535 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2536 self.inner = self.inner.max_encoding_message_size(limit);
2537 self
2538 }
2539 pub async fn health(
2540 &mut self,
2541 request: impl tonic::IntoRequest<super::HealthRequest>,
2542 ) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
2543 self.inner
2544 .ready()
2545 .await
2546 .map_err(|e| {
2547 tonic::Status::unknown(
2548 format!("Service was not ready: {}", e.into()),
2549 )
2550 })?;
2551 let codec = tonic_prost::ProstCodec::default();
2552 let path = http::uri::PathAndQuery::from_static(
2553 "/cortexdb.v1.AdminService/Health",
2554 );
2555 let mut req = request.into_request();
2556 req.extensions_mut()
2557 .insert(GrpcMethod::new("cortexdb.v1.AdminService", "Health"));
2558 self.inner.unary(req, path, codec).await
2559 }
2560 pub async fn info(
2561 &mut self,
2562 request: impl tonic::IntoRequest<super::InfoRequest>,
2563 ) -> std::result::Result<tonic::Response<super::InfoResponse>, tonic::Status> {
2564 self.inner
2565 .ready()
2566 .await
2567 .map_err(|e| {
2568 tonic::Status::unknown(
2569 format!("Service was not ready: {}", e.into()),
2570 )
2571 })?;
2572 let codec = tonic_prost::ProstCodec::default();
2573 let path = http::uri::PathAndQuery::from_static(
2574 "/cortexdb.v1.AdminService/Info",
2575 );
2576 let mut req = request.into_request();
2577 req.extensions_mut()
2578 .insert(GrpcMethod::new("cortexdb.v1.AdminService", "Info"));
2579 self.inner.unary(req, path, codec).await
2580 }
2581 }
2582}