aws-sdk-bedrockagentruntime 1.126.0

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

/// <p>Contains the result or output of an action group or knowledge base, or the response to the user.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Observation {
    /// <p>The unique identifier of the trace.</p>
    pub trace_id: ::std::option::Option<::std::string::String>,
    /// <p>Specifies what kind of information the agent returns in the observation. The following values are possible.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION_GROUP</code> – The agent returns the result of an action group.</p></li>
    /// <li>
    /// <p><code>KNOWLEDGE_BASE</code> – The agent returns information from a knowledge base.</p></li>
    /// <li>
    /// <p><code>FINISH</code> – The agent returns a final response to the user with no follow-up.</p></li>
    /// <li>
    /// <p><code>ASK_USER</code> – The agent asks the user a question.</p></li>
    /// <li>
    /// <p><code>REPROMPT</code> – The agent prompts the user again for the same information.</p></li>
    /// </ul>
    pub r#type: ::std::option::Option<crate::types::Type>,
    /// <p>Contains the JSON-formatted string returned by the API invoked by the action group.</p>
    pub action_group_invocation_output: ::std::option::Option<crate::types::ActionGroupInvocationOutput>,
    /// <p>A collaborator's invocation output.</p>
    pub agent_collaborator_invocation_output: ::std::option::Option<crate::types::AgentCollaboratorInvocationOutput>,
    /// <p>Contains details about the results from looking up the knowledge base.</p>
    pub knowledge_base_lookup_output: ::std::option::Option<crate::types::KnowledgeBaseLookupOutput>,
    /// <p>Contains details about the response to the user.</p>
    pub final_response: ::std::option::Option<crate::types::FinalResponse>,
    /// <p>Contains details about the response to reprompt the input.</p>
    pub reprompt_response: ::std::option::Option<crate::types::RepromptResponse>,
    /// <p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>
    pub code_interpreter_invocation_output: ::std::option::Option<crate::types::CodeInterpreterInvocationOutput>,
}
impl Observation {
    /// <p>The unique identifier of the trace.</p>
    pub fn trace_id(&self) -> ::std::option::Option<&str> {
        self.trace_id.as_deref()
    }
    /// <p>Specifies what kind of information the agent returns in the observation. The following values are possible.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION_GROUP</code> – The agent returns the result of an action group.</p></li>
    /// <li>
    /// <p><code>KNOWLEDGE_BASE</code> – The agent returns information from a knowledge base.</p></li>
    /// <li>
    /// <p><code>FINISH</code> – The agent returns a final response to the user with no follow-up.</p></li>
    /// <li>
    /// <p><code>ASK_USER</code> – The agent asks the user a question.</p></li>
    /// <li>
    /// <p><code>REPROMPT</code> – The agent prompts the user again for the same information.</p></li>
    /// </ul>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::Type> {
        self.r#type.as_ref()
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the action group.</p>
    pub fn action_group_invocation_output(&self) -> ::std::option::Option<&crate::types::ActionGroupInvocationOutput> {
        self.action_group_invocation_output.as_ref()
    }
    /// <p>A collaborator's invocation output.</p>
    pub fn agent_collaborator_invocation_output(&self) -> ::std::option::Option<&crate::types::AgentCollaboratorInvocationOutput> {
        self.agent_collaborator_invocation_output.as_ref()
    }
    /// <p>Contains details about the results from looking up the knowledge base.</p>
    pub fn knowledge_base_lookup_output(&self) -> ::std::option::Option<&crate::types::KnowledgeBaseLookupOutput> {
        self.knowledge_base_lookup_output.as_ref()
    }
    /// <p>Contains details about the response to the user.</p>
    pub fn final_response(&self) -> ::std::option::Option<&crate::types::FinalResponse> {
        self.final_response.as_ref()
    }
    /// <p>Contains details about the response to reprompt the input.</p>
    pub fn reprompt_response(&self) -> ::std::option::Option<&crate::types::RepromptResponse> {
        self.reprompt_response.as_ref()
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>
    pub fn code_interpreter_invocation_output(&self) -> ::std::option::Option<&crate::types::CodeInterpreterInvocationOutput> {
        self.code_interpreter_invocation_output.as_ref()
    }
}
impl ::std::fmt::Debug for Observation {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Observation");
        formatter.field("trace_id", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &"*** Sensitive Data Redacted ***");
        formatter.field("action_group_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.field("agent_collaborator_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.field("knowledge_base_lookup_output", &"*** Sensitive Data Redacted ***");
        formatter.field("final_response", &"*** Sensitive Data Redacted ***");
        formatter.field("reprompt_response", &"*** Sensitive Data Redacted ***");
        formatter.field("code_interpreter_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Observation {
    /// Creates a new builder-style object to manufacture [`Observation`](crate::types::Observation).
    pub fn builder() -> crate::types::builders::ObservationBuilder {
        crate::types::builders::ObservationBuilder::default()
    }
}

/// A builder for [`Observation`](crate::types::Observation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ObservationBuilder {
    pub(crate) trace_id: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::Type>,
    pub(crate) action_group_invocation_output: ::std::option::Option<crate::types::ActionGroupInvocationOutput>,
    pub(crate) agent_collaborator_invocation_output: ::std::option::Option<crate::types::AgentCollaboratorInvocationOutput>,
    pub(crate) knowledge_base_lookup_output: ::std::option::Option<crate::types::KnowledgeBaseLookupOutput>,
    pub(crate) final_response: ::std::option::Option<crate::types::FinalResponse>,
    pub(crate) reprompt_response: ::std::option::Option<crate::types::RepromptResponse>,
    pub(crate) code_interpreter_invocation_output: ::std::option::Option<crate::types::CodeInterpreterInvocationOutput>,
}
impl ObservationBuilder {
    /// <p>The unique identifier of the trace.</p>
    pub fn trace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.trace_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the trace.</p>
    pub fn set_trace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trace_id = input;
        self
    }
    /// <p>The unique identifier of the trace.</p>
    pub fn get_trace_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.trace_id
    }
    /// <p>Specifies what kind of information the agent returns in the observation. The following values are possible.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION_GROUP</code> – The agent returns the result of an action group.</p></li>
    /// <li>
    /// <p><code>KNOWLEDGE_BASE</code> – The agent returns information from a knowledge base.</p></li>
    /// <li>
    /// <p><code>FINISH</code> – The agent returns a final response to the user with no follow-up.</p></li>
    /// <li>
    /// <p><code>ASK_USER</code> – The agent asks the user a question.</p></li>
    /// <li>
    /// <p><code>REPROMPT</code> – The agent prompts the user again for the same information.</p></li>
    /// </ul>
    pub fn r#type(mut self, input: crate::types::Type) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies what kind of information the agent returns in the observation. The following values are possible.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION_GROUP</code> – The agent returns the result of an action group.</p></li>
    /// <li>
    /// <p><code>KNOWLEDGE_BASE</code> – The agent returns information from a knowledge base.</p></li>
    /// <li>
    /// <p><code>FINISH</code> – The agent returns a final response to the user with no follow-up.</p></li>
    /// <li>
    /// <p><code>ASK_USER</code> – The agent asks the user a question.</p></li>
    /// <li>
    /// <p><code>REPROMPT</code> – The agent prompts the user again for the same information.</p></li>
    /// </ul>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Specifies what kind of information the agent returns in the observation. The following values are possible.</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION_GROUP</code> – The agent returns the result of an action group.</p></li>
    /// <li>
    /// <p><code>KNOWLEDGE_BASE</code> – The agent returns information from a knowledge base.</p></li>
    /// <li>
    /// <p><code>FINISH</code> – The agent returns a final response to the user with no follow-up.</p></li>
    /// <li>
    /// <p><code>ASK_USER</code> – The agent asks the user a question.</p></li>
    /// <li>
    /// <p><code>REPROMPT</code> – The agent prompts the user again for the same information.</p></li>
    /// </ul>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
        &self.r#type
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the action group.</p>
    pub fn action_group_invocation_output(mut self, input: crate::types::ActionGroupInvocationOutput) -> Self {
        self.action_group_invocation_output = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the action group.</p>
    pub fn set_action_group_invocation_output(mut self, input: ::std::option::Option<crate::types::ActionGroupInvocationOutput>) -> Self {
        self.action_group_invocation_output = input;
        self
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the action group.</p>
    pub fn get_action_group_invocation_output(&self) -> &::std::option::Option<crate::types::ActionGroupInvocationOutput> {
        &self.action_group_invocation_output
    }
    /// <p>A collaborator's invocation output.</p>
    pub fn agent_collaborator_invocation_output(mut self, input: crate::types::AgentCollaboratorInvocationOutput) -> Self {
        self.agent_collaborator_invocation_output = ::std::option::Option::Some(input);
        self
    }
    /// <p>A collaborator's invocation output.</p>
    pub fn set_agent_collaborator_invocation_output(mut self, input: ::std::option::Option<crate::types::AgentCollaboratorInvocationOutput>) -> Self {
        self.agent_collaborator_invocation_output = input;
        self
    }
    /// <p>A collaborator's invocation output.</p>
    pub fn get_agent_collaborator_invocation_output(&self) -> &::std::option::Option<crate::types::AgentCollaboratorInvocationOutput> {
        &self.agent_collaborator_invocation_output
    }
    /// <p>Contains details about the results from looking up the knowledge base.</p>
    pub fn knowledge_base_lookup_output(mut self, input: crate::types::KnowledgeBaseLookupOutput) -> Self {
        self.knowledge_base_lookup_output = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details about the results from looking up the knowledge base.</p>
    pub fn set_knowledge_base_lookup_output(mut self, input: ::std::option::Option<crate::types::KnowledgeBaseLookupOutput>) -> Self {
        self.knowledge_base_lookup_output = input;
        self
    }
    /// <p>Contains details about the results from looking up the knowledge base.</p>
    pub fn get_knowledge_base_lookup_output(&self) -> &::std::option::Option<crate::types::KnowledgeBaseLookupOutput> {
        &self.knowledge_base_lookup_output
    }
    /// <p>Contains details about the response to the user.</p>
    pub fn final_response(mut self, input: crate::types::FinalResponse) -> Self {
        self.final_response = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details about the response to the user.</p>
    pub fn set_final_response(mut self, input: ::std::option::Option<crate::types::FinalResponse>) -> Self {
        self.final_response = input;
        self
    }
    /// <p>Contains details about the response to the user.</p>
    pub fn get_final_response(&self) -> &::std::option::Option<crate::types::FinalResponse> {
        &self.final_response
    }
    /// <p>Contains details about the response to reprompt the input.</p>
    pub fn reprompt_response(mut self, input: crate::types::RepromptResponse) -> Self {
        self.reprompt_response = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details about the response to reprompt the input.</p>
    pub fn set_reprompt_response(mut self, input: ::std::option::Option<crate::types::RepromptResponse>) -> Self {
        self.reprompt_response = input;
        self
    }
    /// <p>Contains details about the response to reprompt the input.</p>
    pub fn get_reprompt_response(&self) -> &::std::option::Option<crate::types::RepromptResponse> {
        &self.reprompt_response
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>
    pub fn code_interpreter_invocation_output(mut self, input: crate::types::CodeInterpreterInvocationOutput) -> Self {
        self.code_interpreter_invocation_output = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>
    pub fn set_code_interpreter_invocation_output(mut self, input: ::std::option::Option<crate::types::CodeInterpreterInvocationOutput>) -> Self {
        self.code_interpreter_invocation_output = input;
        self
    }
    /// <p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>
    pub fn get_code_interpreter_invocation_output(&self) -> &::std::option::Option<crate::types::CodeInterpreterInvocationOutput> {
        &self.code_interpreter_invocation_output
    }
    /// Consumes the builder and constructs a [`Observation`](crate::types::Observation).
    pub fn build(self) -> crate::types::Observation {
        crate::types::Observation {
            trace_id: self.trace_id,
            r#type: self.r#type,
            action_group_invocation_output: self.action_group_invocation_output,
            agent_collaborator_invocation_output: self.agent_collaborator_invocation_output,
            knowledge_base_lookup_output: self.knowledge_base_lookup_output,
            final_response: self.final_response,
            reprompt_response: self.reprompt_response,
            code_interpreter_invocation_output: self.code_interpreter_invocation_output,
        }
    }
}
impl ::std::fmt::Debug for ObservationBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ObservationBuilder");
        formatter.field("trace_id", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &"*** Sensitive Data Redacted ***");
        formatter.field("action_group_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.field("agent_collaborator_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.field("knowledge_base_lookup_output", &"*** Sensitive Data Redacted ***");
        formatter.field("final_response", &"*** Sensitive Data Redacted ***");
        formatter.field("reprompt_response", &"*** Sensitive Data Redacted ***");
        formatter.field("code_interpreter_invocation_output", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}