nominal_api/proto/
nominal.ai.v1.rs

1// This file is @generated by prost-build.
2/// StreamChatRequest is a request to stream chat messages for workbook AI agent
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct StreamChatRequest {
5    #[prost(message, repeated, tag = "1")]
6    pub messages: ::prost::alloc::vec::Vec<ModelMessage>,
7    /// JSON-serialized representation of INotebook
8    #[prost(string, optional, tag = "2")]
9    pub notebook_as_json: ::core::option::Option<::prost::alloc::string::String>,
10    /// The current tab visible in the workbook from the user's perspective
11    #[prost(int32, optional, tag = "3")]
12    pub selected_tab_index: ::core::option::Option<i32>,
13    /// Optional: image files to provide to the agent
14    #[prost(message, repeated, tag = "4")]
15    pub images: ::prost::alloc::vec::Vec<ImagePart>,
16    /// Time range for the tab that is currently visible to the user
17    #[prost(message, optional, tag = "5")]
18    pub range: ::core::option::Option<TimeRange>,
19}
20#[derive(Clone, Copy, PartialEq, ::prost::Message)]
21pub struct TimeRange {
22    #[prost(message, optional, tag = "1")]
23    pub range_start: ::core::option::Option<Timestamp>,
24    #[prost(message, optional, tag = "2")]
25    pub range_end: ::core::option::Option<Timestamp>,
26}
27#[derive(Clone, Copy, PartialEq, ::prost::Message)]
28pub struct Timestamp {
29    #[prost(int32, tag = "1")]
30    pub seconds: i32,
31    #[prost(int32, tag = "2")]
32    pub nanoseconds: i32,
33}
34/// ModelMessage is a discriminated union of system, user, assistant, and tool messages.
35/// Each message type has its own structure and content.
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ModelMessage {
38    #[prost(oneof = "model_message::Kind", tags = "1, 2")]
39    pub kind: ::core::option::Option<model_message::Kind>,
40}
41/// Nested message and enum types in `ModelMessage`.
42pub mod model_message {
43    #[derive(Clone, PartialEq, ::prost::Oneof)]
44    pub enum Kind {
45        #[prost(message, tag = "1")]
46        User(super::UserModelMessage),
47        #[prost(message, tag = "2")]
48        Assistant(super::AssistantModelMessage),
49    }
50}
51/// A user message containing text
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct UserModelMessage {
54    #[prost(message, repeated, tag = "1")]
55    pub text: ::prost::alloc::vec::Vec<UserContentPart>,
56}
57/// An assistant message containing text
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct AssistantModelMessage {
60    #[prost(message, repeated, tag = "1")]
61    pub content_parts: ::prost::alloc::vec::Vec<AssistantContentPart>,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct UserContentPart {
65    #[prost(oneof = "user_content_part::Part", tags = "1")]
66    pub part: ::core::option::Option<user_content_part::Part>,
67}
68/// Nested message and enum types in `UserContentPart`.
69pub mod user_content_part {
70    #[derive(Clone, PartialEq, ::prost::Oneof)]
71    pub enum Part {
72        #[prost(message, tag = "1")]
73        Text(super::TextPart),
74    }
75}
76/// Content part for assistant messages: can be text, reasoning, or mutation.
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct AssistantContentPart {
79    #[prost(oneof = "assistant_content_part::Part", tags = "1, 2")]
80    pub part: ::core::option::Option<assistant_content_part::Part>,
81}
82/// Nested message and enum types in `AssistantContentPart`.
83pub mod assistant_content_part {
84    #[derive(Clone, PartialEq, ::prost::Oneof)]
85    pub enum Part {
86        #[prost(message, tag = "1")]
87        Text(super::TextPart),
88        #[prost(message, tag = "2")]
89        Reasoning(super::ReasoningPart),
90    }
91}
92/// Text part for user or assistant messages.
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct TextPart {
95    #[prost(string, tag = "1")]
96    pub text: ::prost::alloc::string::String,
97}
98/// User-supplied image part.
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct ImagePart {
101    /// The base64-encoded image data
102    #[prost(bytes = "vec", tag = "1")]
103    pub data: ::prost::alloc::vec::Vec<u8>,
104    /// The media type of the image (e.g. "image/png", "image/jpeg")
105    #[prost(string, optional, tag = "2")]
106    pub media_type: ::core::option::Option<::prost::alloc::string::String>,
107    /// Optional: the filename of the image
108    #[prost(string, optional, tag = "3")]
109    pub filename: ::core::option::Option<::prost::alloc::string::String>,
110}
111/// Reasoning part for assistant messages.
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct ReasoningPart {
114    #[prost(string, tag = "1")]
115    pub reasoning: ::prost::alloc::string::String,
116}
117/// StreamChatResponse is a discriminated union response to a StreamChatRequest
118#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct StreamChatResponse {
120    #[prost(
121        oneof = "stream_chat_response::Response",
122        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
123    )]
124    pub response: ::core::option::Option<stream_chat_response::Response>,
125}
126/// Nested message and enum types in `StreamChatResponse`.
127pub mod stream_chat_response {
128    #[derive(Clone, PartialEq, ::prost::Oneof)]
129    pub enum Response {
130        #[prost(message, tag = "1")]
131        Finish(super::Finish),
132        #[prost(message, tag = "2")]
133        Error(super::Error),
134        #[prost(message, tag = "3")]
135        TextStart(super::TextStart),
136        #[prost(message, tag = "4")]
137        TextDelta(super::TextDelta),
138        #[prost(message, tag = "5")]
139        TextEnd(super::TextEnd),
140        #[prost(message, tag = "6")]
141        ReasoningStart(super::ReasoningStart),
142        #[prost(message, tag = "7")]
143        ReasoningDelta(super::ReasoningDelta),
144        #[prost(message, tag = "8")]
145        ReasoningEnd(super::ReasoningEnd),
146        #[prost(message, tag = "9")]
147        WorkbookMutation(super::WorkbookMutation),
148        #[prost(message, tag = "10")]
149        ToolAction(super::ToolAction),
150    }
151}
152/// Indicates the end of a chat session
153#[derive(Clone, Copy, PartialEq, ::prost::Message)]
154pub struct Finish {}
155/// An error that occurred during the chat session
156#[derive(Clone, PartialEq, ::prost::Message)]
157pub struct Error {
158    #[prost(string, tag = "1")]
159    pub message: ::prost::alloc::string::String,
160}
161/// Indicates the start of a text message from the agent
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct TextStart {
164    /// uniquely identifies the text message (e.g. uuid) so that the client can
165    /// merge parallel message streams (if it happens).
166    #[prost(string, tag = "1")]
167    pub id: ::prost::alloc::string::String,
168}
169/// A delta (continuation) of a text message from the agent
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct TextDelta {
172    #[prost(string, tag = "1")]
173    pub id: ::prost::alloc::string::String,
174    /// The next chunk of text
175    #[prost(string, tag = "2")]
176    pub delta: ::prost::alloc::string::String,
177}
178/// Indicates the end of a text message from the agent
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct TextEnd {
181    #[prost(string, tag = "1")]
182    pub id: ::prost::alloc::string::String,
183}
184/// Indicates the start of a reasoning message from the agent
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct ReasoningStart {
187    #[prost(string, tag = "1")]
188    pub id: ::prost::alloc::string::String,
189}
190/// A delta (continuation) of a reasoning message from the agent
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct ReasoningDelta {
193    #[prost(string, tag = "1")]
194    pub id: ::prost::alloc::string::String,
195    /// The next chunk of reasoning
196    #[prost(string, tag = "2")]
197    pub delta: ::prost::alloc::string::String,
198}
199/// Indicates the end of a reasoning message from the agent
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct ReasoningEnd {
202    #[prost(string, tag = "1")]
203    pub id: ::prost::alloc::string::String,
204}
205/// Add a new tab to the workbook
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct AddTabMutation {
208    /// if tab_name is not provided, we'll name it "New Tab"
209    #[prost(string, optional, tag = "1")]
210    pub tab_name: ::core::option::Option<::prost::alloc::string::String>,
211}
212/// this is the "result" of the mutation
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct AddOrUpdatePanelMutation {
215    /// JSON-serialized representation of IVizDefinition
216    #[prost(string, tag = "1")]
217    pub panel_as_json: ::prost::alloc::string::String,
218    #[prost(string, tag = "2")]
219    pub panel_id: ::prost::alloc::string::String,
220    #[prost(int32, tag = "3")]
221    pub tab_index: i32,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct RemovePanelsMutation {
225    #[prost(string, repeated, tag = "1")]
226    pub panel_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
227}
228/// AddOrReplaceVariableMutation is a mutation to add or replace a variable in the workbook
229#[derive(Clone, PartialEq, ::prost::Message)]
230pub struct AddOrReplaceVariableMutation {
231    /// scout_compute_api_ComputeSpecWithContext (this needs to be resolved)
232    /// be careful: this uses the scout_compute_api version of ComputeSpecWithContext, which stores the spec as "seriesNode"
233    /// and is NOT the same as ComputeSpecWithContext that is stored in INotebook.
234    #[prost(string, tag = "1")]
235    pub compute_spec_as_json: ::prost::alloc::string::String,
236    /// if variable_name is not provided, we'll assume it's a new variable and auto-generate a unique name
237    #[prost(string, optional, tag = "2")]
238    pub variable_name: ::core::option::Option<::prost::alloc::string::String>,
239    #[prost(string, optional, tag = "3")]
240    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
241}
242/// DeleteVariablesMutation is a mutation to delete variables from the workbook
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct DeleteVariablesMutation {
245    #[prost(string, repeated, tag = "1")]
246    pub variable_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
247}
248/// WorkbookMutation is a mutation to the workbook
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct WorkbookMutation {
251    #[prost(string, tag = "1")]
252    pub id: ::prost::alloc::string::String,
253    #[prost(oneof = "workbook_mutation::Mutation", tags = "2, 3, 4, 5, 6")]
254    pub mutation: ::core::option::Option<workbook_mutation::Mutation>,
255}
256/// Nested message and enum types in `WorkbookMutation`.
257pub mod workbook_mutation {
258    #[derive(Clone, PartialEq, ::prost::Oneof)]
259    pub enum Mutation {
260        #[prost(message, tag = "2")]
261        AddTab(super::AddTabMutation),
262        #[prost(message, tag = "3")]
263        AddOrUpdatePanel(super::AddOrUpdatePanelMutation),
264        #[prost(message, tag = "4")]
265        RemovePanels(super::RemovePanelsMutation),
266        #[prost(message, tag = "5")]
267        AddOrReplaceVariable(super::AddOrReplaceVariableMutation),
268        #[prost(message, tag = "6")]
269        DeleteVariables(super::DeleteVariablesMutation),
270    }
271}
272/// this is a concise descirption of a tool call that the agent is making internally
273/// without revealing too much detail about the tool call, it informs the user what the agent is doing
274/// at a high level. the format is: `{tool_action_verb} {tool_target}` for example:
275/// "Search channels for My Datasource"
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct ToolAction {
278    #[prost(string, tag = "1")]
279    pub id: ::prost::alloc::string::String,
280    /// "Thought", "Read", "Find", "Look-up", etc.
281    #[prost(string, tag = "2")]
282    pub tool_action_verb: ::prost::alloc::string::String,
283    /// "workbook", "channel", "variable", "panel", etc.
284    #[prost(string, optional, tag = "3")]
285    pub tool_target: ::core::option::Option<::prost::alloc::string::String>,
286}
287/// Generated client implementations.
288pub mod workbook_agent_service_client {
289    #![allow(
290        unused_variables,
291        dead_code,
292        missing_docs,
293        clippy::wildcard_imports,
294        clippy::let_unit_value,
295    )]
296    use tonic::codegen::*;
297    use tonic::codegen::http::Uri;
298    /// WorkbookAgentService provides AI-powered assistance for workbook operations
299    #[derive(Debug, Clone)]
300    pub struct WorkbookAgentServiceClient<T> {
301        inner: tonic::client::Grpc<T>,
302    }
303    impl WorkbookAgentServiceClient<tonic::transport::Channel> {
304        /// Attempt to create a new client by connecting to a given endpoint.
305        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
306        where
307            D: TryInto<tonic::transport::Endpoint>,
308            D::Error: Into<StdError>,
309        {
310            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
311            Ok(Self::new(conn))
312        }
313    }
314    impl<T> WorkbookAgentServiceClient<T>
315    where
316        T: tonic::client::GrpcService<tonic::body::Body>,
317        T::Error: Into<StdError>,
318        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
319        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
320    {
321        pub fn new(inner: T) -> Self {
322            let inner = tonic::client::Grpc::new(inner);
323            Self { inner }
324        }
325        pub fn with_origin(inner: T, origin: Uri) -> Self {
326            let inner = tonic::client::Grpc::with_origin(inner, origin);
327            Self { inner }
328        }
329        pub fn with_interceptor<F>(
330            inner: T,
331            interceptor: F,
332        ) -> WorkbookAgentServiceClient<InterceptedService<T, F>>
333        where
334            F: tonic::service::Interceptor,
335            T::ResponseBody: Default,
336            T: tonic::codegen::Service<
337                http::Request<tonic::body::Body>,
338                Response = http::Response<
339                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
340                >,
341            >,
342            <T as tonic::codegen::Service<
343                http::Request<tonic::body::Body>,
344            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
345        {
346            WorkbookAgentServiceClient::new(InterceptedService::new(inner, interceptor))
347        }
348        /// Compress requests with the given encoding.
349        ///
350        /// This requires the server to support it otherwise it might respond with an
351        /// error.
352        #[must_use]
353        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
354            self.inner = self.inner.send_compressed(encoding);
355            self
356        }
357        /// Enable decompressing responses.
358        #[must_use]
359        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
360            self.inner = self.inner.accept_compressed(encoding);
361            self
362        }
363        /// Limits the maximum size of a decoded message.
364        ///
365        /// Default: `4MB`
366        #[must_use]
367        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
368            self.inner = self.inner.max_decoding_message_size(limit);
369            self
370        }
371        /// Limits the maximum size of an encoded message.
372        ///
373        /// Default: `usize::MAX`
374        #[must_use]
375        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
376            self.inner = self.inner.max_encoding_message_size(limit);
377            self
378        }
379        /// StreamChat handles bidirectional streaming chat for workbook AI agent
380        pub async fn stream_chat(
381            &mut self,
382            request: impl tonic::IntoRequest<super::StreamChatRequest>,
383        ) -> std::result::Result<
384            tonic::Response<tonic::codec::Streaming<super::StreamChatResponse>>,
385            tonic::Status,
386        > {
387            self.inner
388                .ready()
389                .await
390                .map_err(|e| {
391                    tonic::Status::unknown(
392                        format!("Service was not ready: {}", e.into()),
393                    )
394                })?;
395            let codec = tonic::codec::ProstCodec::default();
396            let path = http::uri::PathAndQuery::from_static(
397                "/nominal.ai.v1.WorkbookAgentService/StreamChat",
398            );
399            let mut req = request.into_request();
400            req.extensions_mut()
401                .insert(
402                    GrpcMethod::new("nominal.ai.v1.WorkbookAgentService", "StreamChat"),
403                );
404            self.inner.server_streaming(req, path, codec).await
405        }
406    }
407}
408#[derive(Clone, Copy, PartialEq, ::prost::Message)]
409pub struct IsAiEnabledForUserRequest {}
410#[derive(Clone, Copy, PartialEq, ::prost::Message)]
411pub struct IsAiEnabledForUserResponse {
412    #[prost(bool, tag = "1")]
413    pub is_enabled: bool,
414}
415/// Generated client implementations.
416pub mod ai_features_service_client {
417    #![allow(
418        unused_variables,
419        dead_code,
420        missing_docs,
421        clippy::wildcard_imports,
422        clippy::let_unit_value,
423    )]
424    use tonic::codegen::*;
425    use tonic::codegen::http::Uri;
426    /// AIFeaturesService provides information about enabled AI features
427    #[derive(Debug, Clone)]
428    pub struct AiFeaturesServiceClient<T> {
429        inner: tonic::client::Grpc<T>,
430    }
431    impl AiFeaturesServiceClient<tonic::transport::Channel> {
432        /// Attempt to create a new client by connecting to a given endpoint.
433        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
434        where
435            D: TryInto<tonic::transport::Endpoint>,
436            D::Error: Into<StdError>,
437        {
438            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
439            Ok(Self::new(conn))
440        }
441    }
442    impl<T> AiFeaturesServiceClient<T>
443    where
444        T: tonic::client::GrpcService<tonic::body::Body>,
445        T::Error: Into<StdError>,
446        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
447        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
448    {
449        pub fn new(inner: T) -> Self {
450            let inner = tonic::client::Grpc::new(inner);
451            Self { inner }
452        }
453        pub fn with_origin(inner: T, origin: Uri) -> Self {
454            let inner = tonic::client::Grpc::with_origin(inner, origin);
455            Self { inner }
456        }
457        pub fn with_interceptor<F>(
458            inner: T,
459            interceptor: F,
460        ) -> AiFeaturesServiceClient<InterceptedService<T, F>>
461        where
462            F: tonic::service::Interceptor,
463            T::ResponseBody: Default,
464            T: tonic::codegen::Service<
465                http::Request<tonic::body::Body>,
466                Response = http::Response<
467                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
468                >,
469            >,
470            <T as tonic::codegen::Service<
471                http::Request<tonic::body::Body>,
472            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
473        {
474            AiFeaturesServiceClient::new(InterceptedService::new(inner, interceptor))
475        }
476        /// Compress requests with the given encoding.
477        ///
478        /// This requires the server to support it otherwise it might respond with an
479        /// error.
480        #[must_use]
481        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
482            self.inner = self.inner.send_compressed(encoding);
483            self
484        }
485        /// Enable decompressing responses.
486        #[must_use]
487        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
488            self.inner = self.inner.accept_compressed(encoding);
489            self
490        }
491        /// Limits the maximum size of a decoded message.
492        ///
493        /// Default: `4MB`
494        #[must_use]
495        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
496            self.inner = self.inner.max_decoding_message_size(limit);
497            self
498        }
499        /// Limits the maximum size of an encoded message.
500        ///
501        /// Default: `usize::MAX`
502        #[must_use]
503        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
504            self.inner = self.inner.max_encoding_message_size(limit);
505            self
506        }
507        /// IsAIEnabledForUser can be used to check if AI is enabled for a specific user
508        pub async fn is_ai_enabled_for_user(
509            &mut self,
510            request: impl tonic::IntoRequest<super::IsAiEnabledForUserRequest>,
511        ) -> std::result::Result<
512            tonic::Response<super::IsAiEnabledForUserResponse>,
513            tonic::Status,
514        > {
515            self.inner
516                .ready()
517                .await
518                .map_err(|e| {
519                    tonic::Status::unknown(
520                        format!("Service was not ready: {}", e.into()),
521                    )
522                })?;
523            let codec = tonic::codec::ProstCodec::default();
524            let path = http::uri::PathAndQuery::from_static(
525                "/nominal.ai.v1.AIFeaturesService/IsAIEnabledForUser",
526            );
527            let mut req = request.into_request();
528            req.extensions_mut()
529                .insert(
530                    GrpcMethod::new(
531                        "nominal.ai.v1.AIFeaturesService",
532                        "IsAIEnabledForUser",
533                    ),
534                );
535            self.inner.unary(req, path, codec).await
536        }
537    }
538}
539/// CreateOrUpdateKnowledgeBaseRequest is a request to create a knowledge from an attachment in the attachment's
540/// workspace. Subsequent calls for the same attachment will overwrite the existing knowledge base.
541#[derive(Clone, PartialEq, ::prost::Message)]
542pub struct CreateOrUpdateKnowledgeBaseRequest {
543    #[prost(string, tag = "1")]
544    pub attachment_rid: ::prost::alloc::string::String,
545    /// summary of the knowledge base, will be used by the LLM to decide when to use it
546    #[prost(string, tag = "2")]
547    pub summary_description: ::prost::alloc::string::String,
548    #[prost(enumeration = "KnowledgeBaseType", optional, tag = "3")]
549    pub r#type: ::core::option::Option<i32>,
550}
551/// CreateOrUpdateKnowledgeBaseResponse is the response to creating/updating a knowledge base
552#[derive(Clone, PartialEq, ::prost::Message)]
553pub struct CreateOrUpdateKnowledgeBaseResponse {
554    #[prost(string, tag = "1")]
555    pub knowledge_base_rid: ::prost::alloc::string::String,
556}
557/// KnowledgeBase represents a knowledge base entry
558#[derive(Clone, PartialEq, ::prost::Message)]
559pub struct KnowledgeBase {
560    #[prost(string, tag = "1")]
561    pub knowledge_base_rid: ::prost::alloc::string::String,
562    #[prost(string, tag = "2")]
563    pub attachment_rid: ::prost::alloc::string::String,
564    #[prost(string, tag = "3")]
565    pub workspace_rid: ::prost::alloc::string::String,
566    #[prost(string, tag = "4")]
567    pub summary_description: ::prost::alloc::string::String,
568    #[prost(enumeration = "KnowledgeBaseType", tag = "5")]
569    pub r#type: i32,
570    #[prost(int32, tag = "6")]
571    pub version: i32,
572}
573#[derive(Clone, PartialEq, ::prost::Message)]
574pub struct ListRequest {
575    #[prost(string, tag = "1")]
576    pub workspace_rid: ::prost::alloc::string::String,
577}
578#[derive(Clone, PartialEq, ::prost::Message)]
579pub struct ListResponse {
580    #[prost(message, repeated, tag = "1")]
581    pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
582}
583#[derive(Clone, PartialEq, ::prost::Message)]
584pub struct DeleteRequest {
585    #[prost(string, tag = "1")]
586    pub knowledge_base_rid: ::prost::alloc::string::String,
587}
588#[derive(Clone, Copy, PartialEq, ::prost::Message)]
589pub struct DeleteResponse {
590    #[prost(bool, tag = "1")]
591    pub success: bool,
592}
593#[derive(Clone, PartialEq, ::prost::Message)]
594pub struct GetBatchRequest {
595    #[prost(string, repeated, tag = "1")]
596    pub knowledge_base_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
597}
598#[derive(Clone, PartialEq, ::prost::Message)]
599pub struct GetBatchResponse {
600    #[prost(message, repeated, tag = "1")]
601    pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
602}
603/// generate summary description is intentionally going to return the generated description to the frontend
604/// rather than storing it in the knowledge base directly because the description needs to be accepted by the user
605#[derive(Clone, PartialEq, ::prost::Message)]
606pub struct GenerateSummaryDescriptionRequest {
607    #[prost(string, tag = "1")]
608    pub attachment_rid: ::prost::alloc::string::String,
609}
610#[derive(Clone, PartialEq, ::prost::Message)]
611pub struct GenerateSummaryDescriptionResponse {
612    #[prost(string, tag = "1")]
613    pub summary_description: ::prost::alloc::string::String,
614}
615/// KnowledgeBaseType defines the types of knowledge base
616#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
617#[repr(i32)]
618pub enum KnowledgeBaseType {
619    /// defaults to PROMPT
620    Unspecified = 0,
621    /// knowledge base gets added directly to prompt (needs to be small enough!)
622    Prompt = 1,
623    /// knowledge base gets used via vector search on embeddings
624    Embedding = 2,
625}
626impl KnowledgeBaseType {
627    /// String value of the enum field names used in the ProtoBuf definition.
628    ///
629    /// The values are not transformed in any way and thus are considered stable
630    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
631    pub fn as_str_name(&self) -> &'static str {
632        match self {
633            Self::Unspecified => "KNOWLEDGE_BASE_TYPE_UNSPECIFIED",
634            Self::Prompt => "KNOWLEDGE_BASE_TYPE_PROMPT",
635            Self::Embedding => "KNOWLEDGE_BASE_TYPE_EMBEDDING",
636        }
637    }
638    /// Creates an enum from field names used in the ProtoBuf definition.
639    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
640        match value {
641            "KNOWLEDGE_BASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
642            "KNOWLEDGE_BASE_TYPE_PROMPT" => Some(Self::Prompt),
643            "KNOWLEDGE_BASE_TYPE_EMBEDDING" => Some(Self::Embedding),
644            _ => None,
645        }
646    }
647}
648/// Generated client implementations.
649pub mod knowledge_base_service_client {
650    #![allow(
651        unused_variables,
652        dead_code,
653        missing_docs,
654        clippy::wildcard_imports,
655        clippy::let_unit_value,
656    )]
657    use tonic::codegen::*;
658    use tonic::codegen::http::Uri;
659    /// KnowledgeBaseService provides AI-powered knowledge base management
660    #[derive(Debug, Clone)]
661    pub struct KnowledgeBaseServiceClient<T> {
662        inner: tonic::client::Grpc<T>,
663    }
664    impl KnowledgeBaseServiceClient<tonic::transport::Channel> {
665        /// Attempt to create a new client by connecting to a given endpoint.
666        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
667        where
668            D: TryInto<tonic::transport::Endpoint>,
669            D::Error: Into<StdError>,
670        {
671            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
672            Ok(Self::new(conn))
673        }
674    }
675    impl<T> KnowledgeBaseServiceClient<T>
676    where
677        T: tonic::client::GrpcService<tonic::body::Body>,
678        T::Error: Into<StdError>,
679        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
680        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
681    {
682        pub fn new(inner: T) -> Self {
683            let inner = tonic::client::Grpc::new(inner);
684            Self { inner }
685        }
686        pub fn with_origin(inner: T, origin: Uri) -> Self {
687            let inner = tonic::client::Grpc::with_origin(inner, origin);
688            Self { inner }
689        }
690        pub fn with_interceptor<F>(
691            inner: T,
692            interceptor: F,
693        ) -> KnowledgeBaseServiceClient<InterceptedService<T, F>>
694        where
695            F: tonic::service::Interceptor,
696            T::ResponseBody: Default,
697            T: tonic::codegen::Service<
698                http::Request<tonic::body::Body>,
699                Response = http::Response<
700                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
701                >,
702            >,
703            <T as tonic::codegen::Service<
704                http::Request<tonic::body::Body>,
705            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
706        {
707            KnowledgeBaseServiceClient::new(InterceptedService::new(inner, interceptor))
708        }
709        /// Compress requests with the given encoding.
710        ///
711        /// This requires the server to support it otherwise it might respond with an
712        /// error.
713        #[must_use]
714        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
715            self.inner = self.inner.send_compressed(encoding);
716            self
717        }
718        /// Enable decompressing responses.
719        #[must_use]
720        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
721            self.inner = self.inner.accept_compressed(encoding);
722            self
723        }
724        /// Limits the maximum size of a decoded message.
725        ///
726        /// Default: `4MB`
727        #[must_use]
728        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
729            self.inner = self.inner.max_decoding_message_size(limit);
730            self
731        }
732        /// Limits the maximum size of an encoded message.
733        ///
734        /// Default: `usize::MAX`
735        #[must_use]
736        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
737            self.inner = self.inner.max_encoding_message_size(limit);
738            self
739        }
740        /// CreateOrUpdateKnowledgeBase creates a knowledge base in the workspace
741        pub async fn create_or_update_knowledge_base(
742            &mut self,
743            request: impl tonic::IntoRequest<super::CreateOrUpdateKnowledgeBaseRequest>,
744        ) -> std::result::Result<
745            tonic::Response<super::CreateOrUpdateKnowledgeBaseResponse>,
746            tonic::Status,
747        > {
748            self.inner
749                .ready()
750                .await
751                .map_err(|e| {
752                    tonic::Status::unknown(
753                        format!("Service was not ready: {}", e.into()),
754                    )
755                })?;
756            let codec = tonic::codec::ProstCodec::default();
757            let path = http::uri::PathAndQuery::from_static(
758                "/nominal.ai.v1.KnowledgeBaseService/CreateOrUpdateKnowledgeBase",
759            );
760            let mut req = request.into_request();
761            req.extensions_mut()
762                .insert(
763                    GrpcMethod::new(
764                        "nominal.ai.v1.KnowledgeBaseService",
765                        "CreateOrUpdateKnowledgeBase",
766                    ),
767                );
768            self.inner.unary(req, path, codec).await
769        }
770        /// List returns all knowledge bases in the specified workspace
771        pub async fn list(
772            &mut self,
773            request: impl tonic::IntoRequest<super::ListRequest>,
774        ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
775            self.inner
776                .ready()
777                .await
778                .map_err(|e| {
779                    tonic::Status::unknown(
780                        format!("Service was not ready: {}", e.into()),
781                    )
782                })?;
783            let codec = tonic::codec::ProstCodec::default();
784            let path = http::uri::PathAndQuery::from_static(
785                "/nominal.ai.v1.KnowledgeBaseService/List",
786            );
787            let mut req = request.into_request();
788            req.extensions_mut()
789                .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "List"));
790            self.inner.unary(req, path, codec).await
791        }
792        /// Delete removes a knowledge base by its RID
793        pub async fn delete(
794            &mut self,
795            request: impl tonic::IntoRequest<super::DeleteRequest>,
796        ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
797            self.inner
798                .ready()
799                .await
800                .map_err(|e| {
801                    tonic::Status::unknown(
802                        format!("Service was not ready: {}", e.into()),
803                    )
804                })?;
805            let codec = tonic::codec::ProstCodec::default();
806            let path = http::uri::PathAndQuery::from_static(
807                "/nominal.ai.v1.KnowledgeBaseService/Delete",
808            );
809            let mut req = request.into_request();
810            req.extensions_mut()
811                .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "Delete"));
812            self.inner.unary(req, path, codec).await
813        }
814        /// GetBatch retrieves multiple knowledge bases by their RIDs
815        pub async fn get_batch(
816            &mut self,
817            request: impl tonic::IntoRequest<super::GetBatchRequest>,
818        ) -> std::result::Result<
819            tonic::Response<super::GetBatchResponse>,
820            tonic::Status,
821        > {
822            self.inner
823                .ready()
824                .await
825                .map_err(|e| {
826                    tonic::Status::unknown(
827                        format!("Service was not ready: {}", e.into()),
828                    )
829                })?;
830            let codec = tonic::codec::ProstCodec::default();
831            let path = http::uri::PathAndQuery::from_static(
832                "/nominal.ai.v1.KnowledgeBaseService/GetBatch",
833            );
834            let mut req = request.into_request();
835            req.extensions_mut()
836                .insert(
837                    GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "GetBatch"),
838                );
839            self.inner.unary(req, path, codec).await
840        }
841        /// GenerateSummaryDescription generates a summary description for an attachment rid
842        pub async fn generate_summary_description(
843            &mut self,
844            request: impl tonic::IntoRequest<super::GenerateSummaryDescriptionRequest>,
845        ) -> std::result::Result<
846            tonic::Response<super::GenerateSummaryDescriptionResponse>,
847            tonic::Status,
848        > {
849            self.inner
850                .ready()
851                .await
852                .map_err(|e| {
853                    tonic::Status::unknown(
854                        format!("Service was not ready: {}", e.into()),
855                    )
856                })?;
857            let codec = tonic::codec::ProstCodec::default();
858            let path = http::uri::PathAndQuery::from_static(
859                "/nominal.ai.v1.KnowledgeBaseService/GenerateSummaryDescription",
860            );
861            let mut req = request.into_request();
862            req.extensions_mut()
863                .insert(
864                    GrpcMethod::new(
865                        "nominal.ai.v1.KnowledgeBaseService",
866                        "GenerateSummaryDescription",
867                    ),
868                );
869            self.inner.unary(req, path, codec).await
870        }
871    }
872}