// This file is @generated by prost-build.
/// StreamChatRequest is a request to stream chat messages for AI agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamChatRequest {
    /// The conversation ID
    #[prost(string, tag = "1")]
    pub conversation_rid: ::prost::alloc::string::String,
    /// The user message to append to the conversation
    #[prost(message, optional, tag = "2")]
    pub message: ::core::option::Option<UserModelMessage>,
    /// Optional: image files to provide to the agent
    #[prost(message, repeated, tag = "3")]
    pub images: ::prost::alloc::vec::Vec<ImagePart>,
    /// Context-specific fields based on the oneofKind.
    #[prost(oneof = "stream_chat_request::Context", tags = "4, 5")]
    pub context: ::core::option::Option<stream_chat_request::Context>,
}
/// Nested message and enum types in `StreamChatRequest`.
pub mod stream_chat_request {
    /// Context-specific fields based on the oneofKind.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Context {
        #[prost(message, tag = "4")]
        Workbook(super::WorkbookContext),
        #[prost(message, tag = "5")]
        Global(super::GlobalContext),
    }
}
/// WorkbookContext contains workbook-specific context fields
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkbookContext {
    /// RID of the workbook to use for context
    #[prost(string, tag = "1")]
    pub workbook_rid: ::prost::alloc::string::String,
    /// Optional: the user's presence in the workbook
    #[prost(message, optional, tag = "2")]
    pub user_presence: ::core::option::Option<WorkbookUserPresence>,
}
/// DefaultContext (no context)
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GlobalContext {}
/// WorkbookUserPresence contains the user's presence in the workbook
/// which is used to describe what the user is viewing at the time of the message.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WorkbookUserPresence {
    #[prost(int32, optional, tag = "1")]
    pub tab_index: ::core::option::Option<i32>,
    #[prost(message, optional, tag = "2")]
    pub range: ::core::option::Option<TimeRange>,
}
/// CreateConversation request will create a new conversation thread
/// if old conversation id is not set, a brand new, clear chat is created
/// If old conversation id is set without a previous message id, the full conversation thread will be copied
/// if previous message id is set with a previous message id, the conversation thread up until that message will be copied
/// the above case is useful for branching a conversation into a new thread
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateConversationRequest {
    #[prost(string, tag = "1")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub old_conversation_rid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub previous_message_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// CreateConversationResponse will return the conversation id for the new conversation
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateConversationResponse {
    #[prost(string, tag = "1")]
    pub new_conversation_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateConversationMetadataRequest {
    #[prost(string, tag = "1")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub conversation_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateConversationMetadataResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteConversationRequest {
    #[prost(string, tag = "1")]
    pub conversation_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteConversationResponse {}
/// a GetConversationRequest allows you to retrieve a subset of messages from a conversation thread represented
/// by provided rid. To start from a particular message - you can also provide a message id.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetConversationRequest {
    #[prost(string, tag = "1")]
    pub conversation_rid: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub page_start_message_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(int32, optional, tag = "3")]
    pub max_message_count: ::core::option::Option<i32>,
}
/// Model message with id allows you to identify the message ID of a given message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelMessageWithId {
    #[prost(string, tag = "3")]
    pub message_id: ::prost::alloc::string::String,
    #[prost(oneof = "model_message_with_id::Content", tags = "1, 2")]
    pub content: ::core::option::Option<model_message_with_id::Content>,
}
/// Nested message and enum types in `ModelMessageWithId`.
pub mod model_message_with_id {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(message, tag = "1")]
        Message(super::ModelMessage),
        #[prost(message, tag = "2")]
        ToolAction(super::ToolAction),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetConversationResponse {
    #[prost(message, repeated, tag = "1")]
    pub ordered_messages: ::prost::alloc::vec::Vec<ModelMessageWithId>,
    #[prost(message, optional, tag = "2")]
    pub conversation_metadata: ::core::option::Option<ConversationMetadata>,
}
/// Will generate all conversation threads that this user has in this workspace
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListConversationsRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConversationMetadata {
    #[prost(string, tag = "1")]
    pub conversation_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub title: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub created_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "4")]
    pub last_updated_at: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
/// ListConversationsResponse is a list of conversations that can be used in a call to GetConversationRequest
/// to get a full conversation from storage. These are ordered by creation time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListConversationsResponse {
    #[prost(message, repeated, tag = "1")]
    pub conversations: ::prost::alloc::vec::Vec<ConversationMetadata>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TimeRange {
    #[prost(message, optional, tag = "1")]
    pub range_start: ::core::option::Option<Timestamp>,
    #[prost(message, optional, tag = "2")]
    pub range_end: ::core::option::Option<Timestamp>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Timestamp {
    #[prost(int32, tag = "1")]
    pub seconds: i32,
    #[prost(int32, tag = "2")]
    pub nanoseconds: i32,
}
/// ModelMessage is a discriminated union of system, user, assistant, and tool messages.
/// Each message type has its own structure and content.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelMessage {
    #[prost(oneof = "model_message::Kind", tags = "1, 2")]
    pub kind: ::core::option::Option<model_message::Kind>,
}
/// Nested message and enum types in `ModelMessage`.
pub mod model_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Kind {
        #[prost(message, tag = "1")]
        User(super::UserModelMessage),
        #[prost(message, tag = "2")]
        Assistant(super::AssistantModelMessage),
    }
}
/// A user message containing text
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserModelMessage {
    #[prost(message, repeated, tag = "1")]
    pub text: ::prost::alloc::vec::Vec<UserContentPart>,
}
/// An assistant message containing text
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssistantModelMessage {
    #[prost(message, repeated, tag = "1")]
    pub content_parts: ::prost::alloc::vec::Vec<AssistantContentPart>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserContentPart {
    #[prost(oneof = "user_content_part::Part", tags = "1")]
    pub part: ::core::option::Option<user_content_part::Part>,
}
/// Nested message and enum types in `UserContentPart`.
pub mod user_content_part {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Part {
        #[prost(message, tag = "1")]
        Text(super::TextPart),
    }
}
/// Content part for assistant messages: can be text, reasoning, or mutation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssistantContentPart {
    #[prost(oneof = "assistant_content_part::Part", tags = "1, 2")]
    pub part: ::core::option::Option<assistant_content_part::Part>,
}
/// Nested message and enum types in `AssistantContentPart`.
pub mod assistant_content_part {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Part {
        #[prost(message, tag = "1")]
        Text(super::TextPart),
        #[prost(message, tag = "2")]
        Reasoning(super::ReasoningPart),
    }
}
/// Text part for user or assistant messages.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextPart {
    #[prost(string, tag = "1")]
    pub text: ::prost::alloc::string::String,
}
/// User-supplied image part.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImagePart {
    /// The base64-encoded image data
    #[prost(bytes = "vec", tag = "1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// The media type of the image (e.g. "image/png", "image/jpeg")
    #[prost(string, optional, tag = "2")]
    pub media_type: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional: the filename of the image
    #[prost(string, optional, tag = "3")]
    pub filename: ::core::option::Option<::prost::alloc::string::String>,
}
/// Reasoning part for assistant messages.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasoningPart {
    #[prost(string, tag = "1")]
    pub reasoning: ::prost::alloc::string::String,
}
/// StreamChatResponse is a discriminated union response to a StreamChatRequest
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamChatResponse {
    #[prost(
        oneof = "stream_chat_response::Response",
        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
    )]
    pub response: ::core::option::Option<stream_chat_response::Response>,
}
/// Nested message and enum types in `StreamChatResponse`.
pub mod stream_chat_response {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Finish(super::Finish),
        #[prost(message, tag = "2")]
        Error(super::Error),
        #[prost(message, tag = "3")]
        TextStart(super::TextStart),
        #[prost(message, tag = "4")]
        TextDelta(super::TextDelta),
        #[prost(message, tag = "5")]
        TextEnd(super::TextEnd),
        #[prost(message, tag = "6")]
        ReasoningStart(super::ReasoningStart),
        #[prost(message, tag = "7")]
        ReasoningDelta(super::ReasoningDelta),
        #[prost(message, tag = "8")]
        ReasoningEnd(super::ReasoningEnd),
        /// this will be deprecated in favor of MCP-based mutations
        #[prost(message, tag = "9")]
        WorkbookMutation(super::WorkbookMutation),
        #[prost(message, tag = "10")]
        ToolAction(super::ToolAction),
    }
}
/// Indicates the end of a chat session
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Finish {
    /// The message ids in order of all generated messages for this agent run
    /// These ids can be used to branch a message from that specific message
    #[prost(string, repeated, tag = "1")]
    pub ordered_message_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// In the case that this is the first agent run in a conversation thread, we also
    /// return the new conversation title generated
    #[prost(string, optional, tag = "2")]
    pub new_title: ::core::option::Option<::prost::alloc::string::String>,
}
/// An error that occurred during the chat session
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Error {
    #[prost(string, tag = "1")]
    pub message: ::prost::alloc::string::String,
}
/// Indicates the start of a text message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextStart {
    /// uniquely identifies the text message (e.g. uuid) so that the client can
    /// merge parallel message streams (if it happens).
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
/// A delta (continuation) of a text message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextDelta {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// The next chunk of text
    #[prost(string, tag = "2")]
    pub delta: ::prost::alloc::string::String,
}
/// Indicates the end of a text message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextEnd {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
/// Indicates the start of a reasoning message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasoningStart {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
/// A delta (continuation) of a reasoning message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasoningDelta {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// The next chunk of reasoning
    #[prost(string, tag = "2")]
    pub delta: ::prost::alloc::string::String,
}
/// Indicates the end of a reasoning message from the agent
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasoningEnd {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
/// Add a new tab to the workbook
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddTabMutation {
    /// if tab_name is not provided, we'll name it "New Tab"
    #[prost(string, optional, tag = "1")]
    pub tab_name: ::core::option::Option<::prost::alloc::string::String>,
}
/// this is the "result" of the mutation
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddOrUpdatePanelMutation {
    /// JSON-serialized representation of IVizDefinition
    #[prost(string, tag = "1")]
    pub panel_as_json: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub panel_id: ::prost::alloc::string::String,
    #[prost(int32, tag = "3")]
    pub tab_index: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemovePanelsMutation {
    #[prost(string, repeated, tag = "1")]
    pub panel_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// AddOrReplaceVariableMutation is a mutation to add or replace a variable in the workbook
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddOrReplaceVariableMutation {
    /// scout_compute_api_ComputeSpecWithContext (this needs to be resolved)
    /// be careful: this uses the scout_compute_api version of ComputeSpecWithContext, which stores the spec as "seriesNode"
    /// and is NOT the same as ComputeSpecWithContext that is stored in INotebook.
    #[prost(string, tag = "1")]
    pub compute_spec_as_json: ::prost::alloc::string::String,
    /// if variable_name is not provided, we'll assume it's a new variable and auto-generate a unique name
    #[prost(string, optional, tag = "2")]
    pub variable_name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
}
/// DeleteVariablesMutation is a mutation to delete variables from the workbook
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteVariablesMutation {
    #[prost(string, repeated, tag = "1")]
    pub variable_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// WorkbookMutation is a mutation to the workbook
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkbookMutation {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(oneof = "workbook_mutation::Mutation", tags = "2, 3, 4, 5, 6")]
    pub mutation: ::core::option::Option<workbook_mutation::Mutation>,
}
/// Nested message and enum types in `WorkbookMutation`.
pub mod workbook_mutation {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Mutation {
        #[prost(message, tag = "2")]
        AddTab(super::AddTabMutation),
        #[prost(message, tag = "3")]
        AddOrUpdatePanel(super::AddOrUpdatePanelMutation),
        #[prost(message, tag = "4")]
        RemovePanels(super::RemovePanelsMutation),
        #[prost(message, tag = "5")]
        AddOrReplaceVariable(super::AddOrReplaceVariableMutation),
        #[prost(message, tag = "6")]
        DeleteVariables(super::DeleteVariablesMutation),
    }
}
/// this is a concise description of a tool call that the agent is making internally
/// without revealing too much detail about the tool call, it informs the user what the agent is doing
/// at a high level. the format is: `{tool_action_verb} {tool_target}` for example:
/// "Search channels for My Datasource"
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToolAction {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// "Thought", "Read", "Find", "Look-up", etc.
    #[prost(string, tag = "2")]
    pub tool_action_verb: ::prost::alloc::string::String,
    /// "workbook", "channel", "variable", "panel", etc.
    #[prost(string, optional, tag = "3")]
    pub tool_target: ::core::option::Option<::prost::alloc::string::String>,
}
/// Generated client implementations.
pub mod ai_agent_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// AIAgentService provides AI-powered assistance for general operations
    #[derive(Debug, Clone)]
    pub struct AiAgentServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl AiAgentServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> AiAgentServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> AiAgentServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            AiAgentServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// StreamChat handles bidirectional streaming chat for AI agent
        pub async fn stream_chat(
            &mut self,
            request: impl tonic::IntoRequest<super::StreamChatRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::StreamChatResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/StreamChat",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("nominal.ai.v1.AIAgentService", "StreamChat"));
            self.inner.server_streaming(req, path, codec).await
        }
        /// GetConversation handles getting a complete conversation list, with an optional limit on number of messages returned
        pub async fn get_conversation(
            &mut self,
            request: impl tonic::IntoRequest<super::GetConversationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetConversationResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/GetConversation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.ai.v1.AIAgentService", "GetConversation"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// ListConversations handles getting the list of conversation ids ordered by most recently updated
        pub async fn list_conversations(
            &mut self,
            request: impl tonic::IntoRequest<super::ListConversationsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListConversationsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/ListConversations",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.ai.v1.AIAgentService", "ListConversations"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// CreateConversation handles creating a conversation and assigning it a conversation rid
        pub async fn create_conversation(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateConversationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateConversationResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/CreateConversation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.ai.v1.AIAgentService", "CreateConversation"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// UpdateConversationMetadata handles updating any metadata associated with a conversation
        pub async fn update_conversation_metadata(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateConversationMetadataRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UpdateConversationMetadataResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/UpdateConversationMetadata",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ai.v1.AIAgentService",
                        "UpdateConversationMetadata",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeleteConversation handles deleting a specific conversation by conversation rid
        pub async fn delete_conversation(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteConversationRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DeleteConversationResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIAgentService/DeleteConversation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.ai.v1.AIAgentService", "DeleteConversation"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetProviderStatusRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetProviderStatusResponse {
    /// Timestamp when the last status was determined
    #[prost(message, optional, tag = "1")]
    pub timestamp: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    /// Status of the most recent health check probe
    #[prost(message, optional, tag = "2")]
    pub last_status: ::core::option::Option<ProviderStatus>,
    /// Aggregated status over the last 30 minutes (DEGRADED if any check failed or exceeded thresholds)
    /// Deprecated: Use aggregated_status instead. This field is kept for backward compatibility.
    #[deprecated]
    #[prost(message, optional, tag = "3")]
    pub aggregated_status_over_last_30m: ::core::option::Option<ProviderStatus>,
    /// Aggregated status over the last iterations, configurable in the BE (DEGRADED if any check failed or exceeded thresholds)
    #[prost(message, optional, tag = "4")]
    pub aggregated_status: ::core::option::Option<ProviderStatus>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProviderStatus {
    #[prost(oneof = "provider_status::Status", tags = "1, 2")]
    pub status: ::core::option::Option<provider_status::Status>,
}
/// Nested message and enum types in `ProviderStatus`.
pub mod provider_status {
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Status {
        #[prost(message, tag = "1")]
        Healthy(super::Healthy),
        #[prost(message, tag = "2")]
        Degraded(super::Degraded),
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Healthy {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Degraded {
    #[prost(enumeration = "DegradationReason", tag = "1")]
    pub reason: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProviderMetrics {
    #[prost(int32, tag = "1")]
    pub time_to_first_token_ms: i32,
    #[prost(int32, tag = "2")]
    pub total_time_ms: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DegradationReason {
    Unspecified = 0,
    HighLatency = 1,
    Failures = 2,
    HighLatencyAndFailures = 3,
}
impl DegradationReason {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "DEGRADATION_REASON_UNSPECIFIED",
            Self::HighLatency => "DEGRADATION_REASON_HIGH_LATENCY",
            Self::Failures => "DEGRADATION_REASON_FAILURES",
            Self::HighLatencyAndFailures => {
                "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DEGRADATION_REASON_UNSPECIFIED" => Some(Self::Unspecified),
            "DEGRADATION_REASON_HIGH_LATENCY" => Some(Self::HighLatency),
            "DEGRADATION_REASON_FAILURES" => Some(Self::Failures),
            "DEGRADATION_REASON_HIGH_LATENCY_AND_FAILURES" => {
                Some(Self::HighLatencyAndFailures)
            }
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod model_provider_health_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// ModelProviderHealthService monitors the health and performance of the backing LLM model provider.
    /// It runs lightweight health checks every 5 minutes to measure provider responsiveness and reliability,
    /// independent of the complexity of user prompts.
    #[derive(Debug, Clone)]
    pub struct ModelProviderHealthServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ModelProviderHealthServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ModelProviderHealthServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ModelProviderHealthServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ModelProviderHealthServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// GetProviderStatus returns the current health status of the model provider based on recent health checks.
        /// The status is HEALTHY if all checks in the last 30 minutes passed latency thresholds,
        /// or DEGRADED if any checks exceeded latency thresholds or failed entirely.
        pub async fn get_provider_status(
            &mut self,
            request: impl tonic::IntoRequest<super::GetProviderStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetProviderStatusResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.ModelProviderHealthService/GetProviderStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ai.v1.ModelProviderHealthService",
                        "GetProviderStatus",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IsAiEnabledForUserRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IsAiEnabledForUserResponse {
    #[prost(bool, tag = "1")]
    pub is_enabled: bool,
}
/// Generated client implementations.
pub mod ai_features_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// AIFeaturesService provides information about enabled AI features
    #[derive(Debug, Clone)]
    pub struct AiFeaturesServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl AiFeaturesServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> AiFeaturesServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> AiFeaturesServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            AiFeaturesServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// IsAIEnabledForUser can be used to check if AI is enabled for a specific user
        /// Deprecated: This endpoint is no longer maintained and will be removed in a future version.
        #[deprecated]
        pub async fn is_ai_enabled_for_user(
            &mut self,
            request: impl tonic::IntoRequest<super::IsAiEnabledForUserRequest>,
        ) -> std::result::Result<
            tonic::Response<super::IsAiEnabledForUserResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.AIFeaturesService/IsAIEnabledForUser",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ai.v1.AIFeaturesService",
                        "IsAIEnabledForUser",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// CreateOrUpdateKnowledgeBaseRequest is a request to create a knowledge from an attachment in the attachment's
/// workspace. Subsequent calls for the same attachment will overwrite the existing knowledge base.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOrUpdateKnowledgeBaseRequest {
    #[prost(string, tag = "1")]
    pub attachment_rid: ::prost::alloc::string::String,
    /// summary of the knowledge base, will be used by the LLM to decide when to use it
    #[prost(string, tag = "2")]
    pub summary_description: ::prost::alloc::string::String,
    #[prost(enumeration = "KnowledgeBaseType", optional, tag = "3")]
    pub r#type: ::core::option::Option<i32>,
}
/// CreateOrUpdateKnowledgeBaseResponse is the response to creating/updating a knowledge base
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOrUpdateKnowledgeBaseResponse {
    #[prost(string, tag = "1")]
    pub knowledge_base_rid: ::prost::alloc::string::String,
}
/// KnowledgeBase represents a knowledge base entry
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KnowledgeBase {
    #[prost(string, tag = "1")]
    pub knowledge_base_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub attachment_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub workspace_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub summary_description: ::prost::alloc::string::String,
    #[prost(enumeration = "KnowledgeBaseType", tag = "5")]
    pub r#type: i32,
    #[prost(int32, tag = "6")]
    pub version: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRequest {
    #[prost(string, tag = "1")]
    pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResponse {
    #[prost(message, repeated, tag = "1")]
    pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRequest {
    #[prost(string, tag = "1")]
    pub knowledge_base_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchRequest {
    #[prost(string, repeated, tag = "1")]
    pub knowledge_base_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchResponse {
    #[prost(message, repeated, tag = "1")]
    pub knowledge_bases: ::prost::alloc::vec::Vec<KnowledgeBase>,
}
/// generate summary description is intentionally going to return the generated description to the frontend
/// rather than storing it in the knowledge base directly because the description needs to be accepted by the user
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateSummaryDescriptionRequest {
    #[prost(string, tag = "1")]
    pub attachment_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateSummaryDescriptionResponse {
    #[prost(string, tag = "1")]
    pub summary_description: ::prost::alloc::string::String,
}
/// KnowledgeBaseType defines the types of knowledge base
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum KnowledgeBaseType {
    /// defaults to PROMPT
    Unspecified = 0,
    /// knowledge base gets added directly to prompt (needs to be small enough!)
    Prompt = 1,
    /// knowledge base gets used via vector search on embeddings
    Embedding = 2,
}
impl KnowledgeBaseType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "KNOWLEDGE_BASE_TYPE_UNSPECIFIED",
            Self::Prompt => "KNOWLEDGE_BASE_TYPE_PROMPT",
            Self::Embedding => "KNOWLEDGE_BASE_TYPE_EMBEDDING",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "KNOWLEDGE_BASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "KNOWLEDGE_BASE_TYPE_PROMPT" => Some(Self::Prompt),
            "KNOWLEDGE_BASE_TYPE_EMBEDDING" => Some(Self::Embedding),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod knowledge_base_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// KnowledgeBaseService provides AI-powered knowledge base management
    #[derive(Debug, Clone)]
    pub struct KnowledgeBaseServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl KnowledgeBaseServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> KnowledgeBaseServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> KnowledgeBaseServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            KnowledgeBaseServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// CreateOrUpdateKnowledgeBase creates a knowledge base in the workspace
        pub async fn create_or_update_knowledge_base(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateOrUpdateKnowledgeBaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateOrUpdateKnowledgeBaseResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.KnowledgeBaseService/CreateOrUpdateKnowledgeBase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ai.v1.KnowledgeBaseService",
                        "CreateOrUpdateKnowledgeBase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// List returns all knowledge bases in the specified workspace
        pub async fn list(
            &mut self,
            request: impl tonic::IntoRequest<super::ListRequest>,
        ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.KnowledgeBaseService/List",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "List"));
            self.inner.unary(req, path, codec).await
        }
        /// Delete removes a knowledge base by its RID
        pub async fn delete(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteRequest>,
        ) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.KnowledgeBaseService/Delete",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "Delete"));
            self.inner.unary(req, path, codec).await
        }
        /// GetBatch retrieves multiple knowledge bases by their RIDs
        pub async fn get_batch(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBatchRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetBatchResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.KnowledgeBaseService/GetBatch",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("nominal.ai.v1.KnowledgeBaseService", "GetBatch"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// GenerateSummaryDescription generates a summary description for an attachment rid
        pub async fn generate_summary_description(
            &mut self,
            request: impl tonic::IntoRequest<super::GenerateSummaryDescriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GenerateSummaryDescriptionResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.ai.v1.KnowledgeBaseService/GenerateSummaryDescription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.ai.v1.KnowledgeBaseService",
                        "GenerateSummaryDescription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
