1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetSnapshotRidByUserMessageIdRequest {
4 #[prost(string, tag = "1")]
5 pub conversation_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub message_id: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct GetSnapshotRidByUserMessageIdResponse {
13 #[prost(string, optional, tag = "1")]
14 pub snapshot_rid: ::core::option::Option<::prost::alloc::string::String>,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct StreamChatRequest {
19 #[prost(string, tag = "1")]
21 pub conversation_rid: ::prost::alloc::string::String,
22 #[prost(message, optional, tag = "2")]
24 pub message: ::core::option::Option<UserModelMessage>,
25 #[prost(message, repeated, tag = "3")]
27 pub images: ::prost::alloc::vec::Vec<ImagePart>,
28 #[prost(oneof = "stream_chat_request::Context", tags = "4, 5")]
30 pub context: ::core::option::Option<stream_chat_request::Context>,
31}
32pub mod stream_chat_request {
34 #[derive(Clone, PartialEq, ::prost::Oneof)]
36 pub enum Context {
37 #[prost(message, tag = "4")]
38 Workbook(super::WorkbookContext),
39 #[prost(message, tag = "5")]
40 Global(super::GlobalContext),
41 }
42}
43#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct WorkbookContext {
46 #[prost(string, tag = "1")]
48 pub workbook_rid: ::prost::alloc::string::String,
49 #[prost(message, optional, tag = "2")]
51 pub user_presence: ::core::option::Option<WorkbookUserPresence>,
52}
53#[derive(Clone, Copy, PartialEq, ::prost::Message)]
55pub struct GlobalContext {}
56#[derive(Clone, Copy, PartialEq, ::prost::Message)]
59pub struct WorkbookUserPresence {
60 #[prost(int32, optional, tag = "1")]
61 pub tab_index: ::core::option::Option<i32>,
62 #[prost(message, optional, tag = "2")]
63 pub range: ::core::option::Option<TimeRange>,
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct CreateConversationRequest {
72 #[prost(string, tag = "1")]
73 pub title: ::prost::alloc::string::String,
74 #[prost(string, tag = "2")]
75 pub workspace_rid: ::prost::alloc::string::String,
76 #[prost(string, optional, tag = "3")]
77 pub old_conversation_rid: ::core::option::Option<::prost::alloc::string::String>,
78 #[prost(string, optional, tag = "4")]
79 pub previous_message_id: ::core::option::Option<::prost::alloc::string::String>,
80}
81#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct CreateConversationResponse {
84 #[prost(string, tag = "1")]
85 pub new_conversation_rid: ::prost::alloc::string::String,
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct UpdateConversationMetadataRequest {
89 #[prost(string, tag = "1")]
90 pub title: ::prost::alloc::string::String,
91 #[prost(string, tag = "2")]
92 pub conversation_rid: ::prost::alloc::string::String,
93}
94#[derive(Clone, Copy, PartialEq, ::prost::Message)]
95pub struct UpdateConversationMetadataResponse {}
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct DeleteConversationRequest {
98 #[prost(string, tag = "1")]
99 pub conversation_rid: ::prost::alloc::string::String,
100}
101#[derive(Clone, Copy, PartialEq, ::prost::Message)]
102pub struct DeleteConversationResponse {}
103#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct GetConversationRequest {
107 #[prost(string, tag = "1")]
108 pub conversation_rid: ::prost::alloc::string::String,
109 #[prost(string, optional, tag = "2")]
110 pub page_start_message_id: ::core::option::Option<::prost::alloc::string::String>,
111 #[prost(int32, optional, tag = "3")]
112 pub max_message_count: ::core::option::Option<i32>,
113}
114#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct ModelMessageWithId {
117 #[prost(string, tag = "3")]
118 pub message_id: ::prost::alloc::string::String,
119 #[prost(string, optional, tag = "4")]
121 pub snapshot_rid: ::core::option::Option<::prost::alloc::string::String>,
122 #[prost(oneof = "model_message_with_id::Content", tags = "1, 2")]
123 pub content: ::core::option::Option<model_message_with_id::Content>,
124}
125pub mod model_message_with_id {
127 #[derive(Clone, PartialEq, ::prost::Oneof)]
128 pub enum Content {
129 #[prost(message, tag = "1")]
130 Message(super::ModelMessage),
131 #[prost(message, tag = "2")]
132 ToolAction(super::ToolAction),
133 }
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct GetConversationResponse {
137 #[prost(message, repeated, tag = "1")]
138 pub ordered_messages: ::prost::alloc::vec::Vec<ModelMessageWithId>,
139 #[prost(message, optional, tag = "2")]
140 pub conversation_metadata: ::core::option::Option<ConversationMetadata>,
141}
142#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct ListConversationsRequest {
145 #[prost(string, tag = "1")]
146 pub workspace_rid: ::prost::alloc::string::String,
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct ConversationMetadata {
150 #[prost(string, tag = "1")]
151 pub conversation_rid: ::prost::alloc::string::String,
152 #[prost(string, tag = "2")]
153 pub title: ::prost::alloc::string::String,
154 #[prost(message, optional, tag = "3")]
155 pub created_at: ::core::option::Option<
156 super::super::super::google::protobuf::Timestamp,
157 >,
158 #[prost(message, optional, tag = "4")]
159 pub last_updated_at: ::core::option::Option<
160 super::super::super::google::protobuf::Timestamp,
161 >,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
166pub struct ListConversationsResponse {
167 #[prost(message, repeated, tag = "1")]
168 pub conversations: ::prost::alloc::vec::Vec<ConversationMetadata>,
169}
170#[derive(Clone, Copy, PartialEq, ::prost::Message)]
171pub struct TimeRange {
172 #[prost(message, optional, tag = "1")]
173 pub range_start: ::core::option::Option<Timestamp>,
174 #[prost(message, optional, tag = "2")]
175 pub range_end: ::core::option::Option<Timestamp>,
176}
177#[derive(Clone, Copy, PartialEq, ::prost::Message)]
178pub struct Timestamp {
179 #[prost(int32, tag = "1")]
180 pub seconds: i32,
181 #[prost(int32, tag = "2")]
182 pub nanoseconds: i32,
183}
184#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct ModelMessage {
188 #[prost(oneof = "model_message::Kind", tags = "1, 2")]
189 pub kind: ::core::option::Option<model_message::Kind>,
190}
191pub mod model_message {
193 #[derive(Clone, PartialEq, ::prost::Oneof)]
194 pub enum Kind {
195 #[prost(message, tag = "1")]
196 User(super::UserModelMessage),
197 #[prost(message, tag = "2")]
198 Assistant(super::AssistantModelMessage),
199 }
200}
201#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct UserModelMessage {
204 #[prost(message, repeated, tag = "1")]
205 pub text: ::prost::alloc::vec::Vec<UserContentPart>,
206}
207#[derive(Clone, PartialEq, ::prost::Message)]
209pub struct AssistantModelMessage {
210 #[prost(message, repeated, tag = "1")]
211 pub content_parts: ::prost::alloc::vec::Vec<AssistantContentPart>,
212}
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct UserContentPart {
215 #[prost(oneof = "user_content_part::Part", tags = "1")]
216 pub part: ::core::option::Option<user_content_part::Part>,
217}
218pub mod user_content_part {
220 #[derive(Clone, PartialEq, ::prost::Oneof)]
221 pub enum Part {
222 #[prost(message, tag = "1")]
223 Text(super::TextPart),
224 }
225}
226#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct AssistantContentPart {
229 #[prost(oneof = "assistant_content_part::Part", tags = "1, 2")]
230 pub part: ::core::option::Option<assistant_content_part::Part>,
231}
232pub mod assistant_content_part {
234 #[derive(Clone, PartialEq, ::prost::Oneof)]
235 pub enum Part {
236 #[prost(message, tag = "1")]
237 Text(super::TextPart),
238 #[prost(message, tag = "2")]
239 Reasoning(super::ReasoningPart),
240 }
241}
242#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct TextPart {
245 #[prost(string, tag = "1")]
246 pub text: ::prost::alloc::string::String,
247}
248#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct ImagePart {
251 #[prost(bytes = "vec", tag = "1")]
253 pub data: ::prost::alloc::vec::Vec<u8>,
254 #[prost(string, optional, tag = "2")]
256 pub media_type: ::core::option::Option<::prost::alloc::string::String>,
257 #[prost(string, optional, tag = "3")]
259 pub filename: ::core::option::Option<::prost::alloc::string::String>,
260}
261#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct ReasoningPart {
264 #[prost(string, tag = "1")]
265 pub reasoning: ::prost::alloc::string::String,
266}
267#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct StreamChatResponse {
270 #[prost(
271 oneof = "stream_chat_response::Response",
272 tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
273 )]
274 pub response: ::core::option::Option<stream_chat_response::Response>,
275}
276pub mod stream_chat_response {
278 #[derive(Clone, PartialEq, ::prost::Oneof)]
279 pub enum Response {
280 #[prost(message, tag = "1")]
281 Finish(super::Finish),
282 #[prost(message, tag = "2")]
283 Error(super::Error),
284 #[prost(message, tag = "3")]
285 TextStart(super::TextStart),
286 #[prost(message, tag = "4")]
287 TextDelta(super::TextDelta),
288 #[prost(message, tag = "5")]
289 TextEnd(super::TextEnd),
290 #[prost(message, tag = "6")]
291 ReasoningStart(super::ReasoningStart),
292 #[prost(message, tag = "7")]
293 ReasoningDelta(super::ReasoningDelta),
294 #[prost(message, tag = "8")]
295 ReasoningEnd(super::ReasoningEnd),
296 #[prost(message, tag = "9")]
298 WorkbookMutation(super::WorkbookMutation),
299 #[prost(message, tag = "10")]
300 ToolAction(super::ToolAction),
301 }
302}
303#[derive(Clone, PartialEq, ::prost::Message)]
305pub struct Finish {
306 #[prost(string, repeated, tag = "1")]
309 pub ordered_message_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
310 #[prost(string, optional, tag = "2")]
313 pub new_title: ::core::option::Option<::prost::alloc::string::String>,
314}
315#[derive(Clone, PartialEq, ::prost::Message)]
317pub struct Error {
318 #[prost(string, tag = "1")]
319 pub message: ::prost::alloc::string::String,
320}
321#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct TextStart {
324 #[prost(string, tag = "1")]
327 pub id: ::prost::alloc::string::String,
328}
329#[derive(Clone, PartialEq, ::prost::Message)]
331pub struct TextDelta {
332 #[prost(string, tag = "1")]
333 pub id: ::prost::alloc::string::String,
334 #[prost(string, tag = "2")]
336 pub delta: ::prost::alloc::string::String,
337}
338#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct TextEnd {
341 #[prost(string, tag = "1")]
342 pub id: ::prost::alloc::string::String,
343}
344#[derive(Clone, PartialEq, ::prost::Message)]
346pub struct ReasoningStart {
347 #[prost(string, tag = "1")]
348 pub id: ::prost::alloc::string::String,
349}
350#[derive(Clone, PartialEq, ::prost::Message)]
352pub struct ReasoningDelta {
353 #[prost(string, tag = "1")]
354 pub id: ::prost::alloc::string::String,
355 #[prost(string, tag = "2")]
357 pub delta: ::prost::alloc::string::String,
358}
359#[derive(Clone, PartialEq, ::prost::Message)]
361pub struct ReasoningEnd {
362 #[prost(string, tag = "1")]
363 pub id: ::prost::alloc::string::String,
364}
365#[derive(Clone, PartialEq, ::prost::Message)]
367pub struct AddTabMutation {
368 #[prost(string, optional, tag = "1")]
370 pub tab_name: ::core::option::Option<::prost::alloc::string::String>,
371}
372#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct AddOrUpdatePanelMutation {
375 #[prost(string, tag = "1")]
377 pub panel_as_json: ::prost::alloc::string::String,
378 #[prost(string, tag = "2")]
379 pub panel_id: ::prost::alloc::string::String,
380 #[prost(int32, tag = "3")]
381 pub tab_index: i32,
382}
383#[derive(Clone, PartialEq, ::prost::Message)]
384pub struct RemovePanelsMutation {
385 #[prost(string, repeated, tag = "1")]
386 pub panel_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
387}
388#[derive(Clone, PartialEq, ::prost::Message)]
390pub struct AddOrReplaceVariableMutation {
391 #[prost(string, tag = "1")]
395 pub compute_spec_as_json: ::prost::alloc::string::String,
396 #[prost(string, optional, tag = "2")]
398 pub variable_name: ::core::option::Option<::prost::alloc::string::String>,
399 #[prost(string, optional, tag = "3")]
400 pub display_name: ::core::option::Option<::prost::alloc::string::String>,
401}
402#[derive(Clone, PartialEq, ::prost::Message)]
404pub struct DeleteVariablesMutation {
405 #[prost(string, repeated, tag = "1")]
406 pub variable_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
407}
408#[derive(Clone, PartialEq, ::prost::Message)]
410pub struct WorkbookMutation {
411 #[prost(string, tag = "1")]
412 pub id: ::prost::alloc::string::String,
413 #[prost(oneof = "workbook_mutation::Mutation", tags = "2, 3, 4, 5, 6")]
414 pub mutation: ::core::option::Option<workbook_mutation::Mutation>,
415}
416pub mod workbook_mutation {
418 #[derive(Clone, PartialEq, ::prost::Oneof)]
419 pub enum Mutation {
420 #[prost(message, tag = "2")]
421 AddTab(super::AddTabMutation),
422 #[prost(message, tag = "3")]
423 AddOrUpdatePanel(super::AddOrUpdatePanelMutation),
424 #[prost(message, tag = "4")]
425 RemovePanels(super::RemovePanelsMutation),
426 #[prost(message, tag = "5")]
427 AddOrReplaceVariable(super::AddOrReplaceVariableMutation),
428 #[prost(message, tag = "6")]
429 DeleteVariables(super::DeleteVariablesMutation),
430 }
431}
432#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct ToolAction {
438 #[prost(string, tag = "1")]
439 pub id: ::prost::alloc::string::String,
440 #[prost(string, tag = "2")]
442 pub tool_action_verb: ::prost::alloc::string::String,
443 #[prost(string, optional, tag = "3")]
445 pub tool_target: ::core::option::Option<::prost::alloc::string::String>,
446}
447pub mod ai_agent_service_client {
449 #![allow(
450 unused_variables,
451 dead_code,
452 missing_docs,
453 clippy::wildcard_imports,
454 clippy::let_unit_value,
455 )]
456 use tonic::codegen::*;
457 use tonic::codegen::http::Uri;
458 #[derive(Debug, Clone)]
460 pub struct AiAgentServiceClient<T> {
461 inner: tonic::client::Grpc<T>,
462 }
463 impl AiAgentServiceClient<tonic::transport::Channel> {
464 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
466 where
467 D: TryInto<tonic::transport::Endpoint>,
468 D::Error: Into<StdError>,
469 {
470 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
471 Ok(Self::new(conn))
472 }
473 }
474 impl<T> AiAgentServiceClient<T>
475 where
476 T: tonic::client::GrpcService<tonic::body::Body>,
477 T::Error: Into<StdError>,
478 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
479 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
480 {
481 pub fn new(inner: T) -> Self {
482 let inner = tonic::client::Grpc::new(inner);
483 Self { inner }
484 }
485 pub fn with_origin(inner: T, origin: Uri) -> Self {
486 let inner = tonic::client::Grpc::with_origin(inner, origin);
487 Self { inner }
488 }
489 pub fn with_interceptor<F>(
490 inner: T,
491 interceptor: F,
492 ) -> AiAgentServiceClient<InterceptedService<T, F>>
493 where
494 F: tonic::service::Interceptor,
495 T::ResponseBody: Default,
496 T: tonic::codegen::Service<
497 http::Request<tonic::body::Body>,
498 Response = http::Response<
499 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
500 >,
501 >,
502 <T as tonic::codegen::Service<
503 http::Request<tonic::body::Body>,
504 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
505 {
506 AiAgentServiceClient::new(InterceptedService::new(inner, interceptor))
507 }
508 #[must_use]
513 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
514 self.inner = self.inner.send_compressed(encoding);
515 self
516 }
517 #[must_use]
519 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
520 self.inner = self.inner.accept_compressed(encoding);
521 self
522 }
523 #[must_use]
527 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
528 self.inner = self.inner.max_decoding_message_size(limit);
529 self
530 }
531 #[must_use]
535 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
536 self.inner = self.inner.max_encoding_message_size(limit);
537 self
538 }
539 pub async fn stream_chat(
541 &mut self,
542 request: impl tonic::IntoRequest<super::StreamChatRequest>,
543 ) -> std::result::Result<
544 tonic::Response<tonic::codec::Streaming<super::StreamChatResponse>>,
545 tonic::Status,
546 > {
547 self.inner
548 .ready()
549 .await
550 .map_err(|e| {
551 tonic::Status::unknown(
552 format!("Service was not ready: {}", e.into()),
553 )
554 })?;
555 let codec = tonic::codec::ProstCodec::default();
556 let path = http::uri::PathAndQuery::from_static(
557 "/nominal.ai.v1.AIAgentService/StreamChat",
558 );
559 let mut req = request.into_request();
560 req.extensions_mut()
561 .insert(GrpcMethod::new("nominal.ai.v1.AIAgentService", "StreamChat"));
562 self.inner.server_streaming(req, path, codec).await
563 }
564 pub async fn get_conversation(
566 &mut self,
567 request: impl tonic::IntoRequest<super::GetConversationRequest>,
568 ) -> std::result::Result<
569 tonic::Response<super::GetConversationResponse>,
570 tonic::Status,
571 > {
572 self.inner
573 .ready()
574 .await
575 .map_err(|e| {
576 tonic::Status::unknown(
577 format!("Service was not ready: {}", e.into()),
578 )
579 })?;
580 let codec = tonic::codec::ProstCodec::default();
581 let path = http::uri::PathAndQuery::from_static(
582 "/nominal.ai.v1.AIAgentService/GetConversation",
583 );
584 let mut req = request.into_request();
585 req.extensions_mut()
586 .insert(
587 GrpcMethod::new("nominal.ai.v1.AIAgentService", "GetConversation"),
588 );
589 self.inner.unary(req, path, codec).await
590 }
591 pub async fn list_conversations(
593 &mut self,
594 request: impl tonic::IntoRequest<super::ListConversationsRequest>,
595 ) -> std::result::Result<
596 tonic::Response<super::ListConversationsResponse>,
597 tonic::Status,
598 > {
599 self.inner
600 .ready()
601 .await
602 .map_err(|e| {
603 tonic::Status::unknown(
604 format!("Service was not ready: {}", e.into()),
605 )
606 })?;
607 let codec = tonic::codec::ProstCodec::default();
608 let path = http::uri::PathAndQuery::from_static(
609 "/nominal.ai.v1.AIAgentService/ListConversations",
610 );
611 let mut req = request.into_request();
612 req.extensions_mut()
613 .insert(
614 GrpcMethod::new("nominal.ai.v1.AIAgentService", "ListConversations"),
615 );
616 self.inner.unary(req, path, codec).await
617 }
618 pub async fn create_conversation(
620 &mut self,
621 request: impl tonic::IntoRequest<super::CreateConversationRequest>,
622 ) -> std::result::Result<
623 tonic::Response<super::CreateConversationResponse>,
624 tonic::Status,
625 > {
626 self.inner
627 .ready()
628 .await
629 .map_err(|e| {
630 tonic::Status::unknown(
631 format!("Service was not ready: {}", e.into()),
632 )
633 })?;
634 let codec = tonic::codec::ProstCodec::default();
635 let path = http::uri::PathAndQuery::from_static(
636 "/nominal.ai.v1.AIAgentService/CreateConversation",
637 );
638 let mut req = request.into_request();
639 req.extensions_mut()
640 .insert(
641 GrpcMethod::new("nominal.ai.v1.AIAgentService", "CreateConversation"),
642 );
643 self.inner.unary(req, path, codec).await
644 }
645 pub async fn update_conversation_metadata(
647 &mut self,
648 request: impl tonic::IntoRequest<super::UpdateConversationMetadataRequest>,
649 ) -> std::result::Result<
650 tonic::Response<super::UpdateConversationMetadataResponse>,
651 tonic::Status,
652 > {
653 self.inner
654 .ready()
655 .await
656 .map_err(|e| {
657 tonic::Status::unknown(
658 format!("Service was not ready: {}", e.into()),
659 )
660 })?;
661 let codec = tonic::codec::ProstCodec::default();
662 let path = http::uri::PathAndQuery::from_static(
663 "/nominal.ai.v1.AIAgentService/UpdateConversationMetadata",
664 );
665 let mut req = request.into_request();
666 req.extensions_mut()
667 .insert(
668 GrpcMethod::new(
669 "nominal.ai.v1.AIAgentService",
670 "UpdateConversationMetadata",
671 ),
672 );
673 self.inner.unary(req, path, codec).await
674 }
675 pub async fn delete_conversation(
677 &mut self,
678 request: impl tonic::IntoRequest<super::DeleteConversationRequest>,
679 ) -> std::result::Result<
680 tonic::Response<super::DeleteConversationResponse>,
681 tonic::Status,
682 > {
683 self.inner
684 .ready()
685 .await
686 .map_err(|e| {
687 tonic::Status::unknown(
688 format!("Service was not ready: {}", e.into()),
689 )
690 })?;
691 let codec = tonic::codec::ProstCodec::default();
692 let path = http::uri::PathAndQuery::from_static(
693 "/nominal.ai.v1.AIAgentService/DeleteConversation",
694 );
695 let mut req = request.into_request();
696 req.extensions_mut()
697 .insert(
698 GrpcMethod::new("nominal.ai.v1.AIAgentService", "DeleteConversation"),
699 );
700 self.inner.unary(req, path, codec).await
701 }
702 pub async fn get_snapshot_rid_by_user_message_id(
704 &mut self,
705 request: impl tonic::IntoRequest<super::GetSnapshotRidByUserMessageIdRequest>,
706 ) -> std::result::Result<
707 tonic::Response<super::GetSnapshotRidByUserMessageIdResponse>,
708 tonic::Status,
709 > {
710 self.inner
711 .ready()
712 .await
713 .map_err(|e| {
714 tonic::Status::unknown(
715 format!("Service was not ready: {}", e.into()),
716 )
717 })?;
718 let codec = tonic::codec::ProstCodec::default();
719 let path = http::uri::PathAndQuery::from_static(
720 "/nominal.ai.v1.AIAgentService/GetSnapshotRidByUserMessageId",
721 );
722 let mut req = request.into_request();
723 req.extensions_mut()
724 .insert(
725 GrpcMethod::new(
726 "nominal.ai.v1.AIAgentService",
727 "GetSnapshotRidByUserMessageId",
728 ),
729 );
730 self.inner.unary(req, path, codec).await
731 }
732 }
733}
734#[derive(Clone, Copy, PartialEq, ::prost::Message)]
735pub struct GetProviderStatusRequest {}
736#[derive(Clone, Copy, PartialEq, ::prost::Message)]
737pub struct GetProviderStatusResponse {
738 #[prost(message, optional, tag = "1")]
740 pub timestamp: ::core::option::Option<
741 super::super::super::google::protobuf::Timestamp,
742 >,
743 #[prost(message, optional, tag = "2")]
745 pub last_status: ::core::option::Option<ProviderStatus>,
746 #[deprecated]
749 #[prost(message, optional, tag = "3")]
750 pub aggregated_status_over_last_30m: ::core::option::Option<ProviderStatus>,
751 #[prost(message, optional, tag = "4")]
753 pub aggregated_status: ::core::option::Option<ProviderStatus>,
754}
755#[derive(Clone, Copy, PartialEq, ::prost::Message)]
756pub struct ProviderStatus {
757 #[prost(oneof = "provider_status::Status", tags = "1, 2")]
758 pub status: ::core::option::Option<provider_status::Status>,
759}
760pub mod provider_status {
762 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
763 pub enum Status {
764 #[prost(message, tag = "1")]
765 Healthy(super::Healthy),
766 #[prost(message, tag = "2")]
767 Degraded(super::Degraded),
768 }
769}
770#[derive(Clone, Copy, PartialEq, ::prost::Message)]
771pub struct Healthy {}
772#[derive(Clone, Copy, PartialEq, ::prost::Message)]
773pub struct Degraded {
774 #[prost(enumeration = "DegradationReason", tag = "1")]
775 pub reason: i32,
776}
777#[derive(Clone, Copy, PartialEq, ::prost::Message)]
778pub struct ProviderMetrics {
779 #[prost(int32, tag = "1")]
780 pub time_to_first_token_ms: i32,
781 #[prost(int32, tag = "2")]
782 pub total_time_ms: i32,
783}
784#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
785#[repr(i32)]
786pub enum DegradationReason {
787 Unspecified = 0,
788 HighLatency = 1,
789 Failures = 2,
790 HighLatencyAndFailures = 3,
791}
792impl DegradationReason {
793 pub fn as_str_name(&self) -> &'static str {
798 match self {
799 Self::Unspecified => "DEGRADATION_REASON_UNSPECIFIED",
800 Self::HighLatency => "DEGRADATION_REASON_HIGH_LATENCY",
801 Self::Failures => "DEGRADATION_REASON_FAILURES",
802 Self::HighLatencyAndFailures => {
803 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES"
804 }
805 }
806 }
807 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
809 match value {
810 "DEGRADATION_REASON_UNSPECIFIED" => Some(Self::Unspecified),
811 "DEGRADATION_REASON_HIGH_LATENCY" => Some(Self::HighLatency),
812 "DEGRADATION_REASON_FAILURES" => Some(Self::Failures),
813 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES" => {
814 Some(Self::HighLatencyAndFailures)
815 }
816 _ => None,
817 }
818 }
819}
820pub mod model_provider_health_service_client {
822 #![allow(
823 unused_variables,
824 dead_code,
825 missing_docs,
826 clippy::wildcard_imports,
827 clippy::let_unit_value,
828 )]
829 use tonic::codegen::*;
830 use tonic::codegen::http::Uri;
831 #[derive(Debug, Clone)]
835 pub struct ModelProviderHealthServiceClient<T> {
836 inner: tonic::client::Grpc<T>,
837 }
838 impl ModelProviderHealthServiceClient<tonic::transport::Channel> {
839 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
841 where
842 D: TryInto<tonic::transport::Endpoint>,
843 D::Error: Into<StdError>,
844 {
845 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
846 Ok(Self::new(conn))
847 }
848 }
849 impl<T> ModelProviderHealthServiceClient<T>
850 where
851 T: tonic::client::GrpcService<tonic::body::Body>,
852 T::Error: Into<StdError>,
853 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
854 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
855 {
856 pub fn new(inner: T) -> Self {
857 let inner = tonic::client::Grpc::new(inner);
858 Self { inner }
859 }
860 pub fn with_origin(inner: T, origin: Uri) -> Self {
861 let inner = tonic::client::Grpc::with_origin(inner, origin);
862 Self { inner }
863 }
864 pub fn with_interceptor<F>(
865 inner: T,
866 interceptor: F,
867 ) -> ModelProviderHealthServiceClient<InterceptedService<T, F>>
868 where
869 F: tonic::service::Interceptor,
870 T::ResponseBody: Default,
871 T: tonic::codegen::Service<
872 http::Request<tonic::body::Body>,
873 Response = http::Response<
874 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
875 >,
876 >,
877 <T as tonic::codegen::Service<
878 http::Request<tonic::body::Body>,
879 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
880 {
881 ModelProviderHealthServiceClient::new(
882 InterceptedService::new(inner, interceptor),
883 )
884 }
885 #[must_use]
890 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
891 self.inner = self.inner.send_compressed(encoding);
892 self
893 }
894 #[must_use]
896 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
897 self.inner = self.inner.accept_compressed(encoding);
898 self
899 }
900 #[must_use]
904 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
905 self.inner = self.inner.max_decoding_message_size(limit);
906 self
907 }
908 #[must_use]
912 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
913 self.inner = self.inner.max_encoding_message_size(limit);
914 self
915 }
916 pub async fn get_provider_status(
920 &mut self,
921 request: impl tonic::IntoRequest<super::GetProviderStatusRequest>,
922 ) -> std::result::Result<
923 tonic::Response<super::GetProviderStatusResponse>,
924 tonic::Status,
925 > {
926 self.inner
927 .ready()
928 .await
929 .map_err(|e| {
930 tonic::Status::unknown(
931 format!("Service was not ready: {}", e.into()),
932 )
933 })?;
934 let codec = tonic::codec::ProstCodec::default();
935 let path = http::uri::PathAndQuery::from_static(
936 "/nominal.ai.v1.ModelProviderHealthService/GetProviderStatus",
937 );
938 let mut req = request.into_request();
939 req.extensions_mut()
940 .insert(
941 GrpcMethod::new(
942 "nominal.ai.v1.ModelProviderHealthService",
943 "GetProviderStatus",
944 ),
945 );
946 self.inner.unary(req, path, codec).await
947 }
948 }
949}
950#[derive(Clone, PartialEq, ::prost::Message)]
953pub struct CreateOrUpdateKnowledgeBaseRequest {
954 #[prost(string, tag = "1")]
955 pub attachment_rid: ::prost::alloc::string::String,
956 #[prost(string, tag = "2")]
958 pub summary_description: ::prost::alloc::string::String,
959 #[prost(enumeration = "KnowledgeBaseType", optional, tag = "3")]
960 pub r#type: ::core::option::Option<i32>,
961}
962#[derive(Clone, PartialEq, ::prost::Message)]
964pub struct CreateOrUpdateKnowledgeBaseResponse {
965 #[prost(string, tag = "1")]
966 pub knowledge_base_rid: ::prost::alloc::string::String,
967}
968#[derive(Clone, PartialEq, ::prost::Message)]
970pub struct KnowledgeBase {
971 #[prost(string, tag = "1")]
972 pub knowledge_base_rid: ::prost::alloc::string::String,
973 #[prost(string, tag = "2")]
974 pub attachment_rid: ::prost::alloc::string::String,
975 #[prost(string, tag = "3")]
976 pub workspace_rid: ::prost::alloc::string::String,
977 #[prost(string, tag = "4")]
978 pub summary_description: ::prost::alloc::string::String,
979 #[prost(enumeration = "KnowledgeBaseType", tag = "5")]
980 pub r#type: i32,
981 #[prost(int32, tag = "6")]
982 pub version: i32,
983}
984#[derive(Clone, PartialEq, ::prost::Message)]
985pub struct ListRequest {
986 #[prost(string, tag = "1")]
987 pub workspace_rid: ::prost::alloc::string::String,
988}
989#[derive(Clone, PartialEq, ::prost::Message)]
990pub struct ListResponse {
991 #[prost(message, repeated, tag = "1")]
992 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
993}
994#[derive(Clone, PartialEq, ::prost::Message)]
995pub struct DeleteRequest {
996 #[prost(string, tag = "1")]
997 pub knowledge_base_rid: ::prost::alloc::string::String,
998}
999#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1000pub struct DeleteResponse {
1001 #[prost(bool, tag = "1")]
1002 pub success: bool,
1003}
1004#[derive(Clone, PartialEq, ::prost::Message)]
1005pub struct GetBatchRequest {
1006 #[prost(string, repeated, tag = "1")]
1007 pub knowledge_base_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1008}
1009#[derive(Clone, PartialEq, ::prost::Message)]
1010pub struct GetBatchResponse {
1011 #[prost(message, repeated, tag = "1")]
1012 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
1013}
1014#[derive(Clone, PartialEq, ::prost::Message)]
1017pub struct GenerateSummaryDescriptionRequest {
1018 #[prost(string, tag = "1")]
1019 pub attachment_rid: ::prost::alloc::string::String,
1020}
1021#[derive(Clone, PartialEq, ::prost::Message)]
1022pub struct GenerateSummaryDescriptionResponse {
1023 #[prost(string, tag = "1")]
1024 pub summary_description: ::prost::alloc::string::String,
1025}
1026#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1028#[repr(i32)]
1029pub enum KnowledgeBaseType {
1030 Unspecified = 0,
1032 Prompt = 1,
1034 Embedding = 2,
1036}
1037impl KnowledgeBaseType {
1038 pub fn as_str_name(&self) -> &'static str {
1043 match self {
1044 Self::Unspecified => "KNOWLEDGE_BASE_TYPE_UNSPECIFIED",
1045 Self::Prompt => "KNOWLEDGE_BASE_TYPE_PROMPT",
1046 Self::Embedding => "KNOWLEDGE_BASE_TYPE_EMBEDDING",
1047 }
1048 }
1049 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1051 match value {
1052 "KNOWLEDGE_BASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1053 "KNOWLEDGE_BASE_TYPE_PROMPT" => Some(Self::Prompt),
1054 "KNOWLEDGE_BASE_TYPE_EMBEDDING" => Some(Self::Embedding),
1055 _ => None,
1056 }
1057 }
1058}
1059pub mod knowledge_base_service_client {
1061 #![allow(
1062 unused_variables,
1063 dead_code,
1064 missing_docs,
1065 clippy::wildcard_imports,
1066 clippy::let_unit_value,
1067 )]
1068 use tonic::codegen::*;
1069 use tonic::codegen::http::Uri;
1070 #[derive(Debug, Clone)]
1072 pub struct KnowledgeBaseServiceClient<T> {
1073 inner: tonic::client::Grpc<T>,
1074 }
1075 impl KnowledgeBaseServiceClient<tonic::transport::Channel> {
1076 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1078 where
1079 D: TryInto<tonic::transport::Endpoint>,
1080 D::Error: Into<StdError>,
1081 {
1082 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1083 Ok(Self::new(conn))
1084 }
1085 }
1086 impl<T> KnowledgeBaseServiceClient<T>
1087 where
1088 T: tonic::client::GrpcService<tonic::body::Body>,
1089 T::Error: Into<StdError>,
1090 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1091 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1092 {
1093 pub fn new(inner: T) -> Self {
1094 let inner = tonic::client::Grpc::new(inner);
1095 Self { inner }
1096 }
1097 pub fn with_origin(inner: T, origin: Uri) -> Self {
1098 let inner = tonic::client::Grpc::with_origin(inner, origin);
1099 Self { inner }
1100 }
1101 pub fn with_interceptor<F>(
1102 inner: T,
1103 interceptor: F,
1104 ) -> KnowledgeBaseServiceClient<InterceptedService<T, F>>
1105 where
1106 F: tonic::service::Interceptor,
1107 T::ResponseBody: Default,
1108 T: tonic::codegen::Service<
1109 http::Request<tonic::body::Body>,
1110 Response = http::Response<
1111 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1112 >,
1113 >,
1114 <T as tonic::codegen::Service<
1115 http::Request<tonic::body::Body>,
1116 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1117 {
1118 KnowledgeBaseServiceClient::new(InterceptedService::new(inner, interceptor))
1119 }
1120 #[must_use]
1125 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1126 self.inner = self.inner.send_compressed(encoding);
1127 self
1128 }
1129 #[must_use]
1131 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1132 self.inner = self.inner.accept_compressed(encoding);
1133 self
1134 }
1135 #[must_use]
1139 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1140 self.inner = self.inner.max_decoding_message_size(limit);
1141 self
1142 }
1143 #[must_use]
1147 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1148 self.inner = self.inner.max_encoding_message_size(limit);
1149 self
1150 }
1151 pub async fn create_or_update_knowledge_base(
1153 &mut self,
1154 request: impl tonic::IntoRequest<super::CreateOrUpdateKnowledgeBaseRequest>,
1155 ) -> std::result::Result<
1156 tonic::Response<super::CreateOrUpdateKnowledgeBaseResponse>,
1157 tonic::Status,
1158 > {
1159 self.inner
1160 .ready()
1161 .await
1162 .map_err(|e| {
1163 tonic::Status::unknown(
1164 format!("Service was not ready: {}", e.into()),
1165 )
1166 })?;
1167 let codec = tonic::codec::ProstCodec::default();
1168 let path = http::uri::PathAndQuery::from_static(
1169 "/nominal.ai.v1.KnowledgeBaseService/CreateOrUpdateKnowledgeBase",
1170 );
1171 let mut req = request.into_request();
1172 req.extensions_mut()
1173 .insert(
1174 GrpcMethod::new(
1175 "nominal.ai.v1.KnowledgeBaseService",
1176 "CreateOrUpdateKnowledgeBase",
1177 ),
1178 );
1179 self.inner.unary(req, path, codec).await
1180 }
1181 pub async fn list(
1183 &mut self,
1184 request: impl tonic::IntoRequest<super::ListRequest>,
1185 ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
1186 self.inner
1187 .ready()
1188 .await
1189 .map_err(|e| {
1190 tonic::Status::unknown(
1191 format!("Service was not ready: {}", e.into()),
1192 )
1193 })?;
1194 let codec = tonic::codec::ProstCodec::default();
1195 let path = http::uri::PathAndQuery::from_static(
1196 "/nominal.ai.v1.KnowledgeBaseService/List",
1197 );
1198 let mut req = request.into_request();
1199 req.extensions_mut()
1200 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "List"));
1201 self.inner.unary(req, path, codec).await
1202 }
1203 pub async fn delete(
1205 &mut self,
1206 request: impl tonic::IntoRequest<super::DeleteRequest>,
1207 ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
1208 self.inner
1209 .ready()
1210 .await
1211 .map_err(|e| {
1212 tonic::Status::unknown(
1213 format!("Service was not ready: {}", e.into()),
1214 )
1215 })?;
1216 let codec = tonic::codec::ProstCodec::default();
1217 let path = http::uri::PathAndQuery::from_static(
1218 "/nominal.ai.v1.KnowledgeBaseService/Delete",
1219 );
1220 let mut req = request.into_request();
1221 req.extensions_mut()
1222 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "Delete"));
1223 self.inner.unary(req, path, codec).await
1224 }
1225 pub async fn get_batch(
1227 &mut self,
1228 request: impl tonic::IntoRequest<super::GetBatchRequest>,
1229 ) -> std::result::Result<
1230 tonic::Response<super::GetBatchResponse>,
1231 tonic::Status,
1232 > {
1233 self.inner
1234 .ready()
1235 .await
1236 .map_err(|e| {
1237 tonic::Status::unknown(
1238 format!("Service was not ready: {}", e.into()),
1239 )
1240 })?;
1241 let codec = tonic::codec::ProstCodec::default();
1242 let path = http::uri::PathAndQuery::from_static(
1243 "/nominal.ai.v1.KnowledgeBaseService/GetBatch",
1244 );
1245 let mut req = request.into_request();
1246 req.extensions_mut()
1247 .insert(
1248 GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "GetBatch"),
1249 );
1250 self.inner.unary(req, path, codec).await
1251 }
1252 pub async fn generate_summary_description(
1254 &mut self,
1255 request: impl tonic::IntoRequest<super::GenerateSummaryDescriptionRequest>,
1256 ) -> std::result::Result<
1257 tonic::Response<super::GenerateSummaryDescriptionResponse>,
1258 tonic::Status,
1259 > {
1260 self.inner
1261 .ready()
1262 .await
1263 .map_err(|e| {
1264 tonic::Status::unknown(
1265 format!("Service was not ready: {}", e.into()),
1266 )
1267 })?;
1268 let codec = tonic::codec::ProstCodec::default();
1269 let path = http::uri::PathAndQuery::from_static(
1270 "/nominal.ai.v1.KnowledgeBaseService/GenerateSummaryDescription",
1271 );
1272 let mut req = request.into_request();
1273 req.extensions_mut()
1274 .insert(
1275 GrpcMethod::new(
1276 "nominal.ai.v1.KnowledgeBaseService",
1277 "GenerateSummaryDescription",
1278 ),
1279 );
1280 self.inner.unary(req, path, codec).await
1281 }
1282 }
1283}