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