aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// A question to answer against an agent context, and optional settings for how the answer is retrieved and returned.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AgenticRetrieveInput {
    /// The agent context to retrieve from, by its ID or ARN.
    pub agent_context_id: ::std::option::Option<::std::string::String>,
    /// The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.
    pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
    /// Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.
    pub session_id: ::std::option::Option<::std::string::String>,
    /// Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis.
    pub analysis_configuration: ::std::option::Option<crate::types::AnalysisConfiguration>,
    /// Optional bounds and configuration for the agent loop.
    pub retrieval_configuration: ::std::option::Option<crate::types::RetrievalConfiguration>,
}
impl AgenticRetrieveInput {
    /// The agent context to retrieve from, by its ID or ARN.
    pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
        self.agent_context_id.as_deref()
    }
    /// The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.
    ///
    /// 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::Message] {
        self.messages.as_deref().unwrap_or_default()
    }
    /// Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis.
    pub fn analysis_configuration(&self) -> ::std::option::Option<&crate::types::AnalysisConfiguration> {
        self.analysis_configuration.as_ref()
    }
    /// Optional bounds and configuration for the agent loop.
    pub fn retrieval_configuration(&self) -> ::std::option::Option<&crate::types::RetrievalConfiguration> {
        self.retrieval_configuration.as_ref()
    }
}
impl AgenticRetrieveInput {
    /// Creates a new builder-style object to manufacture [`AgenticRetrieveInput`](crate::operation::agentic_retrieve::AgenticRetrieveInput).
    pub fn builder() -> crate::operation::agentic_retrieve::builders::AgenticRetrieveInputBuilder {
        crate::operation::agentic_retrieve::builders::AgenticRetrieveInputBuilder::default()
    }
}

/// A builder for [`AgenticRetrieveInput`](crate::operation::agentic_retrieve::AgenticRetrieveInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AgenticRetrieveInputBuilder {
    pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
    pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) analysis_configuration: ::std::option::Option<crate::types::AnalysisConfiguration>,
    pub(crate) retrieval_configuration: ::std::option::Option<crate::types::RetrievalConfiguration>,
}
impl AgenticRetrieveInputBuilder {
    /// The agent context to retrieve from, by its ID or ARN.
    /// This field is required.
    pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_context_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The agent context to retrieve from, by its ID or ARN.
    pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_context_id = input;
        self
    }
    /// The agent context to retrieve from, by its ID or ARN.
    pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_context_id
    }
    /// Appends an item to `messages`.
    ///
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
    ///
    /// The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.
    pub fn messages(mut self, input: crate::types::Message) -> Self {
        let mut v = self.messages.unwrap_or_default();
        v.push(input);
        self.messages = ::std::option::Option::Some(v);
        self
    }
    /// The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
        self.messages = input;
        self
    }
    /// The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
        &self.messages
    }
    /// Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis.
    pub fn analysis_configuration(mut self, input: crate::types::AnalysisConfiguration) -> Self {
        self.analysis_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis.
    pub fn set_analysis_configuration(mut self, input: ::std::option::Option<crate::types::AnalysisConfiguration>) -> Self {
        self.analysis_configuration = input;
        self
    }
    /// Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis.
    pub fn get_analysis_configuration(&self) -> &::std::option::Option<crate::types::AnalysisConfiguration> {
        &self.analysis_configuration
    }
    /// Optional bounds and configuration for the agent loop.
    pub fn retrieval_configuration(mut self, input: crate::types::RetrievalConfiguration) -> Self {
        self.retrieval_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Optional bounds and configuration for the agent loop.
    pub fn set_retrieval_configuration(mut self, input: ::std::option::Option<crate::types::RetrievalConfiguration>) -> Self {
        self.retrieval_configuration = input;
        self
    }
    /// Optional bounds and configuration for the agent loop.
    pub fn get_retrieval_configuration(&self) -> &::std::option::Option<crate::types::RetrievalConfiguration> {
        &self.retrieval_configuration
    }
    /// Consumes the builder and constructs a [`AgenticRetrieveInput`](crate::operation::agentic_retrieve::AgenticRetrieveInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::agentic_retrieve::AgenticRetrieveInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::agentic_retrieve::AgenticRetrieveInput {
            agent_context_id: self.agent_context_id,
            messages: self.messages,
            session_id: self.session_id,
            analysis_configuration: self.analysis_configuration,
            retrieval_configuration: self.retrieval_configuration,
        })
    }
}