1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct GetProviderStatusRequest {}
4#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5pub struct GetProviderStatusResponse {
6 #[prost(message, optional, tag = "1")]
8 pub timestamp: ::core::option::Option<
9 super::super::super::google::protobuf::Timestamp,
10 >,
11 #[prost(message, optional, tag = "2")]
13 pub last_status: ::core::option::Option<ProviderStatus>,
14 #[deprecated]
17 #[prost(message, optional, tag = "3")]
18 pub aggregated_status_over_last_30m: ::core::option::Option<ProviderStatus>,
19 #[prost(message, optional, tag = "4")]
21 pub aggregated_status: ::core::option::Option<ProviderStatus>,
22}
23#[derive(Clone, Copy, PartialEq, ::prost::Message)]
24pub struct ProviderStatus {
25 #[prost(oneof = "provider_status::Status", tags = "1, 2")]
26 pub status: ::core::option::Option<provider_status::Status>,
27}
28pub mod provider_status {
30 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
31 pub enum Status {
32 #[prost(message, tag = "1")]
33 Healthy(super::Healthy),
34 #[prost(message, tag = "2")]
35 Degraded(super::Degraded),
36 }
37}
38#[derive(Clone, Copy, PartialEq, ::prost::Message)]
39pub struct Healthy {}
40#[derive(Clone, Copy, PartialEq, ::prost::Message)]
41pub struct Degraded {
42 #[prost(enumeration = "DegradationReason", tag = "1")]
43 pub reason: i32,
44}
45#[derive(Clone, Copy, PartialEq, ::prost::Message)]
46pub struct ProviderMetrics {
47 #[prost(int32, tag = "1")]
48 pub time_to_first_token_ms: i32,
49 #[prost(int32, tag = "2")]
50 pub total_time_ms: i32,
51}
52#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
53#[repr(i32)]
54pub enum DegradationReason {
55 Unspecified = 0,
56 HighLatency = 1,
57 Failures = 2,
58 HighLatencyAndFailures = 3,
59}
60impl DegradationReason {
61 pub fn as_str_name(&self) -> &'static str {
66 match self {
67 Self::Unspecified => "DEGRADATION_REASON_UNSPECIFIED",
68 Self::HighLatency => "DEGRADATION_REASON_HIGH_LATENCY",
69 Self::Failures => "DEGRADATION_REASON_FAILURES",
70 Self::HighLatencyAndFailures => {
71 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES"
72 }
73 }
74 }
75 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
77 match value {
78 "DEGRADATION_REASON_UNSPECIFIED" => Some(Self::Unspecified),
79 "DEGRADATION_REASON_HIGH_LATENCY" => Some(Self::HighLatency),
80 "DEGRADATION_REASON_FAILURES" => Some(Self::Failures),
81 "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES" => {
82 Some(Self::HighLatencyAndFailures)
83 }
84 _ => None,
85 }
86 }
87}
88pub mod model_provider_health_service_client {
90 #![allow(
91 unused_variables,
92 dead_code,
93 missing_docs,
94 clippy::wildcard_imports,
95 clippy::let_unit_value,
96 )]
97 use tonic::codegen::*;
98 use tonic::codegen::http::Uri;
99 #[derive(Debug, Clone)]
103 pub struct ModelProviderHealthServiceClient<T> {
104 inner: tonic::client::Grpc<T>,
105 }
106 impl ModelProviderHealthServiceClient<tonic::transport::Channel> {
107 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
109 where
110 D: TryInto<tonic::transport::Endpoint>,
111 D::Error: Into<StdError>,
112 {
113 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
114 Ok(Self::new(conn))
115 }
116 }
117 impl<T> ModelProviderHealthServiceClient<T>
118 where
119 T: tonic::client::GrpcService<tonic::body::Body>,
120 T::Error: Into<StdError>,
121 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
122 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
123 {
124 pub fn new(inner: T) -> Self {
125 let inner = tonic::client::Grpc::new(inner);
126 Self { inner }
127 }
128 pub fn with_origin(inner: T, origin: Uri) -> Self {
129 let inner = tonic::client::Grpc::with_origin(inner, origin);
130 Self { inner }
131 }
132 pub fn with_interceptor<F>(
133 inner: T,
134 interceptor: F,
135 ) -> ModelProviderHealthServiceClient<InterceptedService<T, F>>
136 where
137 F: tonic::service::Interceptor,
138 T::ResponseBody: Default,
139 T: tonic::codegen::Service<
140 http::Request<tonic::body::Body>,
141 Response = http::Response<
142 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
143 >,
144 >,
145 <T as tonic::codegen::Service<
146 http::Request<tonic::body::Body>,
147 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
148 {
149 ModelProviderHealthServiceClient::new(
150 InterceptedService::new(inner, interceptor),
151 )
152 }
153 #[must_use]
158 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
159 self.inner = self.inner.send_compressed(encoding);
160 self
161 }
162 #[must_use]
164 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
165 self.inner = self.inner.accept_compressed(encoding);
166 self
167 }
168 #[must_use]
172 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
173 self.inner = self.inner.max_decoding_message_size(limit);
174 self
175 }
176 #[must_use]
180 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
181 self.inner = self.inner.max_encoding_message_size(limit);
182 self
183 }
184 pub async fn get_provider_status(
188 &mut self,
189 request: impl tonic::IntoRequest<super::GetProviderStatusRequest>,
190 ) -> std::result::Result<
191 tonic::Response<super::GetProviderStatusResponse>,
192 tonic::Status,
193 > {
194 self.inner
195 .ready()
196 .await
197 .map_err(|e| {
198 tonic::Status::unknown(
199 format!("Service was not ready: {}", e.into()),
200 )
201 })?;
202 let codec = tonic::codec::ProstCodec::default();
203 let path = http::uri::PathAndQuery::from_static(
204 "/nominal.ai.v1.ModelProviderHealthService/GetProviderStatus",
205 );
206 let mut req = request.into_request();
207 req.extensions_mut()
208 .insert(
209 GrpcMethod::new(
210 "nominal.ai.v1.ModelProviderHealthService",
211 "GetProviderStatus",
212 ),
213 );
214 self.inner.unary(req, path, codec).await
215 }
216 }
217}
218#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct CreateOrUpdateKnowledgeBaseRequest {
222 #[prost(string, tag = "1")]
223 pub attachment_rid: ::prost::alloc::string::String,
224 #[prost(string, tag = "2")]
226 pub summary_description: ::prost::alloc::string::String,
227 #[prost(enumeration = "KnowledgeBaseType", optional, tag = "3")]
228 pub r#type: ::core::option::Option<i32>,
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct CreateOrUpdateKnowledgeBaseResponse {
233 #[prost(string, tag = "1")]
234 pub knowledge_base_rid: ::prost::alloc::string::String,
235}
236#[derive(Clone, PartialEq, ::prost::Message)]
238pub struct KnowledgeBase {
239 #[prost(string, tag = "1")]
240 pub knowledge_base_rid: ::prost::alloc::string::String,
241 #[prost(string, tag = "2")]
242 pub attachment_rid: ::prost::alloc::string::String,
243 #[prost(string, tag = "3")]
244 pub workspace_rid: ::prost::alloc::string::String,
245 #[prost(string, tag = "4")]
246 pub summary_description: ::prost::alloc::string::String,
247 #[prost(enumeration = "KnowledgeBaseType", tag = "5")]
248 pub r#type: i32,
249 #[prost(int32, tag = "6")]
250 pub version: i32,
251}
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct ListRequest {
254 #[prost(string, tag = "1")]
255 pub workspace_rid: ::prost::alloc::string::String,
256}
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct ListResponse {
259 #[prost(message, repeated, tag = "1")]
260 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
261}
262#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct DeleteRequest {
264 #[prost(string, tag = "1")]
265 pub knowledge_base_rid: ::prost::alloc::string::String,
266}
267#[derive(Clone, Copy, PartialEq, ::prost::Message)]
268pub struct DeleteResponse {
269 #[prost(bool, tag = "1")]
270 pub success: bool,
271}
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct GetBatchRequest {
274 #[prost(string, repeated, tag = "1")]
275 pub knowledge_base_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
276}
277#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct GetBatchResponse {
279 #[prost(message, repeated, tag = "1")]
280 pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
281}
282#[derive(Clone, PartialEq, ::prost::Message)]
285pub struct GenerateSummaryDescriptionRequest {
286 #[prost(string, tag = "1")]
287 pub attachment_rid: ::prost::alloc::string::String,
288}
289#[derive(Clone, PartialEq, ::prost::Message)]
290pub struct GenerateSummaryDescriptionResponse {
291 #[prost(string, tag = "1")]
292 pub summary_description: ::prost::alloc::string::String,
293}
294#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
296#[repr(i32)]
297pub enum KnowledgeBaseType {
298 Unspecified = 0,
300 Prompt = 1,
302 Embedding = 2,
304}
305impl KnowledgeBaseType {
306 pub fn as_str_name(&self) -> &'static str {
311 match self {
312 Self::Unspecified => "KNOWLEDGE_BASE_TYPE_UNSPECIFIED",
313 Self::Prompt => "KNOWLEDGE_BASE_TYPE_PROMPT",
314 Self::Embedding => "KNOWLEDGE_BASE_TYPE_EMBEDDING",
315 }
316 }
317 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
319 match value {
320 "KNOWLEDGE_BASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
321 "KNOWLEDGE_BASE_TYPE_PROMPT" => Some(Self::Prompt),
322 "KNOWLEDGE_BASE_TYPE_EMBEDDING" => Some(Self::Embedding),
323 _ => None,
324 }
325 }
326}
327pub mod knowledge_base_service_client {
329 #![allow(
330 unused_variables,
331 dead_code,
332 missing_docs,
333 clippy::wildcard_imports,
334 clippy::let_unit_value,
335 )]
336 use tonic::codegen::*;
337 use tonic::codegen::http::Uri;
338 #[derive(Debug, Clone)]
340 pub struct KnowledgeBaseServiceClient<T> {
341 inner: tonic::client::Grpc<T>,
342 }
343 impl KnowledgeBaseServiceClient<tonic::transport::Channel> {
344 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
346 where
347 D: TryInto<tonic::transport::Endpoint>,
348 D::Error: Into<StdError>,
349 {
350 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
351 Ok(Self::new(conn))
352 }
353 }
354 impl<T> KnowledgeBaseServiceClient<T>
355 where
356 T: tonic::client::GrpcService<tonic::body::Body>,
357 T::Error: Into<StdError>,
358 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
359 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
360 {
361 pub fn new(inner: T) -> Self {
362 let inner = tonic::client::Grpc::new(inner);
363 Self { inner }
364 }
365 pub fn with_origin(inner: T, origin: Uri) -> Self {
366 let inner = tonic::client::Grpc::with_origin(inner, origin);
367 Self { inner }
368 }
369 pub fn with_interceptor<F>(
370 inner: T,
371 interceptor: F,
372 ) -> KnowledgeBaseServiceClient<InterceptedService<T, F>>
373 where
374 F: tonic::service::Interceptor,
375 T::ResponseBody: Default,
376 T: tonic::codegen::Service<
377 http::Request<tonic::body::Body>,
378 Response = http::Response<
379 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
380 >,
381 >,
382 <T as tonic::codegen::Service<
383 http::Request<tonic::body::Body>,
384 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
385 {
386 KnowledgeBaseServiceClient::new(InterceptedService::new(inner, interceptor))
387 }
388 #[must_use]
393 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
394 self.inner = self.inner.send_compressed(encoding);
395 self
396 }
397 #[must_use]
399 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
400 self.inner = self.inner.accept_compressed(encoding);
401 self
402 }
403 #[must_use]
407 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
408 self.inner = self.inner.max_decoding_message_size(limit);
409 self
410 }
411 #[must_use]
415 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
416 self.inner = self.inner.max_encoding_message_size(limit);
417 self
418 }
419 pub async fn create_or_update_knowledge_base(
421 &mut self,
422 request: impl tonic::IntoRequest<super::CreateOrUpdateKnowledgeBaseRequest>,
423 ) -> std::result::Result<
424 tonic::Response<super::CreateOrUpdateKnowledgeBaseResponse>,
425 tonic::Status,
426 > {
427 self.inner
428 .ready()
429 .await
430 .map_err(|e| {
431 tonic::Status::unknown(
432 format!("Service was not ready: {}", e.into()),
433 )
434 })?;
435 let codec = tonic::codec::ProstCodec::default();
436 let path = http::uri::PathAndQuery::from_static(
437 "/nominal.ai.v1.KnowledgeBaseService/CreateOrUpdateKnowledgeBase",
438 );
439 let mut req = request.into_request();
440 req.extensions_mut()
441 .insert(
442 GrpcMethod::new(
443 "nominal.ai.v1.KnowledgeBaseService",
444 "CreateOrUpdateKnowledgeBase",
445 ),
446 );
447 self.inner.unary(req, path, codec).await
448 }
449 pub async fn list(
451 &mut self,
452 request: impl tonic::IntoRequest<super::ListRequest>,
453 ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
454 self.inner
455 .ready()
456 .await
457 .map_err(|e| {
458 tonic::Status::unknown(
459 format!("Service was not ready: {}", e.into()),
460 )
461 })?;
462 let codec = tonic::codec::ProstCodec::default();
463 let path = http::uri::PathAndQuery::from_static(
464 "/nominal.ai.v1.KnowledgeBaseService/List",
465 );
466 let mut req = request.into_request();
467 req.extensions_mut()
468 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "List"));
469 self.inner.unary(req, path, codec).await
470 }
471 pub async fn delete(
473 &mut self,
474 request: impl tonic::IntoRequest<super::DeleteRequest>,
475 ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
476 self.inner
477 .ready()
478 .await
479 .map_err(|e| {
480 tonic::Status::unknown(
481 format!("Service was not ready: {}", e.into()),
482 )
483 })?;
484 let codec = tonic::codec::ProstCodec::default();
485 let path = http::uri::PathAndQuery::from_static(
486 "/nominal.ai.v1.KnowledgeBaseService/Delete",
487 );
488 let mut req = request.into_request();
489 req.extensions_mut()
490 .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "Delete"));
491 self.inner.unary(req, path, codec).await
492 }
493 pub async fn get_batch(
495 &mut self,
496 request: impl tonic::IntoRequest<super::GetBatchRequest>,
497 ) -> std::result::Result<
498 tonic::Response<super::GetBatchResponse>,
499 tonic::Status,
500 > {
501 self.inner
502 .ready()
503 .await
504 .map_err(|e| {
505 tonic::Status::unknown(
506 format!("Service was not ready: {}", e.into()),
507 )
508 })?;
509 let codec = tonic::codec::ProstCodec::default();
510 let path = http::uri::PathAndQuery::from_static(
511 "/nominal.ai.v1.KnowledgeBaseService/GetBatch",
512 );
513 let mut req = request.into_request();
514 req.extensions_mut()
515 .insert(
516 GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "GetBatch"),
517 );
518 self.inner.unary(req, path, codec).await
519 }
520 pub async fn generate_summary_description(
522 &mut self,
523 request: impl tonic::IntoRequest<super::GenerateSummaryDescriptionRequest>,
524 ) -> std::result::Result<
525 tonic::Response<super::GenerateSummaryDescriptionResponse>,
526 tonic::Status,
527 > {
528 self.inner
529 .ready()
530 .await
531 .map_err(|e| {
532 tonic::Status::unknown(
533 format!("Service was not ready: {}", e.into()),
534 )
535 })?;
536 let codec = tonic::codec::ProstCodec::default();
537 let path = http::uri::PathAndQuery::from_static(
538 "/nominal.ai.v1.KnowledgeBaseService/GenerateSummaryDescription",
539 );
540 let mut req = request.into_request();
541 req.extensions_mut()
542 .insert(
543 GrpcMethod::new(
544 "nominal.ai.v1.KnowledgeBaseService",
545 "GenerateSummaryDescription",
546 ),
547 );
548 self.inner.unary(req, path, codec).await
549 }
550 }
551}
552#[derive(Clone, PartialEq, ::prost::Message)]
553pub struct GetSnapshotRidByUserMessageIdRequest {
554 #[prost(string, tag = "1")]
555 pub conversation_rid: ::prost::alloc::string::String,
556 #[prost(string, tag = "2")]
557 pub message_id: ::prost::alloc::string::String,
558}
559#[derive(Clone, PartialEq, ::prost::Message)]
562pub struct GetSnapshotRidByUserMessageIdResponse {
563 #[prost(string, optional, tag = "1")]
564 pub snapshot_rid: ::core::option::Option<::prost::alloc::string::String>,
565}
566#[derive(Clone, Copy, PartialEq, ::prost::Message)]
568pub struct ReadOnlyMode {}
569#[derive(Clone, Copy, PartialEq, ::prost::Message)]
571pub struct EditMode {
572 #[prost(bool, optional, tag = "1")]
574 pub auto_accept: ::core::option::Option<bool>,
575}
576#[derive(Clone, Copy, PartialEq, ::prost::Message)]
578pub struct ConversationMode {
579 #[prost(oneof = "conversation_mode::Mode", tags = "1, 2")]
580 pub mode: ::core::option::Option<conversation_mode::Mode>,
581}
582pub mod conversation_mode {
584 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
585 pub enum Mode {
586 #[prost(message, tag = "1")]
587 ReadOnly(super::ReadOnlyMode),
588 #[prost(message, tag = "2")]
589 Edit(super::EditMode),
590 }
591}
592#[derive(Clone, PartialEq, ::prost::Message)]
595pub struct ToolApprovalResult {
596 #[prost(string, tag = "1")]
598 pub tool_call_id: ::prost::alloc::string::String,
599 #[prost(string, tag = "2")]
601 pub tool_call_message_id: ::prost::alloc::string::String,
602 #[prost(oneof = "tool_approval_result::Response", tags = "3, 4")]
603 pub response: ::core::option::Option<tool_approval_result::Response>,
604}
605pub mod tool_approval_result {
607 #[derive(Clone, PartialEq, ::prost::Oneof)]
608 pub enum Response {
609 #[prost(message, tag = "3")]
610 Approved(super::ToolApprovedResponse),
611 #[prost(message, tag = "4")]
612 Denied(super::ToolDeniedResponse),
613 }
614}
615#[derive(Clone, PartialEq, ::prost::Message)]
616pub struct ToolApprovedResponse {
617 #[prost(string, optional, tag = "1")]
620 pub override_args: ::core::option::Option<::prost::alloc::string::String>,
621}
622#[derive(Clone, PartialEq, ::prost::Message)]
623pub struct ToolDeniedResponse {
624 #[prost(string, tag = "2")]
625 pub denial_reason: ::prost::alloc::string::String,
626}
627#[derive(Clone, PartialEq, ::prost::Message)]
629pub struct StreamChatRequest {
630 #[prost(string, tag = "1")]
632 pub conversation_rid: ::prost::alloc::string::String,
633 #[prost(message, optional, tag = "2")]
635 pub message: ::core::option::Option<UserModelMessage>,
636 #[prost(message, repeated, tag = "3")]
638 pub images: ::prost::alloc::vec::Vec<ImagePart>,
639 #[prost(message, optional, tag = "6")]
641 pub tool_approval: ::core::option::Option<ToolApprovalResult>,
642 #[prost(oneof = "stream_chat_request::Context", tags = "4, 5")]
644 pub context: ::core::option::Option<stream_chat_request::Context>,
645}
646pub mod stream_chat_request {
648 #[derive(Clone, PartialEq, ::prost::Oneof)]
650 pub enum Context {
651 #[prost(message, tag = "4")]
652 Workbook(super::WorkbookContext),
653 #[prost(message, tag = "5")]
654 Global(super::GlobalContext),
655 }
656}
657#[derive(Clone, PartialEq, ::prost::Message)]
659pub struct WorkbookContext {
660 #[prost(string, tag = "1")]
662 pub workbook_rid: ::prost::alloc::string::String,
663 #[prost(message, optional, tag = "2")]
665 pub user_presence: ::core::option::Option<WorkbookUserPresence>,
666}
667#[derive(Clone, Copy, PartialEq, ::prost::Message)]
669pub struct GlobalContext {}
670#[derive(Clone, Copy, PartialEq, ::prost::Message)]
673pub struct WorkbookUserPresence {
674 #[prost(int32, tag = "1")]
675 pub tab_index: i32,
676 #[prost(message, optional, tag = "2")]
677 pub range: ::core::option::Option<TimeRange>,
678}
679#[derive(Clone, PartialEq, ::prost::Message)]
685pub struct CreateConversationRequest {
686 #[prost(string, tag = "1")]
687 pub title: ::prost::alloc::string::String,
688 #[prost(string, tag = "2")]
689 pub workspace_rid: ::prost::alloc::string::String,
690 #[prost(string, optional, tag = "3")]
691 pub old_conversation_rid: ::core::option::Option<::prost::alloc::string::String>,
692 #[prost(string, optional, tag = "4")]
693 pub previous_message_id: ::core::option::Option<::prost::alloc::string::String>,
694 #[prost(message, optional, tag = "5")]
695 pub conversation_mode: ::core::option::Option<ConversationMode>,
696}
697#[derive(Clone, PartialEq, ::prost::Message)]
699pub struct CreateConversationResponse {
700 #[prost(string, tag = "1")]
701 pub new_conversation_rid: ::prost::alloc::string::String,
702}
703#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct UpdateConversationMetadataRequest {
706 #[prost(string, optional, tag = "1")]
707 pub title: ::core::option::Option<::prost::alloc::string::String>,
708 #[prost(string, tag = "2")]
709 pub conversation_rid: ::prost::alloc::string::String,
710 #[prost(message, optional, tag = "3")]
711 pub conversation_mode: ::core::option::Option<ConversationMode>,
712}
713#[derive(Clone, Copy, PartialEq, ::prost::Message)]
714pub struct UpdateConversationMetadataResponse {}
715#[derive(Clone, PartialEq, ::prost::Message)]
716pub struct DeleteConversationRequest {
717 #[prost(string, tag = "1")]
718 pub conversation_rid: ::prost::alloc::string::String,
719}
720#[derive(Clone, Copy, PartialEq, ::prost::Message)]
721pub struct DeleteConversationResponse {}
722#[derive(Clone, PartialEq, ::prost::Message)]
725pub struct GetConversationRequest {
726 #[prost(string, tag = "1")]
727 pub conversation_rid: ::prost::alloc::string::String,
728 #[prost(string, optional, tag = "2")]
729 pub page_start_message_id: ::core::option::Option<::prost::alloc::string::String>,
730 #[prost(int32, optional, tag = "3")]
731 pub max_message_count: ::core::option::Option<i32>,
732}
733#[derive(Clone, PartialEq, ::prost::Message)]
735pub struct ModelMessageWithId {
736 #[prost(string, tag = "3")]
737 pub message_id: ::prost::alloc::string::String,
738 #[prost(string, optional, tag = "4")]
740 pub snapshot_rid: ::core::option::Option<::prost::alloc::string::String>,
741 #[prost(message, optional, tag = "5")]
742 pub tool_approval_request: ::core::option::Option<ToolCallDescription>,
743 #[prost(oneof = "model_message_with_id::Content", tags = "1, 2")]
744 pub content: ::core::option::Option<model_message_with_id::Content>,
745}
746pub mod model_message_with_id {
748 #[derive(Clone, PartialEq, ::prost::Oneof)]
749 pub enum Content {
750 #[prost(message, tag = "1")]
751 Message(super::ModelMessage),
752 #[prost(message, tag = "2")]
753 ToolAction(super::ToolAction),
754 }
755}
756#[derive(Clone, PartialEq, ::prost::Message)]
757pub struct GetConversationResponse {
758 #[prost(message, repeated, tag = "1")]
759 pub ordered_messages: ::prost::alloc::vec::Vec<ModelMessageWithId>,
760 #[prost(message, optional, tag = "2")]
761 pub conversation_metadata: ::core::option::Option<ConversationMetadata>,
762}
763#[derive(Clone, PartialEq, ::prost::Message)]
765pub struct ListConversationsRequest {
766 #[prost(string, tag = "1")]
767 pub workspace_rid: ::prost::alloc::string::String,
768 #[prost(string, optional, tag = "2")]
769 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
770 #[prost(int32, optional, tag = "3")]
771 pub page_size: ::core::option::Option<i32>,
772}
773#[derive(Clone, PartialEq, ::prost::Message)]
774pub struct ConversationMetadata {
775 #[prost(string, tag = "1")]
776 pub conversation_rid: ::prost::alloc::string::String,
777 #[prost(string, tag = "2")]
778 pub title: ::prost::alloc::string::String,
779 #[prost(message, optional, tag = "3")]
780 pub created_at: ::core::option::Option<
781 super::super::super::google::protobuf::Timestamp,
782 >,
783 #[prost(message, optional, tag = "4")]
784 pub last_updated_at: ::core::option::Option<
785 super::super::super::google::protobuf::Timestamp,
786 >,
787 #[prost(message, optional, tag = "5")]
788 pub mode: ::core::option::Option<ConversationMode>,
789}
790#[derive(Clone, PartialEq, ::prost::Message)]
793pub struct ListConversationsResponse {
794 #[prost(message, repeated, tag = "1")]
795 pub conversations: ::prost::alloc::vec::Vec<ConversationMetadata>,
796 #[prost(string, optional, tag = "2")]
797 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
798}
799#[derive(Clone, Copy, PartialEq, ::prost::Message)]
800pub struct TimeRange {
801 #[prost(message, optional, tag = "1")]
802 pub range_start: ::core::option::Option<Timestamp>,
803 #[prost(message, optional, tag = "2")]
804 pub range_end: ::core::option::Option<Timestamp>,
805}
806#[derive(Clone, Copy, PartialEq, ::prost::Message)]
807pub struct Timestamp {
808 #[prost(int32, tag = "1")]
809 pub seconds: i32,
810 #[prost(int32, tag = "2")]
811 pub nanoseconds: i32,
812}
813#[derive(Clone, PartialEq, ::prost::Message)]
816pub struct ModelMessage {
817 #[prost(oneof = "model_message::Kind", tags = "1, 2")]
818 pub kind: ::core::option::Option<model_message::Kind>,
819}
820pub mod model_message {
822 #[derive(Clone, PartialEq, ::prost::Oneof)]
823 pub enum Kind {
824 #[prost(message, tag = "1")]
825 User(super::UserModelMessage),
826 #[prost(message, tag = "2")]
827 Assistant(super::AssistantModelMessage),
828 }
829}
830#[derive(Clone, PartialEq, ::prost::Message)]
832pub struct UserModelMessage {
833 #[prost(message, repeated, tag = "1")]
834 pub text: ::prost::alloc::vec::Vec<UserContentPart>,
835}
836#[derive(Clone, PartialEq, ::prost::Message)]
838pub struct AssistantModelMessage {
839 #[prost(message, repeated, tag = "1")]
840 pub content_parts: ::prost::alloc::vec::Vec<AssistantContentPart>,
841}
842#[derive(Clone, PartialEq, ::prost::Message)]
843pub struct UserContentPart {
844 #[prost(oneof = "user_content_part::Part", tags = "1")]
845 pub part: ::core::option::Option<user_content_part::Part>,
846}
847pub mod user_content_part {
849 #[derive(Clone, PartialEq, ::prost::Oneof)]
850 pub enum Part {
851 #[prost(message, tag = "1")]
852 Text(super::TextPart),
853 }
854}
855#[derive(Clone, PartialEq, ::prost::Message)]
857pub struct AssistantContentPart {
858 #[prost(oneof = "assistant_content_part::Part", tags = "1, 2")]
859 pub part: ::core::option::Option<assistant_content_part::Part>,
860}
861pub mod assistant_content_part {
863 #[derive(Clone, PartialEq, ::prost::Oneof)]
864 pub enum Part {
865 #[prost(message, tag = "1")]
866 Text(super::TextPart),
867 #[prost(message, tag = "2")]
868 Reasoning(super::ReasoningPart),
869 }
870}
871#[derive(Clone, PartialEq, ::prost::Message)]
873pub struct TextPart {
874 #[prost(string, tag = "1")]
875 pub text: ::prost::alloc::string::String,
876}
877#[derive(Clone, PartialEq, ::prost::Message)]
879pub struct ImagePart {
880 #[prost(bytes = "vec", tag = "1")]
882 pub data: ::prost::alloc::vec::Vec<u8>,
883 #[prost(string, optional, tag = "2")]
885 pub media_type: ::core::option::Option<::prost::alloc::string::String>,
886 #[prost(string, optional, tag = "3")]
888 pub filename: ::core::option::Option<::prost::alloc::string::String>,
889}
890#[derive(Clone, PartialEq, ::prost::Message)]
892pub struct ReasoningPart {
893 #[prost(string, tag = "1")]
894 pub reasoning: ::prost::alloc::string::String,
895}
896#[derive(Clone, PartialEq, ::prost::Message)]
898pub struct StreamChatResponse {
899 #[prost(
900 oneof = "stream_chat_response::Response",
901 tags = "1, 2, 3, 4, 5, 6, 7, 8, 10"
902 )]
903 pub response: ::core::option::Option<stream_chat_response::Response>,
904}
905pub mod stream_chat_response {
907 #[derive(Clone, PartialEq, ::prost::Oneof)]
908 pub enum Response {
909 #[prost(message, tag = "1")]
910 Finish(super::Finish),
911 #[prost(message, tag = "2")]
912 Error(super::Error),
913 #[prost(message, tag = "3")]
914 TextStart(super::TextStart),
915 #[prost(message, tag = "4")]
916 TextDelta(super::TextDelta),
917 #[prost(message, tag = "5")]
918 TextEnd(super::TextEnd),
919 #[prost(message, tag = "6")]
920 ReasoningStart(super::ReasoningStart),
921 #[prost(message, tag = "7")]
922 ReasoningDelta(super::ReasoningDelta),
923 #[prost(message, tag = "8")]
924 ReasoningEnd(super::ReasoningEnd),
925 #[prost(message, tag = "10")]
926 ToolAction(super::ToolAction),
927 }
928}
929#[derive(Clone, PartialEq, ::prost::Message)]
930pub struct ToolCallDescription {
931 #[prost(string, tag = "1")]
932 pub tool_call_id: ::prost::alloc::string::String,
933 #[prost(string, tag = "2")]
934 pub tool_name: ::prost::alloc::string::String,
935 #[prost(string, tag = "3")]
937 pub tool_args_json_string: ::prost::alloc::string::String,
938 #[prost(enumeration = "ToolCallStatus", tag = "4")]
940 pub status: i32,
941}
942#[derive(Clone, PartialEq, ::prost::Message)]
944pub struct Finish {
945 #[prost(string, repeated, tag = "1")]
948 pub ordered_message_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
949 #[prost(string, optional, tag = "2")]
952 pub new_title: ::core::option::Option<::prost::alloc::string::String>,
953 #[prost(message, optional, tag = "3")]
956 pub tool_approval_request: ::core::option::Option<ToolCallDescription>,
957}
958#[derive(Clone, PartialEq, ::prost::Message)]
960pub struct Error {
961 #[prost(string, tag = "1")]
962 pub message: ::prost::alloc::string::String,
963}
964#[derive(Clone, PartialEq, ::prost::Message)]
966pub struct TextStart {
967 #[prost(string, tag = "1")]
970 pub id: ::prost::alloc::string::String,
971}
972#[derive(Clone, PartialEq, ::prost::Message)]
974pub struct TextDelta {
975 #[prost(string, tag = "1")]
976 pub id: ::prost::alloc::string::String,
977 #[prost(string, tag = "2")]
979 pub delta: ::prost::alloc::string::String,
980}
981#[derive(Clone, PartialEq, ::prost::Message)]
983pub struct TextEnd {
984 #[prost(string, tag = "1")]
985 pub id: ::prost::alloc::string::String,
986}
987#[derive(Clone, PartialEq, ::prost::Message)]
989pub struct ReasoningStart {
990 #[prost(string, tag = "1")]
991 pub id: ::prost::alloc::string::String,
992}
993#[derive(Clone, PartialEq, ::prost::Message)]
995pub struct ReasoningDelta {
996 #[prost(string, tag = "1")]
997 pub id: ::prost::alloc::string::String,
998 #[prost(string, tag = "2")]
1000 pub delta: ::prost::alloc::string::String,
1001}
1002#[derive(Clone, PartialEq, ::prost::Message)]
1004pub struct ReasoningEnd {
1005 #[prost(string, tag = "1")]
1006 pub id: ::prost::alloc::string::String,
1007}
1008#[derive(Clone, PartialEq, ::prost::Message)]
1013pub struct ToolAction {
1014 #[prost(string, tag = "1")]
1015 pub id: ::prost::alloc::string::String,
1016 #[prost(string, tag = "2")]
1018 pub tool_action_verb: ::prost::alloc::string::String,
1019 #[prost(string, optional, tag = "3")]
1021 pub tool_target: ::core::option::Option<::prost::alloc::string::String>,
1022}
1023#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1024#[repr(i32)]
1025pub enum ToolCallStatus {
1026 Unspecified = 0,
1027 Approved = 1,
1028 Denied = 2,
1029 AwaitingApproval = 3,
1030}
1031impl ToolCallStatus {
1032 pub fn as_str_name(&self) -> &'static str {
1037 match self {
1038 Self::Unspecified => "TOOL_CALL_STATUS_UNSPECIFIED",
1039 Self::Approved => "TOOL_CALL_STATUS_APPROVED",
1040 Self::Denied => "TOOL_CALL_STATUS_DENIED",
1041 Self::AwaitingApproval => "TOOL_CALL_STATUS_AWAITING_APPROVAL",
1042 }
1043 }
1044 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1046 match value {
1047 "TOOL_CALL_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
1048 "TOOL_CALL_STATUS_APPROVED" => Some(Self::Approved),
1049 "TOOL_CALL_STATUS_DENIED" => Some(Self::Denied),
1050 "TOOL_CALL_STATUS_AWAITING_APPROVAL" => Some(Self::AwaitingApproval),
1051 _ => None,
1052 }
1053 }
1054}
1055pub mod ai_agent_service_client {
1057 #![allow(
1058 unused_variables,
1059 dead_code,
1060 missing_docs,
1061 clippy::wildcard_imports,
1062 clippy::let_unit_value,
1063 )]
1064 use tonic::codegen::*;
1065 use tonic::codegen::http::Uri;
1066 #[derive(Debug, Clone)]
1068 pub struct AiAgentServiceClient<T> {
1069 inner: tonic::client::Grpc<T>,
1070 }
1071 impl AiAgentServiceClient<tonic::transport::Channel> {
1072 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1074 where
1075 D: TryInto<tonic::transport::Endpoint>,
1076 D::Error: Into<StdError>,
1077 {
1078 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1079 Ok(Self::new(conn))
1080 }
1081 }
1082 impl<T> AiAgentServiceClient<T>
1083 where
1084 T: tonic::client::GrpcService<tonic::body::Body>,
1085 T::Error: Into<StdError>,
1086 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1087 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1088 {
1089 pub fn new(inner: T) -> Self {
1090 let inner = tonic::client::Grpc::new(inner);
1091 Self { inner }
1092 }
1093 pub fn with_origin(inner: T, origin: Uri) -> Self {
1094 let inner = tonic::client::Grpc::with_origin(inner, origin);
1095 Self { inner }
1096 }
1097 pub fn with_interceptor<F>(
1098 inner: T,
1099 interceptor: F,
1100 ) -> AiAgentServiceClient<InterceptedService<T, F>>
1101 where
1102 F: tonic::service::Interceptor,
1103 T::ResponseBody: Default,
1104 T: tonic::codegen::Service<
1105 http::Request<tonic::body::Body>,
1106 Response = http::Response<
1107 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1108 >,
1109 >,
1110 <T as tonic::codegen::Service<
1111 http::Request<tonic::body::Body>,
1112 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1113 {
1114 AiAgentServiceClient::new(InterceptedService::new(inner, interceptor))
1115 }
1116 #[must_use]
1121 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1122 self.inner = self.inner.send_compressed(encoding);
1123 self
1124 }
1125 #[must_use]
1127 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1128 self.inner = self.inner.accept_compressed(encoding);
1129 self
1130 }
1131 #[must_use]
1135 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1136 self.inner = self.inner.max_decoding_message_size(limit);
1137 self
1138 }
1139 #[must_use]
1143 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1144 self.inner = self.inner.max_encoding_message_size(limit);
1145 self
1146 }
1147 pub async fn stream_chat(
1149 &mut self,
1150 request: impl tonic::IntoRequest<super::StreamChatRequest>,
1151 ) -> std::result::Result<
1152 tonic::Response<tonic::codec::Streaming<super::StreamChatResponse>>,
1153 tonic::Status,
1154 > {
1155 self.inner
1156 .ready()
1157 .await
1158 .map_err(|e| {
1159 tonic::Status::unknown(
1160 format!("Service was not ready: {}", e.into()),
1161 )
1162 })?;
1163 let codec = tonic::codec::ProstCodec::default();
1164 let path = http::uri::PathAndQuery::from_static(
1165 "/nominal.ai.v1.AIAgentService/StreamChat",
1166 );
1167 let mut req = request.into_request();
1168 req.extensions_mut()
1169 .insert(GrpcMethod::new("nominal.ai.v1.AIAgentService", "StreamChat"));
1170 self.inner.server_streaming(req, path, codec).await
1171 }
1172 pub async fn get_conversation(
1174 &mut self,
1175 request: impl tonic::IntoRequest<super::GetConversationRequest>,
1176 ) -> std::result::Result<
1177 tonic::Response<super::GetConversationResponse>,
1178 tonic::Status,
1179 > {
1180 self.inner
1181 .ready()
1182 .await
1183 .map_err(|e| {
1184 tonic::Status::unknown(
1185 format!("Service was not ready: {}", e.into()),
1186 )
1187 })?;
1188 let codec = tonic::codec::ProstCodec::default();
1189 let path = http::uri::PathAndQuery::from_static(
1190 "/nominal.ai.v1.AIAgentService/GetConversation",
1191 );
1192 let mut req = request.into_request();
1193 req.extensions_mut()
1194 .insert(
1195 GrpcMethod::new("nominal.ai.v1.AIAgentService", "GetConversation"),
1196 );
1197 self.inner.unary(req, path, codec).await
1198 }
1199 pub async fn list_conversations(
1201 &mut self,
1202 request: impl tonic::IntoRequest<super::ListConversationsRequest>,
1203 ) -> std::result::Result<
1204 tonic::Response<super::ListConversationsResponse>,
1205 tonic::Status,
1206 > {
1207 self.inner
1208 .ready()
1209 .await
1210 .map_err(|e| {
1211 tonic::Status::unknown(
1212 format!("Service was not ready: {}", e.into()),
1213 )
1214 })?;
1215 let codec = tonic::codec::ProstCodec::default();
1216 let path = http::uri::PathAndQuery::from_static(
1217 "/nominal.ai.v1.AIAgentService/ListConversations",
1218 );
1219 let mut req = request.into_request();
1220 req.extensions_mut()
1221 .insert(
1222 GrpcMethod::new("nominal.ai.v1.AIAgentService", "ListConversations"),
1223 );
1224 self.inner.unary(req, path, codec).await
1225 }
1226 pub async fn create_conversation(
1228 &mut self,
1229 request: impl tonic::IntoRequest<super::CreateConversationRequest>,
1230 ) -> std::result::Result<
1231 tonic::Response<super::CreateConversationResponse>,
1232 tonic::Status,
1233 > {
1234 self.inner
1235 .ready()
1236 .await
1237 .map_err(|e| {
1238 tonic::Status::unknown(
1239 format!("Service was not ready: {}", e.into()),
1240 )
1241 })?;
1242 let codec = tonic::codec::ProstCodec::default();
1243 let path = http::uri::PathAndQuery::from_static(
1244 "/nominal.ai.v1.AIAgentService/CreateConversation",
1245 );
1246 let mut req = request.into_request();
1247 req.extensions_mut()
1248 .insert(
1249 GrpcMethod::new("nominal.ai.v1.AIAgentService", "CreateConversation"),
1250 );
1251 self.inner.unary(req, path, codec).await
1252 }
1253 pub async fn update_conversation_metadata(
1255 &mut self,
1256 request: impl tonic::IntoRequest<super::UpdateConversationMetadataRequest>,
1257 ) -> std::result::Result<
1258 tonic::Response<super::UpdateConversationMetadataResponse>,
1259 tonic::Status,
1260 > {
1261 self.inner
1262 .ready()
1263 .await
1264 .map_err(|e| {
1265 tonic::Status::unknown(
1266 format!("Service was not ready: {}", e.into()),
1267 )
1268 })?;
1269 let codec = tonic::codec::ProstCodec::default();
1270 let path = http::uri::PathAndQuery::from_static(
1271 "/nominal.ai.v1.AIAgentService/UpdateConversationMetadata",
1272 );
1273 let mut req = request.into_request();
1274 req.extensions_mut()
1275 .insert(
1276 GrpcMethod::new(
1277 "nominal.ai.v1.AIAgentService",
1278 "UpdateConversationMetadata",
1279 ),
1280 );
1281 self.inner.unary(req, path, codec).await
1282 }
1283 pub async fn delete_conversation(
1285 &mut self,
1286 request: impl tonic::IntoRequest<super::DeleteConversationRequest>,
1287 ) -> std::result::Result<
1288 tonic::Response<super::DeleteConversationResponse>,
1289 tonic::Status,
1290 > {
1291 self.inner
1292 .ready()
1293 .await
1294 .map_err(|e| {
1295 tonic::Status::unknown(
1296 format!("Service was not ready: {}", e.into()),
1297 )
1298 })?;
1299 let codec = tonic::codec::ProstCodec::default();
1300 let path = http::uri::PathAndQuery::from_static(
1301 "/nominal.ai.v1.AIAgentService/DeleteConversation",
1302 );
1303 let mut req = request.into_request();
1304 req.extensions_mut()
1305 .insert(
1306 GrpcMethod::new("nominal.ai.v1.AIAgentService", "DeleteConversation"),
1307 );
1308 self.inner.unary(req, path, codec).await
1309 }
1310 pub async fn get_snapshot_rid_by_user_message_id(
1312 &mut self,
1313 request: impl tonic::IntoRequest<super::GetSnapshotRidByUserMessageIdRequest>,
1314 ) -> std::result::Result<
1315 tonic::Response<super::GetSnapshotRidByUserMessageIdResponse>,
1316 tonic::Status,
1317 > {
1318 self.inner
1319 .ready()
1320 .await
1321 .map_err(|e| {
1322 tonic::Status::unknown(
1323 format!("Service was not ready: {}", e.into()),
1324 )
1325 })?;
1326 let codec = tonic::codec::ProstCodec::default();
1327 let path = http::uri::PathAndQuery::from_static(
1328 "/nominal.ai.v1.AIAgentService/GetSnapshotRidByUserMessageId",
1329 );
1330 let mut req = request.into_request();
1331 req.extensions_mut()
1332 .insert(
1333 GrpcMethod::new(
1334 "nominal.ai.v1.AIAgentService",
1335 "GetSnapshotRidByUserMessageId",
1336 ),
1337 );
1338 self.inner.unary(req, path, codec).await
1339 }
1340 }
1341}