aws-sdk-bedrockagentruntime 1.131.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Request structure for the agentic retrieve stream operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct AgenticRetrieveStreamInput {
    /// <p>The list of messages for the agentic retrieval conversation.</p>
    pub messages: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetrieveMessage>>,
    /// <p>The list of retrievers to use for agentic retrieval.</p>
    pub retrievers: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetriever>>,
    /// <p>Configuration settings for the agentic retrieval operation.</p>
    pub agentic_retrieve_configuration: ::std::option::Option<crate::types::AgenticRetrieveConfiguration>,
    /// <p>Policy configuration for guardrails and content filtering.</p>
    pub policy_configuration: ::std::option::Option<crate::types::AgenticRetrievePolicyConfiguration>,
    /// <p>Opaque continuation token for paginated results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.</p>
    pub user_context: ::std::option::Option<crate::types::UserContext>,
    /// <p>Whether to generate a response based on the retrieved results.</p>
    pub generate_response: ::std::option::Option<bool>,
}
impl AgenticRetrieveStreamInput {
    /// <p>The list of messages for the agentic retrieval conversation.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.messages.is_none()`.
    pub fn messages(&self) -> &[crate::types::AgenticRetrieveMessage] {
        self.messages.as_deref().unwrap_or_default()
    }
    /// <p>The list of retrievers to use for agentic retrieval.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.retrievers.is_none()`.
    pub fn retrievers(&self) -> &[crate::types::AgenticRetriever] {
        self.retrievers.as_deref().unwrap_or_default()
    }
    /// <p>Configuration settings for the agentic retrieval operation.</p>
    pub fn agentic_retrieve_configuration(&self) -> ::std::option::Option<&crate::types::AgenticRetrieveConfiguration> {
        self.agentic_retrieve_configuration.as_ref()
    }
    /// <p>Policy configuration for guardrails and content filtering.</p>
    pub fn policy_configuration(&self) -> ::std::option::Option<&crate::types::AgenticRetrievePolicyConfiguration> {
        self.policy_configuration.as_ref()
    }
    /// <p>Opaque continuation token for paginated results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.</p>
    pub fn user_context(&self) -> ::std::option::Option<&crate::types::UserContext> {
        self.user_context.as_ref()
    }
    /// <p>Whether to generate a response based on the retrieved results.</p>
    pub fn generate_response(&self) -> ::std::option::Option<bool> {
        self.generate_response
    }
}
impl ::std::fmt::Debug for AgenticRetrieveStreamInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("AgenticRetrieveStreamInput");
        formatter.field("messages", &self.messages);
        formatter.field("retrievers", &self.retrievers);
        formatter.field("agentic_retrieve_configuration", &self.agentic_retrieve_configuration);
        formatter.field("policy_configuration", &self.policy_configuration);
        formatter.field("next_token", &self.next_token);
        formatter.field("user_context", &"*** Sensitive Data Redacted ***");
        formatter.field("generate_response", &self.generate_response);
        formatter.finish()
    }
}
impl AgenticRetrieveStreamInput {
    /// Creates a new builder-style object to manufacture [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
    pub fn builder() -> crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamInputBuilder {
        crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamInputBuilder::default()
    }
}

/// A builder for [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct AgenticRetrieveStreamInputBuilder {
    pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetrieveMessage>>,
    pub(crate) retrievers: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetriever>>,
    pub(crate) agentic_retrieve_configuration: ::std::option::Option<crate::types::AgenticRetrieveConfiguration>,
    pub(crate) policy_configuration: ::std::option::Option<crate::types::AgenticRetrievePolicyConfiguration>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) user_context: ::std::option::Option<crate::types::UserContext>,
    pub(crate) generate_response: ::std::option::Option<bool>,
}
impl AgenticRetrieveStreamInputBuilder {
    /// Appends an item to `messages`.
    ///
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
    ///
    /// <p>The list of messages for the agentic retrieval conversation.</p>
    pub fn messages(mut self, input: crate::types::AgenticRetrieveMessage) -> Self {
        let mut v = self.messages.unwrap_or_default();
        v.push(input);
        self.messages = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of messages for the agentic retrieval conversation.</p>
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetrieveMessage>>) -> Self {
        self.messages = input;
        self
    }
    /// <p>The list of messages for the agentic retrieval conversation.</p>
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AgenticRetrieveMessage>> {
        &self.messages
    }
    /// Appends an item to `retrievers`.
    ///
    /// To override the contents of this collection use [`set_retrievers`](Self::set_retrievers).
    ///
    /// <p>The list of retrievers to use for agentic retrieval.</p>
    pub fn retrievers(mut self, input: crate::types::AgenticRetriever) -> Self {
        let mut v = self.retrievers.unwrap_or_default();
        v.push(input);
        self.retrievers = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of retrievers to use for agentic retrieval.</p>
    pub fn set_retrievers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AgenticRetriever>>) -> Self {
        self.retrievers = input;
        self
    }
    /// <p>The list of retrievers to use for agentic retrieval.</p>
    pub fn get_retrievers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AgenticRetriever>> {
        &self.retrievers
    }
    /// <p>Configuration settings for the agentic retrieval operation.</p>
    /// This field is required.
    pub fn agentic_retrieve_configuration(mut self, input: crate::types::AgenticRetrieveConfiguration) -> Self {
        self.agentic_retrieve_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configuration settings for the agentic retrieval operation.</p>
    pub fn set_agentic_retrieve_configuration(mut self, input: ::std::option::Option<crate::types::AgenticRetrieveConfiguration>) -> Self {
        self.agentic_retrieve_configuration = input;
        self
    }
    /// <p>Configuration settings for the agentic retrieval operation.</p>
    pub fn get_agentic_retrieve_configuration(&self) -> &::std::option::Option<crate::types::AgenticRetrieveConfiguration> {
        &self.agentic_retrieve_configuration
    }
    /// <p>Policy configuration for guardrails and content filtering.</p>
    pub fn policy_configuration(mut self, input: crate::types::AgenticRetrievePolicyConfiguration) -> Self {
        self.policy_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Policy configuration for guardrails and content filtering.</p>
    pub fn set_policy_configuration(mut self, input: ::std::option::Option<crate::types::AgenticRetrievePolicyConfiguration>) -> Self {
        self.policy_configuration = input;
        self
    }
    /// <p>Policy configuration for guardrails and content filtering.</p>
    pub fn get_policy_configuration(&self) -> &::std::option::Option<crate::types::AgenticRetrievePolicyConfiguration> {
        &self.policy_configuration
    }
    /// <p>Opaque continuation token for paginated results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Opaque continuation token for paginated results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>Opaque continuation token for paginated results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.</p>
    pub fn user_context(mut self, input: crate::types::UserContext) -> Self {
        self.user_context = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.</p>
    pub fn set_user_context(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
        self.user_context = input;
        self
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.</p>
    pub fn get_user_context(&self) -> &::std::option::Option<crate::types::UserContext> {
        &self.user_context
    }
    /// <p>Whether to generate a response based on the retrieved results.</p>
    pub fn generate_response(mut self, input: bool) -> Self {
        self.generate_response = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether to generate a response based on the retrieved results.</p>
    pub fn set_generate_response(mut self, input: ::std::option::Option<bool>) -> Self {
        self.generate_response = input;
        self
    }
    /// <p>Whether to generate a response based on the retrieved results.</p>
    pub fn get_generate_response(&self) -> &::std::option::Option<bool> {
        &self.generate_response
    }
    /// Consumes the builder and constructs a [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput {
            messages: self.messages,
            retrievers: self.retrievers,
            agentic_retrieve_configuration: self.agentic_retrieve_configuration,
            policy_configuration: self.policy_configuration,
            next_token: self.next_token,
            user_context: self.user_context,
            generate_response: self.generate_response,
        })
    }
}
impl ::std::fmt::Debug for AgenticRetrieveStreamInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("AgenticRetrieveStreamInputBuilder");
        formatter.field("messages", &self.messages);
        formatter.field("retrievers", &self.retrievers);
        formatter.field("agentic_retrieve_configuration", &self.agentic_retrieve_configuration);
        formatter.field("policy_configuration", &self.policy_configuration);
        formatter.field("next_token", &self.next_token);
        formatter.field("user_context", &"*** Sensitive Data Redacted ***");
        formatter.field("generate_response", &self.generate_response);
        formatter.finish()
    }
}