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)]
1171pub struct OntologyEntityType {
1172 #[prost(string, tag = "1")]
1173 pub name: ::prost::alloc::string::String,
1174 #[prost(string, tag = "2")]
1175 pub description: ::prost::alloc::string::String,
1176 #[prost(string, repeated, tag = "3")]
1177 pub required_properties: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1178}
1179#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1181pub struct OntologyRelationType {
1182 #[prost(string, tag = "1")]
1183 pub name: ::prost::alloc::string::String,
1184 #[prost(string, tag = "2")]
1185 pub description: ::prost::alloc::string::String,
1186 #[prost(string, repeated, tag = "3")]
1187 pub allowed_from_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1188 #[prost(string, repeated, tag = "4")]
1189 pub allowed_to_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1190 #[prost(string, repeated, tag = "5")]
1191 pub required_properties: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1192}
1193#[derive(Clone, PartialEq, ::prost::Message)]
1194pub struct OntologySchema {
1195 #[prost(string, tag = "1")]
1196 pub schema_id: ::prost::alloc::string::String,
1197 #[prost(string, tag = "2")]
1198 pub name: ::prost::alloc::string::String,
1199 #[prost(string, tag = "3")]
1200 pub description: ::prost::alloc::string::String,
1201 #[prost(int32, tag = "4")]
1202 pub version: i32,
1203 #[prost(bool, tag = "5")]
1204 pub active: bool,
1205 #[prost(map = "string, string", tag = "6")]
1206 pub metadata: ::std::collections::HashMap<
1207 ::prost::alloc::string::String,
1208 ::prost::alloc::string::String,
1209 >,
1210 #[deprecated]
1211 #[prost(message, repeated, tag = "7")]
1212 pub entity_types: ::prost::alloc::vec::Vec<OntologyEntityType>,
1213 #[deprecated]
1214 #[prost(message, repeated, tag = "8")]
1215 pub relation_types: ::prost::alloc::vec::Vec<OntologyRelationType>,
1216 #[prost(message, optional, tag = "9")]
1217 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
1218 #[prost(message, optional, tag = "10")]
1219 pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
1220 #[prost(string, tag = "11")]
1223 pub schema_json: ::prost::alloc::string::String,
1224}
1225#[derive(Clone, PartialEq, ::prost::Message)]
1226pub struct SaveOntologySchemaRequest {
1227 #[prost(string, tag = "1")]
1228 pub schema_id: ::prost::alloc::string::String,
1229 #[prost(string, tag = "2")]
1230 pub name: ::prost::alloc::string::String,
1231 #[prost(string, tag = "3")]
1232 pub description: ::prost::alloc::string::String,
1233 #[prost(int32, tag = "4")]
1234 pub version: i32,
1235 #[prost(bool, tag = "5")]
1236 pub activate: bool,
1237 #[prost(bool, tag = "6")]
1238 pub deactivate: bool,
1239 #[prost(map = "string, string", tag = "7")]
1240 pub metadata: ::std::collections::HashMap<
1241 ::prost::alloc::string::String,
1242 ::prost::alloc::string::String,
1243 >,
1244 #[deprecated]
1245 #[prost(message, repeated, tag = "8")]
1246 pub entity_types: ::prost::alloc::vec::Vec<OntologyEntityType>,
1247 #[deprecated]
1248 #[prost(message, repeated, tag = "9")]
1249 pub relation_types: ::prost::alloc::vec::Vec<OntologyRelationType>,
1250 #[prost(string, tag = "10")]
1252 pub schema_json: ::prost::alloc::string::String,
1253}
1254#[derive(Clone, PartialEq, ::prost::Message)]
1255pub struct SaveOntologySchemaResponse {
1256 #[prost(message, optional, tag = "1")]
1257 pub schema: ::core::option::Option<OntologySchema>,
1258}
1259#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1260pub struct GetOntologySchemaRequest {
1261 #[prost(string, tag = "1")]
1262 pub schema_id: ::prost::alloc::string::String,
1263}
1264#[derive(Clone, PartialEq, ::prost::Message)]
1265pub struct GetOntologySchemaResponse {
1266 #[prost(message, optional, tag = "1")]
1267 pub schema: ::core::option::Option<OntologySchema>,
1268}
1269#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1270pub struct ListOntologySchemasRequest {
1271 #[prost(bool, tag = "1")]
1272 pub active_only: bool,
1273}
1274#[derive(Clone, PartialEq, ::prost::Message)]
1275pub struct ListOntologySchemasResponse {
1276 #[prost(message, repeated, tag = "1")]
1277 pub schemas: ::prost::alloc::vec::Vec<OntologySchema>,
1278}
1279#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1280pub struct DeleteOntologySchemaRequest {
1281 #[prost(string, tag = "1")]
1282 pub schema_id: ::prost::alloc::string::String,
1283}
1284#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct DeleteOntologySchemaResponse {
1286 #[prost(string, tag = "1")]
1287 pub schema_id: ::prost::alloc::string::String,
1288 #[prost(bool, tag = "2")]
1289 pub deleted: bool,
1290}
1291pub mod knowledge_graph_service_client {
1293 #![allow(
1294 unused_variables,
1295 dead_code,
1296 missing_docs,
1297 clippy::wildcard_imports,
1298 clippy::let_unit_value,
1299 )]
1300 use tonic::codegen::*;
1301 use tonic::codegen::http::Uri;
1302 #[derive(Debug, Clone)]
1303 pub struct KnowledgeGraphServiceClient<T> {
1304 inner: tonic::client::Grpc<T>,
1305 }
1306 impl KnowledgeGraphServiceClient<tonic::transport::Channel> {
1307 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1309 where
1310 D: TryInto<tonic::transport::Endpoint>,
1311 D::Error: Into<StdError>,
1312 {
1313 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1314 Ok(Self::new(conn))
1315 }
1316 }
1317 impl<T> KnowledgeGraphServiceClient<T>
1318 where
1319 T: tonic::client::GrpcService<tonic::body::Body>,
1320 T::Error: Into<StdError>,
1321 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1322 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1323 {
1324 pub fn new(inner: T) -> Self {
1325 let inner = tonic::client::Grpc::new(inner);
1326 Self { inner }
1327 }
1328 pub fn with_origin(inner: T, origin: Uri) -> Self {
1329 let inner = tonic::client::Grpc::with_origin(inner, origin);
1330 Self { inner }
1331 }
1332 pub fn with_interceptor<F>(
1333 inner: T,
1334 interceptor: F,
1335 ) -> KnowledgeGraphServiceClient<InterceptedService<T, F>>
1336 where
1337 F: tonic::service::Interceptor,
1338 T::ResponseBody: Default,
1339 T: tonic::codegen::Service<
1340 http::Request<tonic::body::Body>,
1341 Response = http::Response<
1342 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1343 >,
1344 >,
1345 <T as tonic::codegen::Service<
1346 http::Request<tonic::body::Body>,
1347 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1348 {
1349 KnowledgeGraphServiceClient::new(InterceptedService::new(inner, interceptor))
1350 }
1351 #[must_use]
1356 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1357 self.inner = self.inner.send_compressed(encoding);
1358 self
1359 }
1360 #[must_use]
1362 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1363 self.inner = self.inner.accept_compressed(encoding);
1364 self
1365 }
1366 #[must_use]
1370 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1371 self.inner = self.inner.max_decoding_message_size(limit);
1372 self
1373 }
1374 #[must_use]
1378 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1379 self.inner = self.inner.max_encoding_message_size(limit);
1380 self
1381 }
1382 pub async fn upsert_namespace(
1383 &mut self,
1384 request: impl tonic::IntoRequest<super::UpsertNamespaceRequest>,
1385 ) -> std::result::Result<
1386 tonic::Response<super::UpsertNamespaceResponse>,
1387 tonic::Status,
1388 > {
1389 self.inner
1390 .ready()
1391 .await
1392 .map_err(|e| {
1393 tonic::Status::unknown(
1394 format!("Service was not ready: {}", e.into()),
1395 )
1396 })?;
1397 let codec = tonic_prost::ProstCodec::default();
1398 let path = http::uri::PathAndQuery::from_static(
1399 "/cortexdb.v1.KnowledgeGraphService/UpsertNamespace",
1400 );
1401 let mut req = request.into_request();
1402 req.extensions_mut()
1403 .insert(
1404 GrpcMethod::new(
1405 "cortexdb.v1.KnowledgeGraphService",
1406 "UpsertNamespace",
1407 ),
1408 );
1409 self.inner.unary(req, path, codec).await
1410 }
1411 pub async fn list_namespaces(
1412 &mut self,
1413 request: impl tonic::IntoRequest<super::ListNamespacesRequest>,
1414 ) -> std::result::Result<
1415 tonic::Response<super::ListNamespacesResponse>,
1416 tonic::Status,
1417 > {
1418 self.inner
1419 .ready()
1420 .await
1421 .map_err(|e| {
1422 tonic::Status::unknown(
1423 format!("Service was not ready: {}", e.into()),
1424 )
1425 })?;
1426 let codec = tonic_prost::ProstCodec::default();
1427 let path = http::uri::PathAndQuery::from_static(
1428 "/cortexdb.v1.KnowledgeGraphService/ListNamespaces",
1429 );
1430 let mut req = request.into_request();
1431 req.extensions_mut()
1432 .insert(
1433 GrpcMethod::new(
1434 "cortexdb.v1.KnowledgeGraphService",
1435 "ListNamespaces",
1436 ),
1437 );
1438 self.inner.unary(req, path, codec).await
1439 }
1440 pub async fn upsert_knowledge_graph(
1441 &mut self,
1442 request: impl tonic::IntoRequest<super::UpsertKnowledgeGraphRequest>,
1443 ) -> std::result::Result<
1444 tonic::Response<super::UpsertKnowledgeGraphResponse>,
1445 tonic::Status,
1446 > {
1447 self.inner
1448 .ready()
1449 .await
1450 .map_err(|e| {
1451 tonic::Status::unknown(
1452 format!("Service was not ready: {}", e.into()),
1453 )
1454 })?;
1455 let codec = tonic_prost::ProstCodec::default();
1456 let path = http::uri::PathAndQuery::from_static(
1457 "/cortexdb.v1.KnowledgeGraphService/UpsertKnowledgeGraph",
1458 );
1459 let mut req = request.into_request();
1460 req.extensions_mut()
1461 .insert(
1462 GrpcMethod::new(
1463 "cortexdb.v1.KnowledgeGraphService",
1464 "UpsertKnowledgeGraph",
1465 ),
1466 );
1467 self.inner.unary(req, path, codec).await
1468 }
1469 pub async fn find_knowledge_graph(
1470 &mut self,
1471 request: impl tonic::IntoRequest<super::FindKnowledgeGraphRequest>,
1472 ) -> std::result::Result<
1473 tonic::Response<super::FindKnowledgeGraphResponse>,
1474 tonic::Status,
1475 > {
1476 self.inner
1477 .ready()
1478 .await
1479 .map_err(|e| {
1480 tonic::Status::unknown(
1481 format!("Service was not ready: {}", e.into()),
1482 )
1483 })?;
1484 let codec = tonic_prost::ProstCodec::default();
1485 let path = http::uri::PathAndQuery::from_static(
1486 "/cortexdb.v1.KnowledgeGraphService/FindKnowledgeGraph",
1487 );
1488 let mut req = request.into_request();
1489 req.extensions_mut()
1490 .insert(
1491 GrpcMethod::new(
1492 "cortexdb.v1.KnowledgeGraphService",
1493 "FindKnowledgeGraph",
1494 ),
1495 );
1496 self.inner.unary(req, path, codec).await
1497 }
1498 pub async fn delete_knowledge_graph(
1499 &mut self,
1500 request: impl tonic::IntoRequest<super::DeleteKnowledgeGraphRequest>,
1501 ) -> std::result::Result<
1502 tonic::Response<super::DeleteKnowledgeGraphResponse>,
1503 tonic::Status,
1504 > {
1505 self.inner
1506 .ready()
1507 .await
1508 .map_err(|e| {
1509 tonic::Status::unknown(
1510 format!("Service was not ready: {}", e.into()),
1511 )
1512 })?;
1513 let codec = tonic_prost::ProstCodec::default();
1514 let path = http::uri::PathAndQuery::from_static(
1515 "/cortexdb.v1.KnowledgeGraphService/DeleteKnowledgeGraph",
1516 );
1517 let mut req = request.into_request();
1518 req.extensions_mut()
1519 .insert(
1520 GrpcMethod::new(
1521 "cortexdb.v1.KnowledgeGraphService",
1522 "DeleteKnowledgeGraph",
1523 ),
1524 );
1525 self.inner.unary(req, path, codec).await
1526 }
1527 pub async fn import_knowledge_graph(
1528 &mut self,
1529 request: impl tonic::IntoRequest<super::ImportKnowledgeGraphRequest>,
1530 ) -> std::result::Result<
1531 tonic::Response<super::ImportKnowledgeGraphResponse>,
1532 tonic::Status,
1533 > {
1534 self.inner
1535 .ready()
1536 .await
1537 .map_err(|e| {
1538 tonic::Status::unknown(
1539 format!("Service was not ready: {}", e.into()),
1540 )
1541 })?;
1542 let codec = tonic_prost::ProstCodec::default();
1543 let path = http::uri::PathAndQuery::from_static(
1544 "/cortexdb.v1.KnowledgeGraphService/ImportKnowledgeGraph",
1545 );
1546 let mut req = request.into_request();
1547 req.extensions_mut()
1548 .insert(
1549 GrpcMethod::new(
1550 "cortexdb.v1.KnowledgeGraphService",
1551 "ImportKnowledgeGraph",
1552 ),
1553 );
1554 self.inner.unary(req, path, codec).await
1555 }
1556 pub async fn export_knowledge_graph(
1557 &mut self,
1558 request: impl tonic::IntoRequest<super::ExportKnowledgeGraphRequest>,
1559 ) -> std::result::Result<
1560 tonic::Response<super::ExportKnowledgeGraphResponse>,
1561 tonic::Status,
1562 > {
1563 self.inner
1564 .ready()
1565 .await
1566 .map_err(|e| {
1567 tonic::Status::unknown(
1568 format!("Service was not ready: {}", e.into()),
1569 )
1570 })?;
1571 let codec = tonic_prost::ProstCodec::default();
1572 let path = http::uri::PathAndQuery::from_static(
1573 "/cortexdb.v1.KnowledgeGraphService/ExportKnowledgeGraph",
1574 );
1575 let mut req = request.into_request();
1576 req.extensions_mut()
1577 .insert(
1578 GrpcMethod::new(
1579 "cortexdb.v1.KnowledgeGraphService",
1580 "ExportKnowledgeGraph",
1581 ),
1582 );
1583 self.inner.unary(req, path, codec).await
1584 }
1585 pub async fn query_sparql(
1586 &mut self,
1587 request: impl tonic::IntoRequest<super::QuerySparqlRequest>,
1588 ) -> std::result::Result<
1589 tonic::Response<super::QuerySparqlResponse>,
1590 tonic::Status,
1591 > {
1592 self.inner
1593 .ready()
1594 .await
1595 .map_err(|e| {
1596 tonic::Status::unknown(
1597 format!("Service was not ready: {}", e.into()),
1598 )
1599 })?;
1600 let codec = tonic_prost::ProstCodec::default();
1601 let path = http::uri::PathAndQuery::from_static(
1602 "/cortexdb.v1.KnowledgeGraphService/QuerySparql",
1603 );
1604 let mut req = request.into_request();
1605 req.extensions_mut()
1606 .insert(
1607 GrpcMethod::new("cortexdb.v1.KnowledgeGraphService", "QuerySparql"),
1608 );
1609 self.inner.unary(req, path, codec).await
1610 }
1611 pub async fn validate_shacl(
1612 &mut self,
1613 request: impl tonic::IntoRequest<super::ValidateShaclRequest>,
1614 ) -> std::result::Result<
1615 tonic::Response<super::ValidateShaclResponse>,
1616 tonic::Status,
1617 > {
1618 self.inner
1619 .ready()
1620 .await
1621 .map_err(|e| {
1622 tonic::Status::unknown(
1623 format!("Service was not ready: {}", e.into()),
1624 )
1625 })?;
1626 let codec = tonic_prost::ProstCodec::default();
1627 let path = http::uri::PathAndQuery::from_static(
1628 "/cortexdb.v1.KnowledgeGraphService/ValidateShacl",
1629 );
1630 let mut req = request.into_request();
1631 req.extensions_mut()
1632 .insert(
1633 GrpcMethod::new("cortexdb.v1.KnowledgeGraphService", "ValidateShacl"),
1634 );
1635 self.inner.unary(req, path, codec).await
1636 }
1637 pub async fn refresh_inference(
1638 &mut self,
1639 request: impl tonic::IntoRequest<super::RefreshInferenceRequest>,
1640 ) -> std::result::Result<
1641 tonic::Response<super::RefreshInferenceResponse>,
1642 tonic::Status,
1643 > {
1644 self.inner
1645 .ready()
1646 .await
1647 .map_err(|e| {
1648 tonic::Status::unknown(
1649 format!("Service was not ready: {}", e.into()),
1650 )
1651 })?;
1652 let codec = tonic_prost::ProstCodec::default();
1653 let path = http::uri::PathAndQuery::from_static(
1654 "/cortexdb.v1.KnowledgeGraphService/RefreshInference",
1655 );
1656 let mut req = request.into_request();
1657 req.extensions_mut()
1658 .insert(
1659 GrpcMethod::new(
1660 "cortexdb.v1.KnowledgeGraphService",
1661 "RefreshInference",
1662 ),
1663 );
1664 self.inner.unary(req, path, codec).await
1665 }
1666 pub async fn summarize_inference(
1667 &mut self,
1668 request: impl tonic::IntoRequest<super::SummarizeInferenceRequest>,
1669 ) -> std::result::Result<
1670 tonic::Response<super::SummarizeInferenceResponse>,
1671 tonic::Status,
1672 > {
1673 self.inner
1674 .ready()
1675 .await
1676 .map_err(|e| {
1677 tonic::Status::unknown(
1678 format!("Service was not ready: {}", e.into()),
1679 )
1680 })?;
1681 let codec = tonic_prost::ProstCodec::default();
1682 let path = http::uri::PathAndQuery::from_static(
1683 "/cortexdb.v1.KnowledgeGraphService/SummarizeInference",
1684 );
1685 let mut req = request.into_request();
1686 req.extensions_mut()
1687 .insert(
1688 GrpcMethod::new(
1689 "cortexdb.v1.KnowledgeGraphService",
1690 "SummarizeInference",
1691 ),
1692 );
1693 self.inner.unary(req, path, codec).await
1694 }
1695 pub async fn explain_inference(
1696 &mut self,
1697 request: impl tonic::IntoRequest<super::ExplainInferenceRequest>,
1698 ) -> std::result::Result<
1699 tonic::Response<super::ExplainInferenceResponse>,
1700 tonic::Status,
1701 > {
1702 self.inner
1703 .ready()
1704 .await
1705 .map_err(|e| {
1706 tonic::Status::unknown(
1707 format!("Service was not ready: {}", e.into()),
1708 )
1709 })?;
1710 let codec = tonic_prost::ProstCodec::default();
1711 let path = http::uri::PathAndQuery::from_static(
1712 "/cortexdb.v1.KnowledgeGraphService/ExplainInference",
1713 );
1714 let mut req = request.into_request();
1715 req.extensions_mut()
1716 .insert(
1717 GrpcMethod::new(
1718 "cortexdb.v1.KnowledgeGraphService",
1719 "ExplainInference",
1720 ),
1721 );
1722 self.inner.unary(req, path, codec).await
1723 }
1724 pub async fn explain_inference_match(
1725 &mut self,
1726 request: impl tonic::IntoRequest<super::ExplainInferenceMatchRequest>,
1727 ) -> std::result::Result<
1728 tonic::Response<super::ExplainInferenceMatchResponse>,
1729 tonic::Status,
1730 > {
1731 self.inner
1732 .ready()
1733 .await
1734 .map_err(|e| {
1735 tonic::Status::unknown(
1736 format!("Service was not ready: {}", e.into()),
1737 )
1738 })?;
1739 let codec = tonic_prost::ProstCodec::default();
1740 let path = http::uri::PathAndQuery::from_static(
1741 "/cortexdb.v1.KnowledgeGraphService/ExplainInferenceMatch",
1742 );
1743 let mut req = request.into_request();
1744 req.extensions_mut()
1745 .insert(
1746 GrpcMethod::new(
1747 "cortexdb.v1.KnowledgeGraphService",
1748 "ExplainInferenceMatch",
1749 ),
1750 );
1751 self.inner.unary(req, path, codec).await
1752 }
1753 pub async fn save_ontology_schema(
1754 &mut self,
1755 request: impl tonic::IntoRequest<super::SaveOntologySchemaRequest>,
1756 ) -> std::result::Result<
1757 tonic::Response<super::SaveOntologySchemaResponse>,
1758 tonic::Status,
1759 > {
1760 self.inner
1761 .ready()
1762 .await
1763 .map_err(|e| {
1764 tonic::Status::unknown(
1765 format!("Service was not ready: {}", e.into()),
1766 )
1767 })?;
1768 let codec = tonic_prost::ProstCodec::default();
1769 let path = http::uri::PathAndQuery::from_static(
1770 "/cortexdb.v1.KnowledgeGraphService/SaveOntologySchema",
1771 );
1772 let mut req = request.into_request();
1773 req.extensions_mut()
1774 .insert(
1775 GrpcMethod::new(
1776 "cortexdb.v1.KnowledgeGraphService",
1777 "SaveOntologySchema",
1778 ),
1779 );
1780 self.inner.unary(req, path, codec).await
1781 }
1782 pub async fn get_ontology_schema(
1783 &mut self,
1784 request: impl tonic::IntoRequest<super::GetOntologySchemaRequest>,
1785 ) -> std::result::Result<
1786 tonic::Response<super::GetOntologySchemaResponse>,
1787 tonic::Status,
1788 > {
1789 self.inner
1790 .ready()
1791 .await
1792 .map_err(|e| {
1793 tonic::Status::unknown(
1794 format!("Service was not ready: {}", e.into()),
1795 )
1796 })?;
1797 let codec = tonic_prost::ProstCodec::default();
1798 let path = http::uri::PathAndQuery::from_static(
1799 "/cortexdb.v1.KnowledgeGraphService/GetOntologySchema",
1800 );
1801 let mut req = request.into_request();
1802 req.extensions_mut()
1803 .insert(
1804 GrpcMethod::new(
1805 "cortexdb.v1.KnowledgeGraphService",
1806 "GetOntologySchema",
1807 ),
1808 );
1809 self.inner.unary(req, path, codec).await
1810 }
1811 pub async fn list_ontology_schemas(
1812 &mut self,
1813 request: impl tonic::IntoRequest<super::ListOntologySchemasRequest>,
1814 ) -> std::result::Result<
1815 tonic::Response<super::ListOntologySchemasResponse>,
1816 tonic::Status,
1817 > {
1818 self.inner
1819 .ready()
1820 .await
1821 .map_err(|e| {
1822 tonic::Status::unknown(
1823 format!("Service was not ready: {}", e.into()),
1824 )
1825 })?;
1826 let codec = tonic_prost::ProstCodec::default();
1827 let path = http::uri::PathAndQuery::from_static(
1828 "/cortexdb.v1.KnowledgeGraphService/ListOntologySchemas",
1829 );
1830 let mut req = request.into_request();
1831 req.extensions_mut()
1832 .insert(
1833 GrpcMethod::new(
1834 "cortexdb.v1.KnowledgeGraphService",
1835 "ListOntologySchemas",
1836 ),
1837 );
1838 self.inner.unary(req, path, codec).await
1839 }
1840 pub async fn delete_ontology_schema(
1841 &mut self,
1842 request: impl tonic::IntoRequest<super::DeleteOntologySchemaRequest>,
1843 ) -> std::result::Result<
1844 tonic::Response<super::DeleteOntologySchemaResponse>,
1845 tonic::Status,
1846 > {
1847 self.inner
1848 .ready()
1849 .await
1850 .map_err(|e| {
1851 tonic::Status::unknown(
1852 format!("Service was not ready: {}", e.into()),
1853 )
1854 })?;
1855 let codec = tonic_prost::ProstCodec::default();
1856 let path = http::uri::PathAndQuery::from_static(
1857 "/cortexdb.v1.KnowledgeGraphService/DeleteOntologySchema",
1858 );
1859 let mut req = request.into_request();
1860 req.extensions_mut()
1861 .insert(
1862 GrpcMethod::new(
1863 "cortexdb.v1.KnowledgeGraphService",
1864 "DeleteOntologySchema",
1865 ),
1866 );
1867 self.inner.unary(req, path, codec).await
1868 }
1869 }
1870}
1871#[derive(Clone, PartialEq, ::prost::Message)]
1872pub struct InsertGraphDocumentRequest {
1873 #[prost(string, tag = "1")]
1874 pub id: ::prost::alloc::string::String,
1875 #[prost(string, tag = "2")]
1876 pub title: ::prost::alloc::string::String,
1877 #[prost(string, tag = "3")]
1878 pub content: ::prost::alloc::string::String,
1879 #[prost(map = "string, string", tag = "4")]
1880 pub metadata: ::std::collections::HashMap<
1881 ::prost::alloc::string::String,
1882 ::prost::alloc::string::String,
1883 >,
1884 #[prost(string, tag = "5")]
1886 pub collection: ::prost::alloc::string::String,
1887 #[prost(int32, tag = "6")]
1888 pub chunk_size: i32,
1889 #[prost(int32, tag = "7")]
1890 pub chunk_overlap: i32,
1891}
1892#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1893pub struct InsertGraphDocumentResponse {
1894 #[prost(string, tag = "1")]
1895 pub document_node_id: ::prost::alloc::string::String,
1896 #[prost(string, repeated, tag = "2")]
1897 pub chunk_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1898 #[prost(string, repeated, tag = "3")]
1899 pub entity_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1900}
1901#[derive(Clone, PartialEq, ::prost::Message)]
1902pub struct SearchGraphRagRequest {
1903 #[prost(string, tag = "1")]
1904 pub query: ::prost::alloc::string::String,
1905 #[prost(string, tag = "2")]
1906 pub collection: ::prost::alloc::string::String,
1907 #[prost(int32, tag = "3")]
1908 pub top_k: i32,
1909 #[prost(int32, tag = "4")]
1910 pub max_hops: i32,
1911 #[prost(int32, tag = "5")]
1912 pub max_related_chunks: i32,
1913 #[prost(int32, tag = "6")]
1914 pub max_context_chunks: i32,
1915 #[prost(int32, tag = "7")]
1916 pub max_context_chars: i32,
1917 #[prost(int32, tag = "8")]
1918 pub per_document_limit: i32,
1919 #[prost(bool, tag = "9")]
1920 pub rerank: bool,
1921 #[prost(bool, tag = "10")]
1922 pub disable_rerank: bool,
1923 #[prost(double, tag = "11")]
1924 pub diversity_lambda: f64,
1925 #[prost(bool, tag = "12")]
1926 pub disable_graph: bool,
1927 #[prost(string, tag = "13")]
1928 pub retrieval_mode: ::prost::alloc::string::String,
1929 #[prost(bool, tag = "14")]
1930 pub graph_light: bool,
1931 #[prost(int32, tag = "15")]
1932 pub max_expansion_seeds: i32,
1933 #[prost(int32, tag = "16")]
1934 pub max_traversal_nodes: i32,
1935 #[prost(int32, tag = "17")]
1936 pub max_entities_per_chunk: i32,
1937 #[prost(message, optional, tag = "18")]
1938 pub plan: ::core::option::Option<RetrievalPlan>,
1939}
1940#[derive(Clone, PartialEq, ::prost::Message)]
1941pub struct SearchGraphRagResponse {
1942 #[prost(string, tag = "1")]
1943 pub query: ::prost::alloc::string::String,
1944 #[prost(message, optional, tag = "2")]
1945 pub plan: ::core::option::Option<RetrievalPlan>,
1946 #[prost(message, optional, tag = "3")]
1947 pub decision: ::core::option::Option<RetrievalDecision>,
1948 #[prost(message, repeated, tag = "4")]
1949 pub chunks: ::prost::alloc::vec::Vec<GraphRagChunkResult>,
1950 #[prost(string, repeated, tag = "5")]
1951 pub entities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1952 #[prost(string, tag = "6")]
1953 pub context: ::prost::alloc::string::String,
1954}
1955#[derive(Clone, PartialEq, ::prost::Message)]
1956pub struct InsertTextRequest {
1957 #[prost(string, tag = "1")]
1958 pub id: ::prost::alloc::string::String,
1959 #[prost(string, tag = "2")]
1960 pub text: ::prost::alloc::string::String,
1961 #[prost(map = "string, string", tag = "3")]
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 InsertTextResponse {}
1969#[derive(Clone, PartialEq, ::prost::Message)]
1970pub struct InsertTextBatchRequest {
1971 #[prost(map = "string, string", tag = "1")]
1972 pub texts: ::std::collections::HashMap<
1973 ::prost::alloc::string::String,
1974 ::prost::alloc::string::String,
1975 >,
1976 #[prost(map = "string, string", tag = "2")]
1977 pub metadata: ::std::collections::HashMap<
1978 ::prost::alloc::string::String,
1979 ::prost::alloc::string::String,
1980 >,
1981}
1982#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1983pub struct InsertTextBatchResponse {}
1984#[derive(Clone, PartialEq, ::prost::Message)]
1985pub struct ScoredText {
1986 #[prost(string, tag = "1")]
1987 pub id: ::prost::alloc::string::String,
1988 #[prost(string, tag = "2")]
1989 pub content: ::prost::alloc::string::String,
1990 #[prost(string, tag = "3")]
1991 pub doc_id: ::prost::alloc::string::String,
1992 #[prost(string, tag = "4")]
1993 pub collection: ::prost::alloc::string::String,
1994 #[prost(map = "string, string", tag = "5")]
1995 pub metadata: ::std::collections::HashMap<
1996 ::prost::alloc::string::String,
1997 ::prost::alloc::string::String,
1998 >,
1999 #[prost(double, tag = "6")]
2000 pub score: f64,
2001}
2002#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2003pub struct SearchTextRequest {
2004 #[prost(string, tag = "1")]
2005 pub query: ::prost::alloc::string::String,
2006 #[prost(string, tag = "2")]
2007 pub collection: ::prost::alloc::string::String,
2008 #[prost(int32, tag = "3")]
2009 pub top_k: i32,
2010}
2011#[derive(Clone, PartialEq, ::prost::Message)]
2012pub struct SearchTextResponse {
2013 #[prost(message, repeated, tag = "1")]
2014 pub results: ::prost::alloc::vec::Vec<ScoredText>,
2015}
2016#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2017pub struct HybridSearchTextRequest {
2018 #[prost(string, tag = "1")]
2019 pub query: ::prost::alloc::string::String,
2020 #[prost(int32, tag = "2")]
2021 pub top_k: i32,
2022}
2023#[derive(Clone, PartialEq, ::prost::Message)]
2024pub struct HybridSearchTextResponse {
2025 #[prost(message, repeated, tag = "1")]
2026 pub results: ::prost::alloc::vec::Vec<ScoredText>,
2027}
2028pub mod graph_rag_service_client {
2030 #![allow(
2031 unused_variables,
2032 dead_code,
2033 missing_docs,
2034 clippy::wildcard_imports,
2035 clippy::let_unit_value,
2036 )]
2037 use tonic::codegen::*;
2038 use tonic::codegen::http::Uri;
2039 #[derive(Debug, Clone)]
2040 pub struct GraphRagServiceClient<T> {
2041 inner: tonic::client::Grpc<T>,
2042 }
2043 impl GraphRagServiceClient<tonic::transport::Channel> {
2044 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2046 where
2047 D: TryInto<tonic::transport::Endpoint>,
2048 D::Error: Into<StdError>,
2049 {
2050 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2051 Ok(Self::new(conn))
2052 }
2053 }
2054 impl<T> GraphRagServiceClient<T>
2055 where
2056 T: tonic::client::GrpcService<tonic::body::Body>,
2057 T::Error: Into<StdError>,
2058 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2059 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2060 {
2061 pub fn new(inner: T) -> Self {
2062 let inner = tonic::client::Grpc::new(inner);
2063 Self { inner }
2064 }
2065 pub fn with_origin(inner: T, origin: Uri) -> Self {
2066 let inner = tonic::client::Grpc::with_origin(inner, origin);
2067 Self { inner }
2068 }
2069 pub fn with_interceptor<F>(
2070 inner: T,
2071 interceptor: F,
2072 ) -> GraphRagServiceClient<InterceptedService<T, F>>
2073 where
2074 F: tonic::service::Interceptor,
2075 T::ResponseBody: Default,
2076 T: tonic::codegen::Service<
2077 http::Request<tonic::body::Body>,
2078 Response = http::Response<
2079 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2080 >,
2081 >,
2082 <T as tonic::codegen::Service<
2083 http::Request<tonic::body::Body>,
2084 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2085 {
2086 GraphRagServiceClient::new(InterceptedService::new(inner, interceptor))
2087 }
2088 #[must_use]
2093 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2094 self.inner = self.inner.send_compressed(encoding);
2095 self
2096 }
2097 #[must_use]
2099 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2100 self.inner = self.inner.accept_compressed(encoding);
2101 self
2102 }
2103 #[must_use]
2107 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2108 self.inner = self.inner.max_decoding_message_size(limit);
2109 self
2110 }
2111 #[must_use]
2115 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2116 self.inner = self.inner.max_encoding_message_size(limit);
2117 self
2118 }
2119 pub async fn insert_graph_document(
2120 &mut self,
2121 request: impl tonic::IntoRequest<super::InsertGraphDocumentRequest>,
2122 ) -> std::result::Result<
2123 tonic::Response<super::InsertGraphDocumentResponse>,
2124 tonic::Status,
2125 > {
2126 self.inner
2127 .ready()
2128 .await
2129 .map_err(|e| {
2130 tonic::Status::unknown(
2131 format!("Service was not ready: {}", e.into()),
2132 )
2133 })?;
2134 let codec = tonic_prost::ProstCodec::default();
2135 let path = http::uri::PathAndQuery::from_static(
2136 "/cortexdb.v1.GraphRagService/InsertGraphDocument",
2137 );
2138 let mut req = request.into_request();
2139 req.extensions_mut()
2140 .insert(
2141 GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertGraphDocument"),
2142 );
2143 self.inner.unary(req, path, codec).await
2144 }
2145 pub async fn search_graph_rag(
2146 &mut self,
2147 request: impl tonic::IntoRequest<super::SearchGraphRagRequest>,
2148 ) -> std::result::Result<
2149 tonic::Response<super::SearchGraphRagResponse>,
2150 tonic::Status,
2151 > {
2152 self.inner
2153 .ready()
2154 .await
2155 .map_err(|e| {
2156 tonic::Status::unknown(
2157 format!("Service was not ready: {}", e.into()),
2158 )
2159 })?;
2160 let codec = tonic_prost::ProstCodec::default();
2161 let path = http::uri::PathAndQuery::from_static(
2162 "/cortexdb.v1.GraphRagService/SearchGraphRag",
2163 );
2164 let mut req = request.into_request();
2165 req.extensions_mut()
2166 .insert(
2167 GrpcMethod::new("cortexdb.v1.GraphRagService", "SearchGraphRag"),
2168 );
2169 self.inner.unary(req, path, codec).await
2170 }
2171 pub async fn insert_text(
2172 &mut self,
2173 request: impl tonic::IntoRequest<super::InsertTextRequest>,
2174 ) -> std::result::Result<
2175 tonic::Response<super::InsertTextResponse>,
2176 tonic::Status,
2177 > {
2178 self.inner
2179 .ready()
2180 .await
2181 .map_err(|e| {
2182 tonic::Status::unknown(
2183 format!("Service was not ready: {}", e.into()),
2184 )
2185 })?;
2186 let codec = tonic_prost::ProstCodec::default();
2187 let path = http::uri::PathAndQuery::from_static(
2188 "/cortexdb.v1.GraphRagService/InsertText",
2189 );
2190 let mut req = request.into_request();
2191 req.extensions_mut()
2192 .insert(GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertText"));
2193 self.inner.unary(req, path, codec).await
2194 }
2195 pub async fn insert_text_batch(
2196 &mut self,
2197 request: impl tonic::IntoRequest<super::InsertTextBatchRequest>,
2198 ) -> std::result::Result<
2199 tonic::Response<super::InsertTextBatchResponse>,
2200 tonic::Status,
2201 > {
2202 self.inner
2203 .ready()
2204 .await
2205 .map_err(|e| {
2206 tonic::Status::unknown(
2207 format!("Service was not ready: {}", e.into()),
2208 )
2209 })?;
2210 let codec = tonic_prost::ProstCodec::default();
2211 let path = http::uri::PathAndQuery::from_static(
2212 "/cortexdb.v1.GraphRagService/InsertTextBatch",
2213 );
2214 let mut req = request.into_request();
2215 req.extensions_mut()
2216 .insert(
2217 GrpcMethod::new("cortexdb.v1.GraphRagService", "InsertTextBatch"),
2218 );
2219 self.inner.unary(req, path, codec).await
2220 }
2221 pub async fn search_text(
2222 &mut self,
2223 request: impl tonic::IntoRequest<super::SearchTextRequest>,
2224 ) -> std::result::Result<
2225 tonic::Response<super::SearchTextResponse>,
2226 tonic::Status,
2227 > {
2228 self.inner
2229 .ready()
2230 .await
2231 .map_err(|e| {
2232 tonic::Status::unknown(
2233 format!("Service was not ready: {}", e.into()),
2234 )
2235 })?;
2236 let codec = tonic_prost::ProstCodec::default();
2237 let path = http::uri::PathAndQuery::from_static(
2238 "/cortexdb.v1.GraphRagService/SearchText",
2239 );
2240 let mut req = request.into_request();
2241 req.extensions_mut()
2242 .insert(GrpcMethod::new("cortexdb.v1.GraphRagService", "SearchText"));
2243 self.inner.unary(req, path, codec).await
2244 }
2245 pub async fn hybrid_search_text(
2246 &mut self,
2247 request: impl tonic::IntoRequest<super::HybridSearchTextRequest>,
2248 ) -> std::result::Result<
2249 tonic::Response<super::HybridSearchTextResponse>,
2250 tonic::Status,
2251 > {
2252 self.inner
2253 .ready()
2254 .await
2255 .map_err(|e| {
2256 tonic::Status::unknown(
2257 format!("Service was not ready: {}", e.into()),
2258 )
2259 })?;
2260 let codec = tonic_prost::ProstCodec::default();
2261 let path = http::uri::PathAndQuery::from_static(
2262 "/cortexdb.v1.GraphRagService/HybridSearchText",
2263 );
2264 let mut req = request.into_request();
2265 req.extensions_mut()
2266 .insert(
2267 GrpcMethod::new("cortexdb.v1.GraphRagService", "HybridSearchText"),
2268 );
2269 self.inner.unary(req, path, codec).await
2270 }
2271 }
2272}
2273#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2274pub struct ToolDefinition {
2275 #[prost(string, tag = "1")]
2276 pub name: ::prost::alloc::string::String,
2277 #[prost(string, tag = "2")]
2278 pub description: ::prost::alloc::string::String,
2279 #[prost(string, tag = "3")]
2281 pub input_schema_json: ::prost::alloc::string::String,
2282}
2283#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2284pub struct ListToolsRequest {}
2285#[derive(Clone, PartialEq, ::prost::Message)]
2286pub struct ListToolsResponse {
2287 #[prost(message, repeated, tag = "1")]
2288 pub tools: ::prost::alloc::vec::Vec<ToolDefinition>,
2289}
2290#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2291pub struct CallToolRequest {
2292 #[prost(string, tag = "1")]
2293 pub name: ::prost::alloc::string::String,
2294 #[prost(string, tag = "2")]
2296 pub args_json: ::prost::alloc::string::String,
2297}
2298#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2299pub struct CallToolResponse {
2300 #[prost(string, tag = "1")]
2302 pub result_json: ::prost::alloc::string::String,
2303}
2304pub mod tools_service_client {
2306 #![allow(
2307 unused_variables,
2308 dead_code,
2309 missing_docs,
2310 clippy::wildcard_imports,
2311 clippy::let_unit_value,
2312 )]
2313 use tonic::codegen::*;
2314 use tonic::codegen::http::Uri;
2315 #[derive(Debug, Clone)]
2316 pub struct ToolsServiceClient<T> {
2317 inner: tonic::client::Grpc<T>,
2318 }
2319 impl ToolsServiceClient<tonic::transport::Channel> {
2320 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2322 where
2323 D: TryInto<tonic::transport::Endpoint>,
2324 D::Error: Into<StdError>,
2325 {
2326 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2327 Ok(Self::new(conn))
2328 }
2329 }
2330 impl<T> ToolsServiceClient<T>
2331 where
2332 T: tonic::client::GrpcService<tonic::body::Body>,
2333 T::Error: Into<StdError>,
2334 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2335 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2336 {
2337 pub fn new(inner: T) -> Self {
2338 let inner = tonic::client::Grpc::new(inner);
2339 Self { inner }
2340 }
2341 pub fn with_origin(inner: T, origin: Uri) -> Self {
2342 let inner = tonic::client::Grpc::with_origin(inner, origin);
2343 Self { inner }
2344 }
2345 pub fn with_interceptor<F>(
2346 inner: T,
2347 interceptor: F,
2348 ) -> ToolsServiceClient<InterceptedService<T, F>>
2349 where
2350 F: tonic::service::Interceptor,
2351 T::ResponseBody: Default,
2352 T: tonic::codegen::Service<
2353 http::Request<tonic::body::Body>,
2354 Response = http::Response<
2355 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2356 >,
2357 >,
2358 <T as tonic::codegen::Service<
2359 http::Request<tonic::body::Body>,
2360 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2361 {
2362 ToolsServiceClient::new(InterceptedService::new(inner, interceptor))
2363 }
2364 #[must_use]
2369 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2370 self.inner = self.inner.send_compressed(encoding);
2371 self
2372 }
2373 #[must_use]
2375 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2376 self.inner = self.inner.accept_compressed(encoding);
2377 self
2378 }
2379 #[must_use]
2383 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2384 self.inner = self.inner.max_decoding_message_size(limit);
2385 self
2386 }
2387 #[must_use]
2391 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2392 self.inner = self.inner.max_encoding_message_size(limit);
2393 self
2394 }
2395 pub async fn list_tools(
2396 &mut self,
2397 request: impl tonic::IntoRequest<super::ListToolsRequest>,
2398 ) -> std::result::Result<
2399 tonic::Response<super::ListToolsResponse>,
2400 tonic::Status,
2401 > {
2402 self.inner
2403 .ready()
2404 .await
2405 .map_err(|e| {
2406 tonic::Status::unknown(
2407 format!("Service was not ready: {}", e.into()),
2408 )
2409 })?;
2410 let codec = tonic_prost::ProstCodec::default();
2411 let path = http::uri::PathAndQuery::from_static(
2412 "/cortexdb.v1.ToolsService/ListTools",
2413 );
2414 let mut req = request.into_request();
2415 req.extensions_mut()
2416 .insert(GrpcMethod::new("cortexdb.v1.ToolsService", "ListTools"));
2417 self.inner.unary(req, path, codec).await
2418 }
2419 pub async fn call_tool(
2420 &mut self,
2421 request: impl tonic::IntoRequest<super::CallToolRequest>,
2422 ) -> std::result::Result<
2423 tonic::Response<super::CallToolResponse>,
2424 tonic::Status,
2425 > {
2426 self.inner
2427 .ready()
2428 .await
2429 .map_err(|e| {
2430 tonic::Status::unknown(
2431 format!("Service was not ready: {}", e.into()),
2432 )
2433 })?;
2434 let codec = tonic_prost::ProstCodec::default();
2435 let path = http::uri::PathAndQuery::from_static(
2436 "/cortexdb.v1.ToolsService/CallTool",
2437 );
2438 let mut req = request.into_request();
2439 req.extensions_mut()
2440 .insert(GrpcMethod::new("cortexdb.v1.ToolsService", "CallTool"));
2441 self.inner.unary(req, path, codec).await
2442 }
2443 }
2444}
2445#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2446pub struct HealthRequest {}
2447#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2448pub struct HealthResponse {
2449 #[prost(bool, tag = "1")]
2450 pub ok: bool,
2451}
2452#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2453pub struct InfoRequest {}
2454#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2455pub struct InfoResponse {
2456 #[prost(string, tag = "1")]
2457 pub version: ::prost::alloc::string::String,
2458 #[prost(string, tag = "2")]
2459 pub db_path: ::prost::alloc::string::String,
2460 #[prost(bool, tag = "3")]
2461 pub has_embedder: bool,
2462}
2463pub mod admin_service_client {
2465 #![allow(
2466 unused_variables,
2467 dead_code,
2468 missing_docs,
2469 clippy::wildcard_imports,
2470 clippy::let_unit_value,
2471 )]
2472 use tonic::codegen::*;
2473 use tonic::codegen::http::Uri;
2474 #[derive(Debug, Clone)]
2475 pub struct AdminServiceClient<T> {
2476 inner: tonic::client::Grpc<T>,
2477 }
2478 impl AdminServiceClient<tonic::transport::Channel> {
2479 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2481 where
2482 D: TryInto<tonic::transport::Endpoint>,
2483 D::Error: Into<StdError>,
2484 {
2485 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2486 Ok(Self::new(conn))
2487 }
2488 }
2489 impl<T> AdminServiceClient<T>
2490 where
2491 T: tonic::client::GrpcService<tonic::body::Body>,
2492 T::Error: Into<StdError>,
2493 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2494 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2495 {
2496 pub fn new(inner: T) -> Self {
2497 let inner = tonic::client::Grpc::new(inner);
2498 Self { inner }
2499 }
2500 pub fn with_origin(inner: T, origin: Uri) -> Self {
2501 let inner = tonic::client::Grpc::with_origin(inner, origin);
2502 Self { inner }
2503 }
2504 pub fn with_interceptor<F>(
2505 inner: T,
2506 interceptor: F,
2507 ) -> AdminServiceClient<InterceptedService<T, F>>
2508 where
2509 F: tonic::service::Interceptor,
2510 T::ResponseBody: Default,
2511 T: tonic::codegen::Service<
2512 http::Request<tonic::body::Body>,
2513 Response = http::Response<
2514 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2515 >,
2516 >,
2517 <T as tonic::codegen::Service<
2518 http::Request<tonic::body::Body>,
2519 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2520 {
2521 AdminServiceClient::new(InterceptedService::new(inner, interceptor))
2522 }
2523 #[must_use]
2528 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2529 self.inner = self.inner.send_compressed(encoding);
2530 self
2531 }
2532 #[must_use]
2534 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2535 self.inner = self.inner.accept_compressed(encoding);
2536 self
2537 }
2538 #[must_use]
2542 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2543 self.inner = self.inner.max_decoding_message_size(limit);
2544 self
2545 }
2546 #[must_use]
2550 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2551 self.inner = self.inner.max_encoding_message_size(limit);
2552 self
2553 }
2554 pub async fn health(
2555 &mut self,
2556 request: impl tonic::IntoRequest<super::HealthRequest>,
2557 ) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
2558 self.inner
2559 .ready()
2560 .await
2561 .map_err(|e| {
2562 tonic::Status::unknown(
2563 format!("Service was not ready: {}", e.into()),
2564 )
2565 })?;
2566 let codec = tonic_prost::ProstCodec::default();
2567 let path = http::uri::PathAndQuery::from_static(
2568 "/cortexdb.v1.AdminService/Health",
2569 );
2570 let mut req = request.into_request();
2571 req.extensions_mut()
2572 .insert(GrpcMethod::new("cortexdb.v1.AdminService", "Health"));
2573 self.inner.unary(req, path, codec).await
2574 }
2575 pub async fn info(
2576 &mut self,
2577 request: impl tonic::IntoRequest<super::InfoRequest>,
2578 ) -> std::result::Result<tonic::Response<super::InfoResponse>, tonic::Status> {
2579 self.inner
2580 .ready()
2581 .await
2582 .map_err(|e| {
2583 tonic::Status::unknown(
2584 format!("Service was not ready: {}", e.into()),
2585 )
2586 })?;
2587 let codec = tonic_prost::ProstCodec::default();
2588 let path = http::uri::PathAndQuery::from_static(
2589 "/cortexdb.v1.AdminService/Info",
2590 );
2591 let mut req = request.into_request();
2592 req.extensions_mut()
2593 .insert(GrpcMethod::new("cortexdb.v1.AdminService", "Info"));
2594 self.inner.unary(req, path, codec).await
2595 }
2596 }
2597}