AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/apply_guardrail/_apply_guardrail_input.rs

@@ -1,0 +155,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ApplyGuardrailInput {
    6         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
    7         -
    pub guardrail_identifier: ::std::option::Option<::std::string::String>,
    8         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
    9         -
    pub guardrail_version: ::std::option::Option<::std::string::String>,
   10         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
   11         -
    pub source: ::std::option::Option<crate::types::GuardrailContentSource>,
   12         -
    /// <p>The content details used in the request to apply the guardrail.</p>
   13         -
    pub content: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>>,
   14         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
   15         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
   16         -
    pub output_scope: ::std::option::Option<crate::types::GuardrailOutputScope>,
   17         -
}
   18         -
impl ApplyGuardrailInput {
   19         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
   20         -
    pub fn guardrail_identifier(&self) -> ::std::option::Option<&str> {
   21         -
        self.guardrail_identifier.as_deref()
   22         -
    }
   23         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
   24         -
    pub fn guardrail_version(&self) -> ::std::option::Option<&str> {
   25         -
        self.guardrail_version.as_deref()
   26         -
    }
   27         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
   28         -
    pub fn source(&self) -> ::std::option::Option<&crate::types::GuardrailContentSource> {
   29         -
        self.source.as_ref()
   30         -
    }
   31         -
    /// <p>The content details used in the request to apply the guardrail.</p>
   32         -
    ///
   33         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content.is_none()`.
   34         -
    pub fn content(&self) -> &[crate::types::GuardrailContentBlock] {
   35         -
        self.content.as_deref().unwrap_or_default()
   36         -
    }
   37         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
   38         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
   39         -
    pub fn output_scope(&self) -> ::std::option::Option<&crate::types::GuardrailOutputScope> {
   40         -
        self.output_scope.as_ref()
   41         -
    }
   42         -
}
   43         -
impl ApplyGuardrailInput {
   44         -
    /// Creates a new builder-style object to manufacture [`ApplyGuardrailInput`](crate::operation::apply_guardrail::ApplyGuardrailInput).
   45         -
    pub fn builder() -> crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder {
   46         -
        crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder::default()
   47         -
    }
   48         -
}
   49         -
   50         -
/// A builder for [`ApplyGuardrailInput`](crate::operation::apply_guardrail::ApplyGuardrailInput).
   51         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   52         -
#[non_exhaustive]
   53         -
pub struct ApplyGuardrailInputBuilder {
   54         -
    pub(crate) guardrail_identifier: ::std::option::Option<::std::string::String>,
   55         -
    pub(crate) guardrail_version: ::std::option::Option<::std::string::String>,
   56         -
    pub(crate) source: ::std::option::Option<crate::types::GuardrailContentSource>,
   57         -
    pub(crate) content: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>>,
   58         -
    pub(crate) output_scope: ::std::option::Option<crate::types::GuardrailOutputScope>,
   59         -
}
   60         -
impl ApplyGuardrailInputBuilder {
   61         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
   62         -
    /// This field is required.
   63         -
    pub fn guardrail_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   64         -
        self.guardrail_identifier = ::std::option::Option::Some(input.into());
   65         -
        self
   66         -
    }
   67         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
   68         -
    pub fn set_guardrail_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   69         -
        self.guardrail_identifier = input;
   70         -
        self
   71         -
    }
   72         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
   73         -
    pub fn get_guardrail_identifier(&self) -> &::std::option::Option<::std::string::String> {
   74         -
        &self.guardrail_identifier
   75         -
    }
   76         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
   77         -
    /// This field is required.
   78         -
    pub fn guardrail_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   79         -
        self.guardrail_version = ::std::option::Option::Some(input.into());
   80         -
        self
   81         -
    }
   82         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
   83         -
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   84         -
        self.guardrail_version = input;
   85         -
        self
   86         -
    }
   87         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
   88         -
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
   89         -
        &self.guardrail_version
   90         -
    }
   91         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
   92         -
    /// This field is required.
   93         -
    pub fn source(mut self, input: crate::types::GuardrailContentSource) -> Self {
   94         -
        self.source = ::std::option::Option::Some(input);
   95         -
        self
   96         -
    }
   97         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
   98         -
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::GuardrailContentSource>) -> Self {
   99         -
        self.source = input;
  100         -
        self
  101         -
    }
  102         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
  103         -
    pub fn get_source(&self) -> &::std::option::Option<crate::types::GuardrailContentSource> {
  104         -
        &self.source
  105         -
    }
  106         -
    /// Appends an item to `content`.
  107         -
    ///
  108         -
    /// To override the contents of this collection use [`set_content`](Self::set_content).
  109         -
    ///
  110         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  111         -
    pub fn content(mut self, input: crate::types::GuardrailContentBlock) -> Self {
  112         -
        let mut v = self.content.unwrap_or_default();
  113         -
        v.push(input);
  114         -
        self.content = ::std::option::Option::Some(v);
  115         -
        self
  116         -
    }
  117         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  118         -
    pub fn set_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>>) -> Self {
  119         -
        self.content = input;
  120         -
        self
  121         -
    }
  122         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  123         -
    pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>> {
  124         -
        &self.content
  125         -
    }
  126         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  127         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  128         -
    pub fn output_scope(mut self, input: crate::types::GuardrailOutputScope) -> Self {
  129         -
        self.output_scope = ::std::option::Option::Some(input);
  130         -
        self
  131         -
    }
  132         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  133         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  134         -
    pub fn set_output_scope(mut self, input: ::std::option::Option<crate::types::GuardrailOutputScope>) -> Self {
  135         -
        self.output_scope = input;
  136         -
        self
  137         -
    }
  138         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  139         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  140         -
    pub fn get_output_scope(&self) -> &::std::option::Option<crate::types::GuardrailOutputScope> {
  141         -
        &self.output_scope
  142         -
    }
  143         -
    /// Consumes the builder and constructs a [`ApplyGuardrailInput`](crate::operation::apply_guardrail::ApplyGuardrailInput).
  144         -
    pub fn build(
  145         -
        self,
  146         -
    ) -> ::std::result::Result<crate::operation::apply_guardrail::ApplyGuardrailInput, ::aws_smithy_types::error::operation::BuildError> {
  147         -
        ::std::result::Result::Ok(crate::operation::apply_guardrail::ApplyGuardrailInput {
  148         -
            guardrail_identifier: self.guardrail_identifier,
  149         -
            guardrail_version: self.guardrail_version,
  150         -
            source: self.source,
  151         -
            content: self.content,
  152         -
            output_scope: self.output_scope,
  153         -
        })
  154         -
    }
  155         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/apply_guardrail/_apply_guardrail_output.rs

@@ -1,0 +213,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ApplyGuardrailOutput {
    6         -
    /// <p>The usage details in the response from the guardrail.</p>
    7         -
    pub usage: ::std::option::Option<crate::types::GuardrailUsage>,
    8         -
    /// <p>The action taken in the response from the guardrail.</p>
    9         -
    pub action: crate::types::GuardrailAction,
   10         -
    /// <p>The reason for the action taken when harmful content is detected.</p>
   11         -
    pub action_reason: ::std::option::Option<::std::string::String>,
   12         -
    /// <p>The output details in the response from the guardrail.</p>
   13         -
    pub outputs: ::std::vec::Vec<crate::types::GuardrailOutputContent>,
   14         -
    /// <p>The assessment details in the response from the guardrail.</p>
   15         -
    pub assessments: ::std::vec::Vec<crate::types::GuardrailAssessment>,
   16         -
    /// <p>The guardrail coverage details in the apply guardrail response.</p>
   17         -
    pub guardrail_coverage: ::std::option::Option<crate::types::GuardrailCoverage>,
   18         -
    _request_id: Option<String>,
   19         -
}
   20         -
impl ApplyGuardrailOutput {
   21         -
    /// <p>The usage details in the response from the guardrail.</p>
   22         -
    pub fn usage(&self) -> ::std::option::Option<&crate::types::GuardrailUsage> {
   23         -
        self.usage.as_ref()
   24         -
    }
   25         -
    /// <p>The action taken in the response from the guardrail.</p>
   26         -
    pub fn action(&self) -> &crate::types::GuardrailAction {
   27         -
        &self.action
   28         -
    }
   29         -
    /// <p>The reason for the action taken when harmful content is detected.</p>
   30         -
    pub fn action_reason(&self) -> ::std::option::Option<&str> {
   31         -
        self.action_reason.as_deref()
   32         -
    }
   33         -
    /// <p>The output details in the response from the guardrail.</p>
   34         -
    pub fn outputs(&self) -> &[crate::types::GuardrailOutputContent] {
   35         -
        use std::ops::Deref;
   36         -
        self.outputs.deref()
   37         -
    }
   38         -
    /// <p>The assessment details in the response from the guardrail.</p>
   39         -
    pub fn assessments(&self) -> &[crate::types::GuardrailAssessment] {
   40         -
        use std::ops::Deref;
   41         -
        self.assessments.deref()
   42         -
    }
   43         -
    /// <p>The guardrail coverage details in the apply guardrail response.</p>
   44         -
    pub fn guardrail_coverage(&self) -> ::std::option::Option<&crate::types::GuardrailCoverage> {
   45         -
        self.guardrail_coverage.as_ref()
   46         -
    }
   47         -
}
   48         -
impl ::aws_types::request_id::RequestId for ApplyGuardrailOutput {
   49         -
    fn request_id(&self) -> Option<&str> {
   50         -
        self._request_id.as_deref()
   51         -
    }
   52         -
}
   53         -
impl ApplyGuardrailOutput {
   54         -
    /// Creates a new builder-style object to manufacture [`ApplyGuardrailOutput`](crate::operation::apply_guardrail::ApplyGuardrailOutput).
   55         -
    pub fn builder() -> crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder {
   56         -
        crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::default()
   57         -
    }
   58         -
}
   59         -
   60         -
/// A builder for [`ApplyGuardrailOutput`](crate::operation::apply_guardrail::ApplyGuardrailOutput).
   61         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   62         -
#[non_exhaustive]
   63         -
pub struct ApplyGuardrailOutputBuilder {
   64         -
    pub(crate) usage: ::std::option::Option<crate::types::GuardrailUsage>,
   65         -
    pub(crate) action: ::std::option::Option<crate::types::GuardrailAction>,
   66         -
    pub(crate) action_reason: ::std::option::Option<::std::string::String>,
   67         -
    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailOutputContent>>,
   68         -
    pub(crate) assessments: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailAssessment>>,
   69         -
    pub(crate) guardrail_coverage: ::std::option::Option<crate::types::GuardrailCoverage>,
   70         -
    _request_id: Option<String>,
   71         -
}
   72         -
impl ApplyGuardrailOutputBuilder {
   73         -
    /// <p>The usage details in the response from the guardrail.</p>
   74         -
    /// This field is required.
   75         -
    pub fn usage(mut self, input: crate::types::GuardrailUsage) -> Self {
   76         -
        self.usage = ::std::option::Option::Some(input);
   77         -
        self
   78         -
    }
   79         -
    /// <p>The usage details in the response from the guardrail.</p>
   80         -
    pub fn set_usage(mut self, input: ::std::option::Option<crate::types::GuardrailUsage>) -> Self {
   81         -
        self.usage = input;
   82         -
        self
   83         -
    }
   84         -
    /// <p>The usage details in the response from the guardrail.</p>
   85         -
    pub fn get_usage(&self) -> &::std::option::Option<crate::types::GuardrailUsage> {
   86         -
        &self.usage
   87         -
    }
   88         -
    /// <p>The action taken in the response from the guardrail.</p>
   89         -
    /// This field is required.
   90         -
    pub fn action(mut self, input: crate::types::GuardrailAction) -> Self {
   91         -
        self.action = ::std::option::Option::Some(input);
   92         -
        self
   93         -
    }
   94         -
    /// <p>The action taken in the response from the guardrail.</p>
   95         -
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::GuardrailAction>) -> Self {
   96         -
        self.action = input;
   97         -
        self
   98         -
    }
   99         -
    /// <p>The action taken in the response from the guardrail.</p>
  100         -
    pub fn get_action(&self) -> &::std::option::Option<crate::types::GuardrailAction> {
  101         -
        &self.action
  102         -
    }
  103         -
    /// <p>The reason for the action taken when harmful content is detected.</p>
  104         -
    pub fn action_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  105         -
        self.action_reason = ::std::option::Option::Some(input.into());
  106         -
        self
  107         -
    }
  108         -
    /// <p>The reason for the action taken when harmful content is detected.</p>
  109         -
    pub fn set_action_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  110         -
        self.action_reason = input;
  111         -
        self
  112         -
    }
  113         -
    /// <p>The reason for the action taken when harmful content is detected.</p>
  114         -
    pub fn get_action_reason(&self) -> &::std::option::Option<::std::string::String> {
  115         -
        &self.action_reason
  116         -
    }
  117         -
    /// Appends an item to `outputs`.
  118         -
    ///
  119         -
    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
  120         -
    ///
  121         -
    /// <p>The output details in the response from the guardrail.</p>
  122         -
    pub fn outputs(mut self, input: crate::types::GuardrailOutputContent) -> Self {
  123         -
        let mut v = self.outputs.unwrap_or_default();
  124         -
        v.push(input);
  125         -
        self.outputs = ::std::option::Option::Some(v);
  126         -
        self
  127         -
    }
  128         -
    /// <p>The output details in the response from the guardrail.</p>
  129         -
    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailOutputContent>>) -> Self {
  130         -
        self.outputs = input;
  131         -
        self
  132         -
    }
  133         -
    /// <p>The output details in the response from the guardrail.</p>
  134         -
    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailOutputContent>> {
  135         -
        &self.outputs
  136         -
    }
  137         -
    /// Appends an item to `assessments`.
  138         -
    ///
  139         -
    /// To override the contents of this collection use [`set_assessments`](Self::set_assessments).
  140         -
    ///
  141         -
    /// <p>The assessment details in the response from the guardrail.</p>
  142         -
    pub fn assessments(mut self, input: crate::types::GuardrailAssessment) -> Self {
  143         -
        let mut v = self.assessments.unwrap_or_default();
  144         -
        v.push(input);
  145         -
        self.assessments = ::std::option::Option::Some(v);
  146         -
        self
  147         -
    }
  148         -
    /// <p>The assessment details in the response from the guardrail.</p>
  149         -
    pub fn set_assessments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailAssessment>>) -> Self {
  150         -
        self.assessments = input;
  151         -
        self
  152         -
    }
  153         -
    /// <p>The assessment details in the response from the guardrail.</p>
  154         -
    pub fn get_assessments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailAssessment>> {
  155         -
        &self.assessments
  156         -
    }
  157         -
    /// <p>The guardrail coverage details in the apply guardrail response.</p>
  158         -
    pub fn guardrail_coverage(mut self, input: crate::types::GuardrailCoverage) -> Self {
  159         -
        self.guardrail_coverage = ::std::option::Option::Some(input);
  160         -
        self
  161         -
    }
  162         -
    /// <p>The guardrail coverage details in the apply guardrail response.</p>
  163         -
    pub fn set_guardrail_coverage(mut self, input: ::std::option::Option<crate::types::GuardrailCoverage>) -> Self {
  164         -
        self.guardrail_coverage = input;
  165         -
        self
  166         -
    }
  167         -
    /// <p>The guardrail coverage details in the apply guardrail response.</p>
  168         -
    pub fn get_guardrail_coverage(&self) -> &::std::option::Option<crate::types::GuardrailCoverage> {
  169         -
        &self.guardrail_coverage
  170         -
    }
  171         -
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
  172         -
        self._request_id = Some(request_id.into());
  173         -
        self
  174         -
    }
  175         -
  176         -
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
  177         -
        self._request_id = request_id;
  178         -
        self
  179         -
    }
  180         -
    /// Consumes the builder and constructs a [`ApplyGuardrailOutput`](crate::operation::apply_guardrail::ApplyGuardrailOutput).
  181         -
    /// This method will fail if any of the following fields are not set:
  182         -
    /// - [`action`](crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::action)
  183         -
    /// - [`outputs`](crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::outputs)
  184         -
    /// - [`assessments`](crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::assessments)
  185         -
    pub fn build(
  186         -
        self,
  187         -
    ) -> ::std::result::Result<crate::operation::apply_guardrail::ApplyGuardrailOutput, ::aws_smithy_types::error::operation::BuildError> {
  188         -
        ::std::result::Result::Ok(crate::operation::apply_guardrail::ApplyGuardrailOutput {
  189         -
            usage: self.usage,
  190         -
            action: self.action.ok_or_else(|| {
  191         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  192         -
                    "action",
  193         -
                    "action was not specified but it is required when building ApplyGuardrailOutput",
  194         -
                )
  195         -
            })?,
  196         -
            action_reason: self.action_reason,
  197         -
            outputs: self.outputs.ok_or_else(|| {
  198         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  199         -
                    "outputs",
  200         -
                    "outputs was not specified but it is required when building ApplyGuardrailOutput",
  201         -
                )
  202         -
            })?,
  203         -
            assessments: self.assessments.ok_or_else(|| {
  204         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  205         -
                    "assessments",
  206         -
                    "assessments was not specified but it is required when building ApplyGuardrailOutput",
  207         -
                )
  208         -
            })?,
  209         -
            guardrail_coverage: self.guardrail_coverage,
  210         -
            _request_id: self._request_id,
  211         -
        })
  212         -
    }
  213         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/apply_guardrail/builders.rs

@@ -1,0 +190,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::apply_guardrail::_apply_guardrail_output::ApplyGuardrailOutputBuilder;
    3         -
    4         -
pub use crate::operation::apply_guardrail::_apply_guardrail_input::ApplyGuardrailInputBuilder;
    5         -
    6         -
impl crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder {
    7         -
    /// Sends a request with this input using the given client.
    8         -
    pub async fn send_with(
    9         -
        self,
   10         -
        client: &crate::Client,
   11         -
    ) -> ::std::result::Result<
   12         -
        crate::operation::apply_guardrail::ApplyGuardrailOutput,
   13         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   14         -
            crate::operation::apply_guardrail::ApplyGuardrailError,
   15         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16         -
        >,
   17         -
    > {
   18         -
        let mut fluent_builder = client.apply_guardrail();
   19         -
        fluent_builder.inner = self;
   20         -
        fluent_builder.send().await
   21         -
    }
   22         -
}
   23         -
/// Fluent builder constructing a request to `ApplyGuardrail`.
   24         -
///
   25         -
/// <p>The action to apply a guardrail.</p>
   26         -
/// <p>For troubleshooting some of the common errors you might encounter when using the <code>ApplyGuardrail</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
   27         -
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   28         -
pub struct ApplyGuardrailFluentBuilder {
   29         -
    handle: ::std::sync::Arc<crate::client::Handle>,
   30         -
    inner: crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder,
   31         -
    config_override: ::std::option::Option<crate::config::Builder>,
   32         -
}
   33         -
impl
   34         -
    crate::client::customize::internal::CustomizableSend<
   35         -
        crate::operation::apply_guardrail::ApplyGuardrailOutput,
   36         -
        crate::operation::apply_guardrail::ApplyGuardrailError,
   37         -
    > for ApplyGuardrailFluentBuilder
   38         -
{
   39         -
    fn send(
   40         -
        self,
   41         -
        config_override: crate::config::Builder,
   42         -
    ) -> crate::client::customize::internal::BoxFuture<
   43         -
        crate::client::customize::internal::SendResult<
   44         -
            crate::operation::apply_guardrail::ApplyGuardrailOutput,
   45         -
            crate::operation::apply_guardrail::ApplyGuardrailError,
   46         -
        >,
   47         -
    > {
   48         -
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   49         -
    }
   50         -
}
   51         -
impl ApplyGuardrailFluentBuilder {
   52         -
    /// Creates a new `ApplyGuardrailFluentBuilder`.
   53         -
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   54         -
        Self {
   55         -
            handle,
   56         -
            inner: ::std::default::Default::default(),
   57         -
            config_override: ::std::option::Option::None,
   58         -
        }
   59         -
    }
   60         -
    /// Access the ApplyGuardrail as a reference.
   61         -
    pub fn as_input(&self) -> &crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder {
   62         -
        &self.inner
   63         -
    }
   64         -
    /// Sends the request and returns the response.
   65         -
    ///
   66         -
    /// If an error occurs, an `SdkError` will be returned with additional details that
   67         -
    /// can be matched against.
   68         -
    ///
   69         -
    /// By default, any retryable failures will be retried twice. Retry behavior
   70         -
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   71         -
    /// set when configuring the client.
   72         -
    pub async fn send(
   73         -
        self,
   74         -
    ) -> ::std::result::Result<
   75         -
        crate::operation::apply_guardrail::ApplyGuardrailOutput,
   76         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   77         -
            crate::operation::apply_guardrail::ApplyGuardrailError,
   78         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   79         -
        >,
   80         -
    > {
   81         -
        let input = self
   82         -
            .inner
   83         -
            .build()
   84         -
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   85         -
        let runtime_plugins = crate::operation::apply_guardrail::ApplyGuardrail::operation_runtime_plugins(
   86         -
            self.handle.runtime_plugins.clone(),
   87         -
            &self.handle.conf,
   88         -
            self.config_override,
   89         -
        );
   90         -
        crate::operation::apply_guardrail::ApplyGuardrail::orchestrate(&runtime_plugins, input).await
   91         -
    }
   92         -
   93         -
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   94         -
    pub fn customize(
   95         -
        self,
   96         -
    ) -> crate::client::customize::CustomizableOperation<
   97         -
        crate::operation::apply_guardrail::ApplyGuardrailOutput,
   98         -
        crate::operation::apply_guardrail::ApplyGuardrailError,
   99         -
        Self,
  100         -
    > {
  101         -
        crate::client::customize::CustomizableOperation::new(self)
  102         -
    }
  103         -
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  104         -
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  105         -
        self
  106         -
    }
  107         -
  108         -
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  109         -
        self.config_override = config_override;
  110         -
        self
  111         -
    }
  112         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
  113         -
    pub fn guardrail_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  114         -
        self.inner = self.inner.guardrail_identifier(input.into());
  115         -
        self
  116         -
    }
  117         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
  118         -
    pub fn set_guardrail_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  119         -
        self.inner = self.inner.set_guardrail_identifier(input);
  120         -
        self
  121         -
    }
  122         -
    /// <p>The guardrail identifier used in the request to apply the guardrail.</p>
  123         -
    pub fn get_guardrail_identifier(&self) -> &::std::option::Option<::std::string::String> {
  124         -
        self.inner.get_guardrail_identifier()
  125         -
    }
  126         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
  127         -
    pub fn guardrail_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  128         -
        self.inner = self.inner.guardrail_version(input.into());
  129         -
        self
  130         -
    }
  131         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
  132         -
    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  133         -
        self.inner = self.inner.set_guardrail_version(input);
  134         -
        self
  135         -
    }
  136         -
    /// <p>The guardrail version used in the request to apply the guardrail.</p>
  137         -
    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
  138         -
        self.inner.get_guardrail_version()
  139         -
    }
  140         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
  141         -
    pub fn source(mut self, input: crate::types::GuardrailContentSource) -> Self {
  142         -
        self.inner = self.inner.source(input);
  143         -
        self
  144         -
    }
  145         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
  146         -
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::GuardrailContentSource>) -> Self {
  147         -
        self.inner = self.inner.set_source(input);
  148         -
        self
  149         -
    }
  150         -
    /// <p>The source of data used in the request to apply the guardrail.</p>
  151         -
    pub fn get_source(&self) -> &::std::option::Option<crate::types::GuardrailContentSource> {
  152         -
        self.inner.get_source()
  153         -
    }
  154         -
    ///
  155         -
    /// Appends an item to `content`.
  156         -
    ///
  157         -
    /// To override the contents of this collection use [`set_content`](Self::set_content).
  158         -
    ///
  159         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  160         -
    pub fn content(mut self, input: crate::types::GuardrailContentBlock) -> Self {
  161         -
        self.inner = self.inner.content(input);
  162         -
        self
  163         -
    }
  164         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  165         -
    pub fn set_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>>) -> Self {
  166         -
        self.inner = self.inner.set_content(input);
  167         -
        self
  168         -
    }
  169         -
    /// <p>The content details used in the request to apply the guardrail.</p>
  170         -
    pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentBlock>> {
  171         -
        self.inner.get_content()
  172         -
    }
  173         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  174         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  175         -
    pub fn output_scope(mut self, input: crate::types::GuardrailOutputScope) -> Self {
  176         -
        self.inner = self.inner.output_scope(input);
  177         -
        self
  178         -
    }
  179         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  180         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  181         -
    pub fn set_output_scope(mut self, input: ::std::option::Option<crate::types::GuardrailOutputScope>) -> Self {
  182         -
        self.inner = self.inner.set_output_scope(input);
  183         -
        self
  184         -
    }
  185         -
    /// <p>Specifies the scope of the output that you get in the response. Set to <code>FULL</code> to return the entire output, including any detected and non-detected entries in the response for enhanced debugging.</p>
  186         -
    /// <p>Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).</p>
  187         -
    pub fn get_output_scope(&self) -> &::std::option::Option<crate::types::GuardrailOutputScope> {
  188         -
        self.inner.get_output_scope()
  189         -
    }
  190         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse.rs

@@ -71,71 +131,130 @@
   91     91   
            ConverseResponseDeserializer,
   92     92   
        ));
   93     93   
   94     94   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   95     95   
            crate::config::auth::Params::builder()
   96     96   
                .operation_name("Converse")
   97     97   
                .build()
   98     98   
                .expect("required fields set"),
   99     99   
        ));
  100    100   
  101         -
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
  102    101   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  103    102   
            "Converse",
  104    103   
            "Bedrock Runtime",
  105    104   
        ));
  106    105   
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
  107    106   
        signing_options.double_uri_encode = true;
  108    107   
        signing_options.content_sha256_header = false;
  109    108   
        signing_options.normalize_uri_path = true;
  110    109   
        signing_options.payload_override = None;
  111    110   
@@ -233,232 +451,437 @@
  253    252   
    }
  254    253   
}
  255    254   
  256    255   
// The get_* functions below are generated from JMESPath expressions in the
  257    256   
// operationContextParams trait. They target the operation's input shape.
  258    257   
  259    258   
/// Error type for the `ConverseError` operation.
  260    259   
#[non_exhaustive]
  261    260   
#[derive(::std::fmt::Debug)]
  262    261   
pub enum ConverseError {
  263         -
    /// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
         262  +
    /// <p>The request is denied because of missing access permissions.</p>
  264    263   
    AccessDeniedException(crate::types::error::AccessDeniedException),
  265         -
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
         264  +
    /// <p>An internal server error occurred. Retry your request.</p>
  266    265   
    InternalServerException(crate::types::error::InternalServerException),
  267    266   
    /// <p>The request failed due to an error while processing the model.</p>
  268    267   
    ModelErrorException(crate::types::error::ModelErrorException),
  269         -
    /// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
         268  +
    /// <p>The model specified in the request is not ready to serve inference requests.</p>
  270    269   
    ModelNotReadyException(crate::types::error::ModelNotReadyException),
  271    270   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
  272    271   
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
  273         -
    /// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
         272  +
    /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
  274    273   
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
  275         -
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
  276         -
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
  277         -
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
         274  +
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
  278    275   
    ThrottlingException(crate::types::error::ThrottlingException),
  279         -
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
         276  +
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
  280    277   
    ValidationException(crate::types::error::ValidationException),
  281    278   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  282    279   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  283    280   
    variable wildcard pattern and check `.code()`:
  284    281   
     \
  285    282   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  286    283   
     \
  287    284   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseError) for what information is available for the error.")]
  288    285   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  289    286   
}
  290    287   
impl ConverseError {
  291    288   
    /// Creates the `ConverseError::Unhandled` variant from any error type.
  292    289   
    pub fn unhandled(
  293    290   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  294    291   
    ) -> Self {
  295    292   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  296    293   
            source: err.into(),
  297    294   
            meta: ::std::default::Default::default(),
  298    295   
        })
  299    296   
    }
  300    297   
  301    298   
    /// Creates the `ConverseError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  302    299   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  303    300   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  304    301   
            source: err.clone().into(),
  305    302   
            meta: err,
  306    303   
        })
  307    304   
    }
  308    305   
    ///
  309    306   
    /// Returns error metadata, which includes the error code, message,
  310    307   
    /// request ID, and potentially additional information.
  311    308   
    ///
  312    309   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  313    310   
        match self {
  314    311   
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  315    312   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  316    313   
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  317    314   
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  318    315   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  319    316   
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  320         -
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  321    317   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  322    318   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  323    319   
            Self::Unhandled(e) => &e.meta,
  324    320   
        }
  325    321   
    }
  326    322   
    /// Returns `true` if the error kind is `ConverseError::AccessDeniedException`.
  327    323   
    pub fn is_access_denied_exception(&self) -> bool {
  328    324   
        matches!(self, Self::AccessDeniedException(_))
  329    325   
    }
  330    326   
    /// Returns `true` if the error kind is `ConverseError::InternalServerException`.
  331    327   
    pub fn is_internal_server_exception(&self) -> bool {
  332    328   
        matches!(self, Self::InternalServerException(_))
  333    329   
    }
  334    330   
    /// Returns `true` if the error kind is `ConverseError::ModelErrorException`.
  335    331   
    pub fn is_model_error_exception(&self) -> bool {
  336    332   
        matches!(self, Self::ModelErrorException(_))
  337    333   
    }
  338    334   
    /// Returns `true` if the error kind is `ConverseError::ModelNotReadyException`.
  339    335   
    pub fn is_model_not_ready_exception(&self) -> bool {
  340    336   
        matches!(self, Self::ModelNotReadyException(_))
  341    337   
    }
  342    338   
    /// Returns `true` if the error kind is `ConverseError::ModelTimeoutException`.
  343    339   
    pub fn is_model_timeout_exception(&self) -> bool {
  344    340   
        matches!(self, Self::ModelTimeoutException(_))
  345    341   
    }
  346    342   
    /// Returns `true` if the error kind is `ConverseError::ResourceNotFoundException`.
  347    343   
    pub fn is_resource_not_found_exception(&self) -> bool {
  348    344   
        matches!(self, Self::ResourceNotFoundException(_))
  349    345   
    }
  350         -
    /// Returns `true` if the error kind is `ConverseError::ServiceUnavailableException`.
  351         -
    pub fn is_service_unavailable_exception(&self) -> bool {
  352         -
        matches!(self, Self::ServiceUnavailableException(_))
  353         -
    }
  354    346   
    /// Returns `true` if the error kind is `ConverseError::ThrottlingException`.
  355    347   
    pub fn is_throttling_exception(&self) -> bool {
  356    348   
        matches!(self, Self::ThrottlingException(_))
  357    349   
    }
  358    350   
    /// Returns `true` if the error kind is `ConverseError::ValidationException`.
  359    351   
    pub fn is_validation_exception(&self) -> bool {
  360    352   
        matches!(self, Self::ValidationException(_))
  361    353   
    }
  362    354   
}
  363    355   
impl ::std::error::Error for ConverseError {
  364    356   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  365    357   
        match self {
  366    358   
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  367    359   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  368    360   
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
  369    361   
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
  370    362   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  371    363   
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
  372         -
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  373    364   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  374    365   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  375    366   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  376    367   
        }
  377    368   
    }
  378    369   
}
  379    370   
impl ::std::fmt::Display for ConverseError {
  380    371   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  381    372   
        match self {
  382    373   
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  383    374   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  384    375   
            Self::ModelErrorException(_inner) => _inner.fmt(f),
  385    376   
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
  386    377   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  387    378   
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
  388         -
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  389    379   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  390    380   
            Self::ValidationException(_inner) => _inner.fmt(f),
  391    381   
            Self::Unhandled(_inner) => {
  392    382   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  393    383   
                    write!(f, "unhandled error ({code})")
  394    384   
                } else {
  395    385   
                    f.write_str("unhandled error")
  396    386   
                }
  397    387   
            }
  398    388   
        }
  399    389   
    }
  400    390   
}
  401    391   
impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseError {
  402    392   
    fn code(&self) -> ::std::option::Option<&str> {
  403    393   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  404    394   
    }
  405    395   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  406         -
        match self {
  407         -
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
  408         -
            _ => ::std::option::Option::None,
  409         -
        }
         396  +
        ::std::option::Option::None
  410    397   
    }
  411    398   
}
  412    399   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseError {
  413    400   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  414    401   
        match self {
  415    402   
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  416    403   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  417    404   
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  418    405   
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  419    406   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  420    407   
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  421         -
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  422    408   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  423    409   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  424    410   
            Self::Unhandled(_inner) => &_inner.meta,
  425    411   
        }
  426    412   
    }
  427    413   
}
  428    414   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseError {
  429    415   
    fn create_unhandled_error(
  430    416   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  431    417   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse/_converse_input.rs

@@ -1,1 +437,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct ConverseInput {
    6         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
           6  +
    /// <p>The identifier for the model that you want to call.</p>
           7  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
    7      8   
    /// <ul>
    8      9   
    /// <li>
    9     10   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
   10     11   
    /// <li>
   11         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
   12         -
    /// <li>
   13     12   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
   14     13   
    /// <li>
   15     14   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
   16         -
    /// <li>
   17         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
   18     15   
    /// </ul>
   19         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
   20     16   
    pub model_id: ::std::option::Option<::std::string::String>,
   21     17   
    /// <p>The messages that you want to send to the model.</p>
   22     18   
    pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
   23         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
          19  +
    /// <p>A system prompt to pass to the model.</p>
   24     20   
    pub system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
   25         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
          21  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
   26     22   
    pub inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
   27         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
   28         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
          23  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
          24  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
          25  +
    /// </note>
   29     26   
    pub tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
   30         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
   31         -
    pub guardrail_config: ::std::option::Option<crate::types::GuardrailConfiguration>,
   32         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
          27  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
   33     28   
    pub additional_model_request_fields: ::std::option::Option<::aws_smithy_types::Document>,
   34         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
   35         -
    pub prompt_variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
   36         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
          29  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
   37     30   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   38     31   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
   39         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
          32  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
   40     33   
    pub additional_model_response_field_paths: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
   41         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
   42         -
    pub request_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   43         -
    /// <p>Model performance settings for the request.</p>
   44         -
    pub performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
   45     34   
}
   46     35   
impl ConverseInput {
   47         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
          36  +
    /// <p>The identifier for the model that you want to call.</p>
          37  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
   48     38   
    /// <ul>
   49     39   
    /// <li>
   50     40   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
   51     41   
    /// <li>
   52         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
   53         -
    /// <li>
   54     42   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
   55     43   
    /// <li>
   56     44   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
   57         -
    /// <li>
   58         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
   59     45   
    /// </ul>
   60         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
   61     46   
    pub fn model_id(&self) -> ::std::option::Option<&str> {
   62     47   
        self.model_id.as_deref()
   63     48   
    }
   64     49   
    /// <p>The messages that you want to send to the model.</p>
   65     50   
    ///
   66     51   
    /// 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()`.
   67     52   
    pub fn messages(&self) -> &[crate::types::Message] {
   68     53   
        self.messages.as_deref().unwrap_or_default()
   69     54   
    }
   70         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
          55  +
    /// <p>A system prompt to pass to the model.</p>
   71     56   
    ///
   72     57   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.system.is_none()`.
   73     58   
    pub fn system(&self) -> &[crate::types::SystemContentBlock] {
   74     59   
        self.system.as_deref().unwrap_or_default()
   75     60   
    }
   76         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
          61  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
   77     62   
    pub fn inference_config(&self) -> ::std::option::Option<&crate::types::InferenceConfiguration> {
   78     63   
        self.inference_config.as_ref()
   79     64   
    }
   80         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
   81         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
          65  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
          66  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
          67  +
    /// </note>
   82     68   
    pub fn tool_config(&self) -> ::std::option::Option<&crate::types::ToolConfiguration> {
   83     69   
        self.tool_config.as_ref()
   84     70   
    }
   85         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
   86         -
    pub fn guardrail_config(&self) -> ::std::option::Option<&crate::types::GuardrailConfiguration> {
   87         -
        self.guardrail_config.as_ref()
   88         -
    }
   89         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
          71  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
   90     72   
    pub fn additional_model_request_fields(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
   91     73   
        self.additional_model_request_fields.as_ref()
   92     74   
    }
   93         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
   94         -
    pub fn prompt_variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
   95         -
        self.prompt_variables.as_ref()
   96         -
    }
   97         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
          75  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
   98     76   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   99     77   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  100         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
          78  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  101     79   
    ///
  102     80   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_model_response_field_paths.is_none()`.
  103     81   
    pub fn additional_model_response_field_paths(&self) -> &[::std::string::String] {
  104     82   
        self.additional_model_response_field_paths.as_deref().unwrap_or_default()
  105     83   
    }
  106         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  107         -
    pub fn request_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  108         -
        self.request_metadata.as_ref()
  109         -
    }
  110         -
    /// <p>Model performance settings for the request.</p>
  111         -
    pub fn performance_config(&self) -> ::std::option::Option<&crate::types::PerformanceConfiguration> {
  112         -
        self.performance_config.as_ref()
  113         -
    }
  114         -
}
  115         -
impl ::std::fmt::Debug for ConverseInput {
  116         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  117         -
        let mut formatter = f.debug_struct("ConverseInput");
  118         -
        formatter.field("model_id", &self.model_id);
  119         -
        formatter.field("messages", &self.messages);
  120         -
        formatter.field("system", &self.system);
  121         -
        formatter.field("inference_config", &self.inference_config);
  122         -
        formatter.field("tool_config", &self.tool_config);
  123         -
        formatter.field("guardrail_config", &self.guardrail_config);
  124         -
        formatter.field("additional_model_request_fields", &self.additional_model_request_fields);
  125         -
        formatter.field("prompt_variables", &"*** Sensitive Data Redacted ***");
  126         -
        formatter.field("additional_model_response_field_paths", &self.additional_model_response_field_paths);
  127         -
        formatter.field("request_metadata", &"*** Sensitive Data Redacted ***");
  128         -
        formatter.field("performance_config", &self.performance_config);
  129         -
        formatter.finish()
  130         -
    }
  131     84   
}
  132     85   
impl ConverseInput {
  133     86   
    /// Creates a new builder-style object to manufacture [`ConverseInput`](crate::operation::converse::ConverseInput).
  134     87   
    pub fn builder() -> crate::operation::converse::builders::ConverseInputBuilder {
  135     88   
        crate::operation::converse::builders::ConverseInputBuilder::default()
  136     89   
    }
  137     90   
}
  138     91   
  139     92   
/// A builder for [`ConverseInput`](crate::operation::converse::ConverseInput).
  140         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
          93  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  141     94   
#[non_exhaustive]
  142     95   
pub struct ConverseInputBuilder {
  143     96   
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
  144     97   
    pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
  145     98   
    pub(crate) system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
  146     99   
    pub(crate) inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
  147    100   
    pub(crate) tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
  148         -
    pub(crate) guardrail_config: ::std::option::Option<crate::types::GuardrailConfiguration>,
  149    101   
    pub(crate) additional_model_request_fields: ::std::option::Option<::aws_smithy_types::Document>,
  150         -
    pub(crate) prompt_variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
  151    102   
    pub(crate) additional_model_response_field_paths: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  152         -
    pub(crate) request_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  153         -
    pub(crate) performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
  154    103   
}
  155    104   
impl ConverseInputBuilder {
  156         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         105  +
    /// <p>The identifier for the model that you want to call.</p>
         106  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  157    107   
    /// <ul>
  158    108   
    /// <li>
  159    109   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  160    110   
    /// <li>
  161         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  162         -
    /// <li>
  163    111   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  164    112   
    /// <li>
  165    113   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  166         -
    /// <li>
  167         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  168    114   
    /// </ul>
  169         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  170    115   
    /// This field is required.
  171    116   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  172    117   
        self.model_id = ::std::option::Option::Some(input.into());
  173    118   
        self
  174    119   
    }
  175         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         120  +
    /// <p>The identifier for the model that you want to call.</p>
         121  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  176    122   
    /// <ul>
  177    123   
    /// <li>
  178    124   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  179    125   
    /// <li>
  180         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  181         -
    /// <li>
  182    126   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  183    127   
    /// <li>
  184    128   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  185         -
    /// <li>
  186         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  187    129   
    /// </ul>
  188         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  189    130   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  190    131   
        self.model_id = input;
  191    132   
        self
  192    133   
    }
  193         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         134  +
    /// <p>The identifier for the model that you want to call.</p>
         135  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  194    136   
    /// <ul>
  195    137   
    /// <li>
  196    138   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  197    139   
    /// <li>
  198         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  199         -
    /// <li>
  200    140   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  201    141   
    /// <li>
  202    142   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  203         -
    /// <li>
  204         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  205    143   
    /// </ul>
  206         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  207    144   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  208    145   
        &self.model_id
  209    146   
    }
  210    147   
    /// Appends an item to `messages`.
  211    148   
    ///
  212    149   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  213    150   
    ///
  214    151   
    /// <p>The messages that you want to send to the model.</p>
  215    152   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  216    153   
        let mut v = self.messages.unwrap_or_default();
  217    154   
        v.push(input);
  218    155   
        self.messages = ::std::option::Option::Some(v);
  219    156   
        self
  220    157   
    }
  221    158   
    /// <p>The messages that you want to send to the model.</p>
  222    159   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  223    160   
        self.messages = input;
  224    161   
        self
  225    162   
    }
  226    163   
    /// <p>The messages that you want to send to the model.</p>
  227    164   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  228    165   
        &self.messages
  229    166   
    }
  230    167   
    /// Appends an item to `system`.
  231    168   
    ///
  232    169   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  233    170   
    ///
  234         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         171  +
    /// <p>A system prompt to pass to the model.</p>
  235    172   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  236    173   
        let mut v = self.system.unwrap_or_default();
  237    174   
        v.push(input);
  238    175   
        self.system = ::std::option::Option::Some(v);
  239    176   
        self
  240    177   
    }
  241         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         178  +
    /// <p>A system prompt to pass to the model.</p>
  242    179   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  243    180   
        self.system = input;
  244    181   
        self
  245    182   
    }
  246         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         183  +
    /// <p>A system prompt to pass to the model.</p>
  247    184   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  248    185   
        &self.system
  249    186   
    }
  250         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         187  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  251    188   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  252    189   
        self.inference_config = ::std::option::Option::Some(input);
  253    190   
        self
  254    191   
    }
  255         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         192  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  256    193   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  257    194   
        self.inference_config = input;
  258    195   
        self
  259    196   
    }
  260         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         197  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  261    198   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  262    199   
        &self.inference_config
  263    200   
    }
  264         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  265         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         201  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         202  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         203  +
    /// </note>
  266    204   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  267    205   
        self.tool_config = ::std::option::Option::Some(input);
  268    206   
        self
  269    207   
    }
  270         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  271         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         208  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         209  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         210  +
    /// </note>
  272    211   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  273    212   
        self.tool_config = input;
  274    213   
        self
  275    214   
    }
  276         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  277         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         215  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         216  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         217  +
    /// </note>
  278    218   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  279    219   
        &self.tool_config
  280    220   
    }
  281         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  282         -
    pub fn guardrail_config(mut self, input: crate::types::GuardrailConfiguration) -> Self {
  283         -
        self.guardrail_config = ::std::option::Option::Some(input);
  284         -
        self
  285         -
    }
  286         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  287         -
    pub fn set_guardrail_config(mut self, input: ::std::option::Option<crate::types::GuardrailConfiguration>) -> Self {
  288         -
        self.guardrail_config = input;
  289         -
        self
  290         -
    }
  291         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  292         -
    pub fn get_guardrail_config(&self) -> &::std::option::Option<crate::types::GuardrailConfiguration> {
  293         -
        &self.guardrail_config
  294         -
    }
  295         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         221  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  296    222   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  297    223   
        self.additional_model_request_fields = ::std::option::Option::Some(input);
  298    224   
        self
  299    225   
    }
  300         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         226  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  301    227   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  302    228   
        self.additional_model_request_fields = input;
  303    229   
        self
  304    230   
    }
  305         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         231  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  306    232   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  307    233   
        &self.additional_model_request_fields
  308    234   
    }
  309         -
    /// Adds a key-value pair to `prompt_variables`.
  310         -
    ///
  311         -
    /// To override the contents of this collection use [`set_prompt_variables`](Self::set_prompt_variables).
  312         -
    ///
  313         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  314         -
    pub fn prompt_variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PromptVariableValues) -> Self {
  315         -
        let mut hash_map = self.prompt_variables.unwrap_or_default();
  316         -
        hash_map.insert(k.into(), v);
  317         -
        self.prompt_variables = ::std::option::Option::Some(hash_map);
  318         -
        self
  319         -
    }
  320         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  321         -
    pub fn set_prompt_variables(
  322         -
        mut self,
  323         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
  324         -
    ) -> Self {
  325         -
        self.prompt_variables = input;
  326         -
        self
  327         -
    }
  328         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  329         -
    pub fn get_prompt_variables(
  330         -
        &self,
  331         -
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
  332         -
        &self.prompt_variables
  333         -
    }
  334    235   
    /// Appends an item to `additional_model_response_field_paths`.
  335    236   
    ///
  336    237   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  337    238   
    ///
  338         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         239  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  339    240   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  340    241   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  341         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         242  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  342    243   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  343    244   
        let mut v = self.additional_model_response_field_paths.unwrap_or_default();
  344    245   
        v.push(input.into());
  345    246   
        self.additional_model_response_field_paths = ::std::option::Option::Some(v);
  346    247   
        self
  347    248   
    }
  348         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         249  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  349    250   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  350    251   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  351         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         252  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  352    253   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  353    254   
        self.additional_model_response_field_paths = input;
  354    255   
        self
  355    256   
    }
  356         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         257  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  357    258   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  358    259   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  359         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         260  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  360    261   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  361    262   
        &self.additional_model_response_field_paths
  362    263   
    }
  363         -
    /// Adds a key-value pair to `request_metadata`.
  364         -
    ///
  365         -
    /// To override the contents of this collection use [`set_request_metadata`](Self::set_request_metadata).
  366         -
    ///
  367         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  368         -
    pub fn request_metadata(
  369         -
        mut self,
  370         -
        k: impl ::std::convert::Into<::std::string::String>,
  371         -
        v: impl ::std::convert::Into<::std::string::String>,
  372         -
    ) -> Self {
  373         -
        let mut hash_map = self.request_metadata.unwrap_or_default();
  374         -
        hash_map.insert(k.into(), v.into());
  375         -
        self.request_metadata = ::std::option::Option::Some(hash_map);
  376         -
        self
  377         -
    }
  378         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  379         -
    pub fn set_request_metadata(
  380         -
        mut self,
  381         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  382         -
    ) -> Self {
  383         -
        self.request_metadata = input;
  384         -
        self
  385         -
    }
  386         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  387         -
    pub fn get_request_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  388         -
        &self.request_metadata
  389         -
    }
  390         -
    /// <p>Model performance settings for the request.</p>
  391         -
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
  392         -
        self.performance_config = ::std::option::Option::Some(input);
  393         -
        self
  394         -
    }
  395         -
    /// <p>Model performance settings for the request.</p>
  396         -
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
  397         -
        self.performance_config = input;
  398         -
        self
  399         -
    }
  400         -
    /// <p>Model performance settings for the request.</p>
  401         -
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
  402         -
        &self.performance_config
  403         -
    }
  404    264   
    /// Consumes the builder and constructs a [`ConverseInput`](crate::operation::converse::ConverseInput).
  405    265   
    pub fn build(self) -> ::std::result::Result<crate::operation::converse::ConverseInput, ::aws_smithy_types::error::operation::BuildError> {
  406    266   
        ::std::result::Result::Ok(crate::operation::converse::ConverseInput {
  407    267   
            model_id: self.model_id,
  408    268   
            messages: self.messages,
  409    269   
            system: self.system,
  410    270   
            inference_config: self.inference_config,
  411    271   
            tool_config: self.tool_config,
  412         -
            guardrail_config: self.guardrail_config,
  413    272   
            additional_model_request_fields: self.additional_model_request_fields,
  414         -
            prompt_variables: self.prompt_variables,
  415    273   
            additional_model_response_field_paths: self.additional_model_response_field_paths,
  416         -
            request_metadata: self.request_metadata,
  417         -
            performance_config: self.performance_config,
  418    274   
        })
  419    275   
    }
  420    276   
}
  421         -
impl ::std::fmt::Debug for ConverseInputBuilder {
  422         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  423         -
        let mut formatter = f.debug_struct("ConverseInputBuilder");
  424         -
        formatter.field("model_id", &self.model_id);
  425         -
        formatter.field("messages", &self.messages);
  426         -
        formatter.field("system", &self.system);
  427         -
        formatter.field("inference_config", &self.inference_config);
  428         -
        formatter.field("tool_config", &self.tool_config);
  429         -
        formatter.field("guardrail_config", &self.guardrail_config);
  430         -
        formatter.field("additional_model_request_fields", &self.additional_model_request_fields);
  431         -
        formatter.field("prompt_variables", &"*** Sensitive Data Redacted ***");
  432         -
        formatter.field("additional_model_response_field_paths", &self.additional_model_response_field_paths);
  433         -
        formatter.field("request_metadata", &"*** Sensitive Data Redacted ***");
  434         -
        formatter.field("performance_config", &self.performance_config);
  435         -
        formatter.finish()
  436         -
    }
  437         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse/_converse_output.rs

@@ -1,1 +104,90 @@
    6      6   
    /// <p>The result from the call to <code>Converse</code>.</p>
    7      7   
    pub output: ::std::option::Option<crate::types::ConverseOutput>,
    8      8   
    /// <p>The reason why the model stopped generating output.</p>
    9      9   
    pub stop_reason: crate::types::StopReason,
   10     10   
    /// <p>The total number of tokens used in the call to <code>Converse</code>. The total includes the tokens input to the model and the tokens generated by the model.</p>
   11     11   
    pub usage: ::std::option::Option<crate::types::TokenUsage>,
   12     12   
    /// <p>Metrics for the call to <code>Converse</code>.</p>
   13     13   
    pub metrics: ::std::option::Option<crate::types::ConverseMetrics>,
   14     14   
    /// <p>Additional fields in the response that are unique to the model.</p>
   15     15   
    pub additional_model_response_fields: ::std::option::Option<::aws_smithy_types::Document>,
   16         -
    /// <p>A trace object that contains information about the Guardrail behavior.</p>
   17         -
    pub trace: ::std::option::Option<crate::types::ConverseTrace>,
   18         -
    /// <p>Model performance settings for the request.</p>
   19         -
    pub performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
   20     16   
    _request_id: Option<String>,
   21     17   
}
   22     18   
impl ConverseOutput {
   23     19   
    /// <p>The result from the call to <code>Converse</code>.</p>
   24     20   
    pub fn output(&self) -> ::std::option::Option<&crate::types::ConverseOutput> {
   25     21   
        self.output.as_ref()
   26     22   
    }
   27     23   
    /// <p>The reason why the model stopped generating output.</p>
   28     24   
    pub fn stop_reason(&self) -> &crate::types::StopReason {
   29     25   
        &self.stop_reason
   30     26   
    }
   31     27   
    /// <p>The total number of tokens used in the call to <code>Converse</code>. The total includes the tokens input to the model and the tokens generated by the model.</p>
   32     28   
    pub fn usage(&self) -> ::std::option::Option<&crate::types::TokenUsage> {
   33     29   
        self.usage.as_ref()
   34     30   
    }
   35     31   
    /// <p>Metrics for the call to <code>Converse</code>.</p>
   36     32   
    pub fn metrics(&self) -> ::std::option::Option<&crate::types::ConverseMetrics> {
   37     33   
        self.metrics.as_ref()
   38     34   
    }
   39     35   
    /// <p>Additional fields in the response that are unique to the model.</p>
   40     36   
    pub fn additional_model_response_fields(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
   41     37   
        self.additional_model_response_fields.as_ref()
   42     38   
    }
   43         -
    /// <p>A trace object that contains information about the Guardrail behavior.</p>
   44         -
    pub fn trace(&self) -> ::std::option::Option<&crate::types::ConverseTrace> {
   45         -
        self.trace.as_ref()
   46         -
    }
   47         -
    /// <p>Model performance settings for the request.</p>
   48         -
    pub fn performance_config(&self) -> ::std::option::Option<&crate::types::PerformanceConfiguration> {
   49         -
        self.performance_config.as_ref()
   50         -
    }
   51     39   
}
   52     40   
impl ::aws_types::request_id::RequestId for ConverseOutput {
   53     41   
    fn request_id(&self) -> Option<&str> {
   54     42   
        self._request_id.as_deref()
   55     43   
    }
   56     44   
}
   57     45   
impl ConverseOutput {
   58     46   
    /// Creates a new builder-style object to manufacture [`ConverseOutput`](crate::operation::converse::ConverseOutput).
   59     47   
    pub fn builder() -> crate::operation::converse::builders::ConverseOutputBuilder {
   60     48   
        crate::operation::converse::builders::ConverseOutputBuilder::default()
   61     49   
    }
   62     50   
}
   63     51   
   64     52   
/// A builder for [`ConverseOutput`](crate::operation::converse::ConverseOutput).
   65     53   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   66     54   
#[non_exhaustive]
   67     55   
pub struct ConverseOutputBuilder {
   68     56   
    pub(crate) output: ::std::option::Option<crate::types::ConverseOutput>,
   69     57   
    pub(crate) stop_reason: ::std::option::Option<crate::types::StopReason>,
   70     58   
    pub(crate) usage: ::std::option::Option<crate::types::TokenUsage>,
   71     59   
    pub(crate) metrics: ::std::option::Option<crate::types::ConverseMetrics>,
   72     60   
    pub(crate) additional_model_response_fields: ::std::option::Option<::aws_smithy_types::Document>,
   73         -
    pub(crate) trace: ::std::option::Option<crate::types::ConverseTrace>,
   74         -
    pub(crate) performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
   75     61   
    _request_id: Option<String>,
   76     62   
}
   77     63   
impl ConverseOutputBuilder {
   78     64   
    /// <p>The result from the call to <code>Converse</code>.</p>
   79     65   
    /// This field is required.
   80     66   
    pub fn output(mut self, input: crate::types::ConverseOutput) -> Self {
   81     67   
        self.output = ::std::option::Option::Some(input);
   82     68   
        self
   83     69   
    }
   84     70   
    /// <p>The result from the call to <code>Converse</code>.</p>
@@ -122,108 +209,165 @@
  142    128   
    }
  143    129   
    /// <p>Additional fields in the response that are unique to the model.</p>
  144    130   
    pub fn set_additional_model_response_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  145    131   
        self.additional_model_response_fields = input;
  146    132   
        self
  147    133   
    }
  148    134   
    /// <p>Additional fields in the response that are unique to the model.</p>
  149    135   
    pub fn get_additional_model_response_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  150    136   
        &self.additional_model_response_fields
  151    137   
    }
  152         -
    /// <p>A trace object that contains information about the Guardrail behavior.</p>
  153         -
    pub fn trace(mut self, input: crate::types::ConverseTrace) -> Self {
  154         -
        self.trace = ::std::option::Option::Some(input);
  155         -
        self
  156         -
    }
  157         -
    /// <p>A trace object that contains information about the Guardrail behavior.</p>
  158         -
    pub fn set_trace(mut self, input: ::std::option::Option<crate::types::ConverseTrace>) -> Self {
  159         -
        self.trace = input;
  160         -
        self
  161         -
    }
  162         -
    /// <p>A trace object that contains information about the Guardrail behavior.</p>
  163         -
    pub fn get_trace(&self) -> &::std::option::Option<crate::types::ConverseTrace> {
  164         -
        &self.trace
  165         -
    }
  166         -
    /// <p>Model performance settings for the request.</p>
  167         -
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
  168         -
        self.performance_config = ::std::option::Option::Some(input);
  169         -
        self
  170         -
    }
  171         -
    /// <p>Model performance settings for the request.</p>
  172         -
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
  173         -
        self.performance_config = input;
  174         -
        self
  175         -
    }
  176         -
    /// <p>Model performance settings for the request.</p>
  177         -
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
  178         -
        &self.performance_config
  179         -
    }
  180    138   
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
  181    139   
        self._request_id = Some(request_id.into());
  182    140   
        self
  183    141   
    }
  184    142   
  185    143   
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
  186    144   
        self._request_id = request_id;
  187    145   
        self
  188    146   
    }
  189    147   
    /// Consumes the builder and constructs a [`ConverseOutput`](crate::operation::converse::ConverseOutput).
  190    148   
    /// This method will fail if any of the following fields are not set:
  191    149   
    /// - [`stop_reason`](crate::operation::converse::builders::ConverseOutputBuilder::stop_reason)
  192    150   
    pub fn build(self) -> ::std::result::Result<crate::operation::converse::ConverseOutput, ::aws_smithy_types::error::operation::BuildError> {
  193    151   
        ::std::result::Result::Ok(crate::operation::converse::ConverseOutput {
  194    152   
            output: self.output,
  195    153   
            stop_reason: self.stop_reason.ok_or_else(|| {
  196    154   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  197    155   
                    "stop_reason",
  198    156   
                    "stop_reason was not specified but it is required when building ConverseOutput",
  199    157   
                )
  200    158   
            })?,
  201    159   
            usage: self.usage,
  202    160   
            metrics: self.metrics,
  203    161   
            additional_model_response_fields: self.additional_model_response_fields,
  204         -
            trace: self.trace,
  205         -
            performance_config: self.performance_config,
  206    162   
            _request_id: self._request_id,
  207    163   
        })
  208    164   
    }
  209    165   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse/builders.rs

@@ -1,1 +64,56 @@
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     16   
        >,
   17     17   
    > {
   18     18   
        let mut fluent_builder = client.converse();
   19     19   
        fluent_builder.inner = self;
   20     20   
        fluent_builder.send().await
   21     21   
    }
   22     22   
}
   23     23   
/// Fluent builder constructing a request to `Converse`.
   24     24   
///
   25         -
/// <p>Sends messages to the specified Amazon Bedrock model. <code>Converse</code> provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the model.</p>
   26         -
/// <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p>
   27         -
/// <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p>
   28         -
/// <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p>
   29         -
/// <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i></p>
   30         -
/// <p>For example code, see <i>Converse API examples</i> in the <i>Amazon Bedrock User Guide</i>.</p>
   31         -
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p><important>
   32         -
/// <p>To deny all inference access to resources that you specify in the modelId field, you need to deny access to the <code>bedrock:InvokeModel</code> and <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies access to the resource through the base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.</p>
   33         -
/// </important>
   34         -
/// <p>For troubleshooting some of the common errors you might encounter when using the <code>Converse</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
          25  +
/// <p>Sends messages to the specified Amazon Bedrock model. <code>Converse</code> provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
          26  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p>
   35     27   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   36     28   
pub struct ConverseFluentBuilder {
   37     29   
    handle: ::std::sync::Arc<crate::client::Handle>,
   38     30   
    inner: crate::operation::converse::builders::ConverseInputBuilder,
   39     31   
    config_override: ::std::option::Option<crate::config::Builder>,
   40     32   
}
   41     33   
impl crate::client::customize::internal::CustomizableSend<crate::operation::converse::ConverseOutput, crate::operation::converse::ConverseError>
   42     34   
    for ConverseFluentBuilder
   43     35   
{
   44     36   
    fn send(
@@ -81,73 +353,258 @@
  101     93   
    }
  102     94   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103     95   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104     96   
        self
  105     97   
    }
  106     98   
  107     99   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    100   
        self.config_override = config_override;
  109    101   
        self
  110    102   
    }
  111         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         103  +
    /// <p>The identifier for the model that you want to call.</p>
         104  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  112    105   
    /// <ul>
  113    106   
    /// <li>
  114    107   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  115    108   
    /// <li>
  116         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  117         -
    /// <li>
  118    109   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  119    110   
    /// <li>
  120    111   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  121         -
    /// <li>
  122         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  123    112   
    /// </ul>
  124         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  125    113   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  126    114   
        self.inner = self.inner.model_id(input.into());
  127    115   
        self
  128    116   
    }
  129         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         117  +
    /// <p>The identifier for the model that you want to call.</p>
         118  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  130    119   
    /// <ul>
  131    120   
    /// <li>
  132    121   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  133    122   
    /// <li>
  134         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  135         -
    /// <li>
  136    123   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  137    124   
    /// <li>
  138    125   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  139         -
    /// <li>
  140         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  141    126   
    /// </ul>
  142         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  143    127   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  144    128   
        self.inner = self.inner.set_model_id(input);
  145    129   
        self
  146    130   
    }
  147         -
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
         131  +
    /// <p>The identifier for the model that you want to call.</p>
         132  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  148    133   
    /// <ul>
  149    134   
    /// <li>
  150    135   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  151    136   
    /// <li>
  152         -
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
  153         -
    /// <li>
  154    137   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  155    138   
    /// <li>
  156    139   
    /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
  157         -
    /// <li>
  158         -
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  159    140   
    /// </ul>
  160         -
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  161    141   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  162    142   
        self.inner.get_model_id()
  163    143   
    }
  164    144   
    ///
  165    145   
    /// Appends an item to `messages`.
  166    146   
    ///
  167    147   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  168    148   
    ///
  169    149   
    /// <p>The messages that you want to send to the model.</p>
  170    150   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  171    151   
        self.inner = self.inner.messages(input);
  172    152   
        self
  173    153   
    }
  174    154   
    /// <p>The messages that you want to send to the model.</p>
  175    155   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  176    156   
        self.inner = self.inner.set_messages(input);
  177    157   
        self
  178    158   
    }
  179    159   
    /// <p>The messages that you want to send to the model.</p>
  180    160   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  181    161   
        self.inner.get_messages()
  182    162   
    }
  183    163   
    ///
  184    164   
    /// Appends an item to `system`.
  185    165   
    ///
  186    166   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  187    167   
    ///
  188         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         168  +
    /// <p>A system prompt to pass to the model.</p>
  189    169   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  190    170   
        self.inner = self.inner.system(input);
  191    171   
        self
  192    172   
    }
  193         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         173  +
    /// <p>A system prompt to pass to the model.</p>
  194    174   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  195    175   
        self.inner = self.inner.set_system(input);
  196    176   
        self
  197    177   
    }
  198         -
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
         178  +
    /// <p>A system prompt to pass to the model.</p>
  199    179   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  200    180   
        self.inner.get_system()
  201    181   
    }
  202         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         182  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  203    183   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  204    184   
        self.inner = self.inner.inference_config(input);
  205    185   
        self
  206    186   
    }
  207         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         187  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  208    188   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  209    189   
        self.inner = self.inner.set_inference_config(input);
  210    190   
        self
  211    191   
    }
  212         -
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         192  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  213    193   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  214    194   
        self.inner.get_inference_config()
  215    195   
    }
  216         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  217         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         196  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         197  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         198  +
    /// </note>
  218    199   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  219    200   
        self.inner = self.inner.tool_config(input);
  220    201   
        self
  221    202   
    }
  222         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  223         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         203  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         204  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         205  +
    /// </note>
  224    206   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  225    207   
        self.inner = self.inner.set_tool_config(input);
  226    208   
        self
  227    209   
    }
  228         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  229         -
    /// <p>For information about models that support tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
         210  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         211  +
    /// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
         212  +
    /// </note>
  230    213   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  231    214   
        self.inner.get_tool_config()
  232    215   
    }
  233         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  234         -
    pub fn guardrail_config(mut self, input: crate::types::GuardrailConfiguration) -> Self {
  235         -
        self.inner = self.inner.guardrail_config(input);
  236         -
        self
  237         -
    }
  238         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  239         -
    pub fn set_guardrail_config(mut self, input: ::std::option::Option<crate::types::GuardrailConfiguration>) -> Self {
  240         -
        self.inner = self.inner.set_guardrail_config(input);
  241         -
        self
  242         -
    }
  243         -
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
  244         -
    pub fn get_guardrail_config(&self) -> &::std::option::Option<crate::types::GuardrailConfiguration> {
  245         -
        self.inner.get_guardrail_config()
  246         -
    }
  247         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         216  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  248    217   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  249    218   
        self.inner = self.inner.additional_model_request_fields(input);
  250    219   
        self
  251    220   
    }
  252         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         221  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  253    222   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  254    223   
        self.inner = self.inner.set_additional_model_request_fields(input);
  255    224   
        self
  256    225   
    }
  257         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
         226  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  258    227   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  259    228   
        self.inner.get_additional_model_request_fields()
  260    229   
    }
  261    230   
    ///
  262         -
    /// Adds a key-value pair to `promptVariables`.
  263         -
    ///
  264         -
    /// To override the contents of this collection use [`set_prompt_variables`](Self::set_prompt_variables).
  265         -
    ///
  266         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  267         -
    pub fn prompt_variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PromptVariableValues) -> Self {
  268         -
        self.inner = self.inner.prompt_variables(k.into(), v);
  269         -
        self
  270         -
    }
  271         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  272         -
    pub fn set_prompt_variables(
  273         -
        mut self,
  274         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
  275         -
    ) -> Self {
  276         -
        self.inner = self.inner.set_prompt_variables(input);
  277         -
        self
  278         -
    }
  279         -
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
  280         -
    pub fn get_prompt_variables(
  281         -
        &self,
  282         -
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
  283         -
        self.inner.get_prompt_variables()
  284         -
    }
  285         -
    ///
  286    231   
    /// Appends an item to `additionalModelResponseFieldPaths`.
  287    232   
    ///
  288    233   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  289    234   
    ///
  290         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         235  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  291    236   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  292    237   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  293         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         238  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  294    239   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  295    240   
        self.inner = self.inner.additional_model_response_field_paths(input.into());
  296    241   
        self
  297    242   
    }
  298         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         243  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  299    244   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  300    245   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  301         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         246  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  302    247   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  303    248   
        self.inner = self.inner.set_additional_model_response_field_paths(input);
  304    249   
        self
  305    250   
    }
  306         -
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         251  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  307    252   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  308    253   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  309         -
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
         254  +
    /// <p><code>Converse</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  310    255   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  311    256   
        self.inner.get_additional_model_response_field_paths()
  312    257   
    }
  313         -
    ///
  314         -
    /// Adds a key-value pair to `requestMetadata`.
  315         -
    ///
  316         -
    /// To override the contents of this collection use [`set_request_metadata`](Self::set_request_metadata).
  317         -
    ///
  318         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  319         -
    pub fn request_metadata(
  320         -
        mut self,
  321         -
        k: impl ::std::convert::Into<::std::string::String>,
  322         -
        v: impl ::std::convert::Into<::std::string::String>,
  323         -
    ) -> Self {
  324         -
        self.inner = self.inner.request_metadata(k.into(), v.into());
  325         -
        self
  326         -
    }
  327         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  328         -
    pub fn set_request_metadata(
  329         -
        mut self,
  330         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  331         -
    ) -> Self {
  332         -
        self.inner = self.inner.set_request_metadata(input);
  333         -
        self
  334         -
    }
  335         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  336         -
    pub fn get_request_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  337         -
        self.inner.get_request_metadata()
  338         -
    }
  339         -
    /// <p>Model performance settings for the request.</p>
  340         -
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
  341         -
        self.inner = self.inner.performance_config(input);
  342         -
        self
  343         -
    }
  344         -
    /// <p>Model performance settings for the request.</p>
  345         -
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
  346         -
        self.inner = self.inner.set_performance_config(input);
  347         -
        self
  348         -
    }
  349         -
    /// <p>Model performance settings for the request.</p>
  350         -
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
  351         -
        self.inner.get_performance_config()
  352         -
    }
  353    258   
}