AWS SDK

AWS SDK

rev. db10d8b7d1ddffb641e5651cb5b4c7c7d63bda6a

Files changed:

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

@@ -0,1 +0,155 @@
           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

@@ -0,1 +0,213 @@
           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

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

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

@@ -1,1 +0,437 @@
    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, ::std::fmt::Debug)]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    5      5   
pub struct ConverseInput {
    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>
           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>
    8      7   
    /// <ul>
    9      8   
    /// <li>
   10      9   
    /// <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>
   11     10   
    /// <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>
   12     13   
    /// <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>
   13     14   
    /// <li>
   14     15   
    /// <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>
   15     18   
    /// </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>
   16     20   
    pub model_id: ::std::option::Option<::std::string::String>,
   17     21   
    /// <p>The messages that you want to send to the model.</p>
   18     22   
    pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
   19         -
    /// <p>A system prompt to pass to the model.</p>
          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>
   20     24   
    pub system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
   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>
          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>
   22     26   
    pub inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
   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>
          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>
   26     29   
    pub tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
   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>
          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>
   28     33   
    pub additional_model_request_fields: ::std::option::Option<::aws_smithy_types::Document>,
   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>
          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>
   30     37   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   31     38   
    /// <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>
   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>
          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>
   33     40   
    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>,
   34     45   
}
   35     46   
impl ConverseInput {
   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>
          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>
   38     48   
    /// <ul>
   39     49   
    /// <li>
   40     50   
    /// <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>
   41     51   
    /// <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>
   42     54   
    /// <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>
   43     55   
    /// <li>
   44     56   
    /// <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>
   45     59   
    /// </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>
   46     61   
    pub fn model_id(&self) -> ::std::option::Option<&str> {
   47     62   
        self.model_id.as_deref()
   48     63   
    }
   49     64   
    /// <p>The messages that you want to send to the model.</p>
   50     65   
    ///
   51     66   
    /// 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()`.
   52     67   
    pub fn messages(&self) -> &[crate::types::Message] {
   53     68   
        self.messages.as_deref().unwrap_or_default()
   54     69   
    }
   55         -
    /// <p>A system prompt to pass to the model.</p>
          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>
   56     71   
    ///
   57     72   
    /// 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()`.
   58     73   
    pub fn system(&self) -> &[crate::types::SystemContentBlock] {
   59     74   
        self.system.as_deref().unwrap_or_default()
   60     75   
    }
   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>
          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>
   62     77   
    pub fn inference_config(&self) -> ::std::option::Option<&crate::types::InferenceConfiguration> {
   63     78   
        self.inference_config.as_ref()
   64     79   
    }
   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>
          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>
   68     82   
    pub fn tool_config(&self) -> ::std::option::Option<&crate::types::ToolConfiguration> {
   69     83   
        self.tool_config.as_ref()
   70     84   
    }
   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>
          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>
   72     90   
    pub fn additional_model_request_fields(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
   73     91   
        self.additional_model_request_fields.as_ref()
   74     92   
    }
   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>
          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>
   76     98   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   77     99   
    /// <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>
   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>
         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>
   79    101   
    ///
   80    102   
    /// 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()`.
   81    103   
    pub fn additional_model_response_field_paths(&self) -> &[::std::string::String] {
   82    104   
        self.additional_model_response_field_paths.as_deref().unwrap_or_default()
   83    105   
    }
         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  +
    }
   84    131   
}
   85    132   
impl ConverseInput {
   86    133   
    /// Creates a new builder-style object to manufacture [`ConverseInput`](crate::operation::converse::ConverseInput).
   87    134   
    pub fn builder() -> crate::operation::converse::builders::ConverseInputBuilder {
   88    135   
        crate::operation::converse::builders::ConverseInputBuilder::default()
   89    136   
    }
   90    137   
}
   91    138   
   92    139   
/// A builder for [`ConverseInput`](crate::operation::converse::ConverseInput).
   93         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         140  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   94    141   
#[non_exhaustive]
   95    142   
pub struct ConverseInputBuilder {
   96    143   
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
   97    144   
    pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
   98    145   
    pub(crate) system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
   99    146   
    pub(crate) inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
  100    147   
    pub(crate) tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
         148  +
    pub(crate) guardrail_config: ::std::option::Option<crate::types::GuardrailConfiguration>,
  101    149   
    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>>,
  102    151   
    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>,
  103    154   
}
  104    155   
impl ConverseInputBuilder {
  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>
         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>
  107    157   
    /// <ul>
  108    158   
    /// <li>
  109    159   
    /// <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>
  110    160   
    /// <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>
  111    163   
    /// <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>
  112    164   
    /// <li>
  113    165   
    /// <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>
  114    168   
    /// </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>
  115    170   
    /// This field is required.
  116    171   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  117    172   
        self.model_id = ::std::option::Option::Some(input.into());
  118    173   
        self
  119    174   
    }
  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>
         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>
  122    176   
    /// <ul>
  123    177   
    /// <li>
  124    178   
    /// <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>
  125    179   
    /// <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>
  126    182   
    /// <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>
  127    183   
    /// <li>
  128    184   
    /// <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>
  129    187   
    /// </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>
  130    189   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  131    190   
        self.model_id = input;
  132    191   
        self
  133    192   
    }
  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>
         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>
  136    194   
    /// <ul>
  137    195   
    /// <li>
  138    196   
    /// <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>
  139    197   
    /// <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>
  140    200   
    /// <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>
  141    201   
    /// <li>
  142    202   
    /// <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>
  143    205   
    /// </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>
  144    207   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  145    208   
        &self.model_id
  146    209   
    }
  147    210   
    /// Appends an item to `messages`.
  148    211   
    ///
  149    212   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  150    213   
    ///
  151    214   
    /// <p>The messages that you want to send to the model.</p>
  152    215   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  153    216   
        let mut v = self.messages.unwrap_or_default();
  154    217   
        v.push(input);
  155    218   
        self.messages = ::std::option::Option::Some(v);
  156    219   
        self
  157    220   
    }
  158    221   
    /// <p>The messages that you want to send to the model.</p>
  159    222   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  160    223   
        self.messages = input;
  161    224   
        self
  162    225   
    }
  163    226   
    /// <p>The messages that you want to send to the model.</p>
  164    227   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  165    228   
        &self.messages
  166    229   
    }
  167    230   
    /// Appends an item to `system`.
  168    231   
    ///
  169    232   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  170    233   
    ///
  171         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  172    235   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  173    236   
        let mut v = self.system.unwrap_or_default();
  174    237   
        v.push(input);
  175    238   
        self.system = ::std::option::Option::Some(v);
  176    239   
        self
  177    240   
    }
  178         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  179    242   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  180    243   
        self.system = input;
  181    244   
        self
  182    245   
    }
  183         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  184    247   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  185    248   
        &self.system
  186    249   
    }
  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>
         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>
  188    251   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  189    252   
        self.inference_config = ::std::option::Option::Some(input);
  190    253   
        self
  191    254   
    }
  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>
         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>
  193    256   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  194    257   
        self.inference_config = input;
  195    258   
        self
  196    259   
    }
  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>
         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>
  198    261   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  199    262   
        &self.inference_config
  200    263   
    }
  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>
         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>
  204    266   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  205    267   
        self.tool_config = ::std::option::Option::Some(input);
  206    268   
        self
  207    269   
    }
  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>
         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>
  211    272   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  212    273   
        self.tool_config = input;
  213    274   
        self
  214    275   
    }
  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>
         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>
  218    278   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  219    279   
        &self.tool_config
  220    280   
    }
  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>
         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>
  222    296   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  223    297   
        self.additional_model_request_fields = ::std::option::Option::Some(input);
  224    298   
        self
  225    299   
    }
  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>
         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>
  227    301   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  228    302   
        self.additional_model_request_fields = input;
  229    303   
        self
  230    304   
    }
  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>
         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>
  232    306   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  233    307   
        &self.additional_model_request_fields
  234    308   
    }
         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  +
    }
  235    334   
    /// Appends an item to `additional_model_response_field_paths`.
  236    335   
    ///
  237    336   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  238    337   
    ///
  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>
         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>
  240    339   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  241    340   
    /// <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>
  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>
         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>
  243    342   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  244    343   
        let mut v = self.additional_model_response_field_paths.unwrap_or_default();
  245    344   
        v.push(input.into());
  246    345   
        self.additional_model_response_field_paths = ::std::option::Option::Some(v);
  247    346   
        self
  248    347   
    }
  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>
         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>
  250    349   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  251    350   
    /// <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>
  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>
         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>
  253    352   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  254    353   
        self.additional_model_response_field_paths = input;
  255    354   
        self
  256    355   
    }
  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>
         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>
  258    357   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  259    358   
    /// <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>
  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>
         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>
  261    360   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  262    361   
        &self.additional_model_response_field_paths
  263    362   
    }
         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  +
    }
  264    404   
    /// Consumes the builder and constructs a [`ConverseInput`](crate::operation::converse::ConverseInput).
  265    405   
    pub fn build(self) -> ::std::result::Result<crate::operation::converse::ConverseInput, ::aws_smithy_types::error::operation::BuildError> {
  266    406   
        ::std::result::Result::Ok(crate::operation::converse::ConverseInput {
  267    407   
            model_id: self.model_id,
  268    408   
            messages: self.messages,
  269    409   
            system: self.system,
  270    410   
            inference_config: self.inference_config,
  271    411   
            tool_config: self.tool_config,
         412  +
            guardrail_config: self.guardrail_config,
  272    413   
            additional_model_request_fields: self.additional_model_request_fields,
         414  +
            prompt_variables: self.prompt_variables,
  273    415   
            additional_model_response_field_paths: self.additional_model_response_field_paths,
         416  +
            request_metadata: self.request_metadata,
         417  +
            performance_config: self.performance_config,
  274    418   
        })
  275    419   
    }
  276    420   
}
         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 +90,104 @@
    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>,
   16     20   
    _request_id: Option<String>,
   17     21   
}
   18     22   
impl ConverseOutput {
   19     23   
    /// <p>The result from the call to <code>Converse</code>.</p>
   20     24   
    pub fn output(&self) -> ::std::option::Option<&crate::types::ConverseOutput> {
   21     25   
        self.output.as_ref()
   22     26   
    }
   23     27   
    /// <p>The reason why the model stopped generating output.</p>
   24     28   
    pub fn stop_reason(&self) -> &crate::types::StopReason {
   25     29   
        &self.stop_reason
   26     30   
    }
   27     31   
    /// <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>
   28     32   
    pub fn usage(&self) -> ::std::option::Option<&crate::types::TokenUsage> {
   29     33   
        self.usage.as_ref()
   30     34   
    }
   31     35   
    /// <p>Metrics for the call to <code>Converse</code>.</p>
   32     36   
    pub fn metrics(&self) -> ::std::option::Option<&crate::types::ConverseMetrics> {
   33     37   
        self.metrics.as_ref()
   34     38   
    }
   35     39   
    /// <p>Additional fields in the response that are unique to the model.</p>
   36     40   
    pub fn additional_model_response_fields(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
   37     41   
        self.additional_model_response_fields.as_ref()
   38     42   
    }
          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  +
    }
   39     51   
}
   40     52   
impl ::aws_types::request_id::RequestId for ConverseOutput {
   41     53   
    fn request_id(&self) -> Option<&str> {
   42     54   
        self._request_id.as_deref()
   43     55   
    }
   44     56   
}
   45     57   
impl ConverseOutput {
   46     58   
    /// Creates a new builder-style object to manufacture [`ConverseOutput`](crate::operation::converse::ConverseOutput).
   47     59   
    pub fn builder() -> crate::operation::converse::builders::ConverseOutputBuilder {
   48     60   
        crate::operation::converse::builders::ConverseOutputBuilder::default()
   49     61   
    }
   50     62   
}
   51     63   
   52     64   
/// A builder for [`ConverseOutput`](crate::operation::converse::ConverseOutput).
   53     65   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   54     66   
#[non_exhaustive]
   55     67   
pub struct ConverseOutputBuilder {
   56     68   
    pub(crate) output: ::std::option::Option<crate::types::ConverseOutput>,
   57     69   
    pub(crate) stop_reason: ::std::option::Option<crate::types::StopReason>,
   58     70   
    pub(crate) usage: ::std::option::Option<crate::types::TokenUsage>,
   59     71   
    pub(crate) metrics: ::std::option::Option<crate::types::ConverseMetrics>,
   60     72   
    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>,
   61     75   
    _request_id: Option<String>,
   62     76   
}
   63     77   
impl ConverseOutputBuilder {
   64     78   
    /// <p>The result from the call to <code>Converse</code>.</p>
   65     79   
    /// This field is required.
   66     80   
    pub fn output(mut self, input: crate::types::ConverseOutput) -> Self {
   67     81   
        self.output = ::std::option::Option::Some(input);
   68     82   
        self
   69     83   
    }
   70     84   
    /// <p>The result from the call to <code>Converse</code>.</p>
@@ -108,122 +165,209 @@
  128    142   
    }
  129    143   
    /// <p>Additional fields in the response that are unique to the model.</p>
  130    144   
    pub fn set_additional_model_response_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  131    145   
        self.additional_model_response_fields = input;
  132    146   
        self
  133    147   
    }
  134    148   
    /// <p>Additional fields in the response that are unique to the model.</p>
  135    149   
    pub fn get_additional_model_response_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  136    150   
        &self.additional_model_response_fields
  137    151   
    }
         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  +
    }
  138    180   
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
  139    181   
        self._request_id = Some(request_id.into());
  140    182   
        self
  141    183   
    }
  142    184   
  143    185   
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
  144    186   
        self._request_id = request_id;
  145    187   
        self
  146    188   
    }
  147    189   
    /// Consumes the builder and constructs a [`ConverseOutput`](crate::operation::converse::ConverseOutput).
  148    190   
    /// This method will fail if any of the following fields are not set:
  149    191   
    /// - [`stop_reason`](crate::operation::converse::builders::ConverseOutputBuilder::stop_reason)
  150    192   
    pub fn build(self) -> ::std::result::Result<crate::operation::converse::ConverseOutput, ::aws_smithy_types::error::operation::BuildError> {
  151    193   
        ::std::result::Result::Ok(crate::operation::converse::ConverseOutput {
  152    194   
            output: self.output,
  153    195   
            stop_reason: self.stop_reason.ok_or_else(|| {
  154    196   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  155    197   
                    "stop_reason",
  156    198   
                    "stop_reason was not specified but it is required when building ConverseOutput",
  157    199   
                )
  158    200   
            })?,
  159    201   
            usage: self.usage,
  160    202   
            metrics: self.metrics,
  161    203   
            additional_model_response_fields: self.additional_model_response_fields,
         204  +
            trace: self.trace,
         205  +
            performance_config: self.performance_config,
  162    206   
            _request_id: self._request_id,
  163    207   
        })
  164    208   
    }
  165    209   
}

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

@@ -1,1 +56,64 @@
   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. 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>
          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>
   27     35   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   28     36   
pub struct ConverseFluentBuilder {
   29     37   
    handle: ::std::sync::Arc<crate::client::Handle>,
   30     38   
    inner: crate::operation::converse::builders::ConverseInputBuilder,
   31     39   
    config_override: ::std::option::Option<crate::config::Builder>,
   32     40   
}
   33     41   
impl crate::client::customize::internal::CustomizableSend<crate::operation::converse::ConverseOutput, crate::operation::converse::ConverseError>
   34     42   
    for ConverseFluentBuilder
   35     43   
{
   36     44   
    fn send(
@@ -73,81 +258,353 @@
   93    101   
    }
   94    102   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
   95    103   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
   96    104   
        self
   97    105   
    }
   98    106   
   99    107   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  100    108   
        self.config_override = config_override;
  101    109   
        self
  102    110   
    }
  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>
         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>
  105    112   
    /// <ul>
  106    113   
    /// <li>
  107    114   
    /// <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>
  108    115   
    /// <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>
  109    118   
    /// <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>
  110    119   
    /// <li>
  111    120   
    /// <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>
  112    123   
    /// </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>
  113    125   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  114    126   
        self.inner = self.inner.model_id(input.into());
  115    127   
        self
  116    128   
    }
  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>
         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>
  119    130   
    /// <ul>
  120    131   
    /// <li>
  121    132   
    /// <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>
  122    133   
    /// <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>
  123    136   
    /// <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>
  124    137   
    /// <li>
  125    138   
    /// <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>
  126    141   
    /// </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>
  127    143   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  128    144   
        self.inner = self.inner.set_model_id(input);
  129    145   
        self
  130    146   
    }
  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>
         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>
  133    148   
    /// <ul>
  134    149   
    /// <li>
  135    150   
    /// <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>
  136    151   
    /// <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>
  137    154   
    /// <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>
  138    155   
    /// <li>
  139    156   
    /// <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>
  140    159   
    /// </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>
  141    161   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  142    162   
        self.inner.get_model_id()
  143    163   
    }
  144    164   
    ///
  145    165   
    /// Appends an item to `messages`.
  146    166   
    ///
  147    167   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  148    168   
    ///
  149    169   
    /// <p>The messages that you want to send to the model.</p>
  150    170   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  151    171   
        self.inner = self.inner.messages(input);
  152    172   
        self
  153    173   
    }
  154    174   
    /// <p>The messages that you want to send to the model.</p>
  155    175   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  156    176   
        self.inner = self.inner.set_messages(input);
  157    177   
        self
  158    178   
    }
  159    179   
    /// <p>The messages that you want to send to the model.</p>
  160    180   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  161    181   
        self.inner.get_messages()
  162    182   
    }
  163    183   
    ///
  164    184   
    /// Appends an item to `system`.
  165    185   
    ///
  166    186   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  167    187   
    ///
  168         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  169    189   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  170    190   
        self.inner = self.inner.system(input);
  171    191   
        self
  172    192   
    }
  173         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  174    194   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  175    195   
        self.inner = self.inner.set_system(input);
  176    196   
        self
  177    197   
    }
  178         -
    /// <p>A system prompt to pass to the model.</p>
         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>
  179    199   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  180    200   
        self.inner.get_system()
  181    201   
    }
  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>
         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>
  183    203   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  184    204   
        self.inner = self.inner.inference_config(input);
  185    205   
        self
  186    206   
    }
  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>
         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>
  188    208   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  189    209   
        self.inner = self.inner.set_inference_config(input);
  190    210   
        self
  191    211   
    }
  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>
         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>
  193    213   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  194    214   
        self.inner.get_inference_config()
  195    215   
    }
  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>
         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>
  199    218   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  200    219   
        self.inner = self.inner.tool_config(input);
  201    220   
        self
  202    221   
    }
  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>
         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>
  206    224   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  207    225   
        self.inner = self.inner.set_tool_config(input);
  208    226   
        self
  209    227   
    }
  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>
         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>
  213    230   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  214    231   
        self.inner.get_tool_config()
  215    232   
    }
  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>
         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>
  217    248   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  218    249   
        self.inner = self.inner.additional_model_request_fields(input);
  219    250   
        self
  220    251   
    }
  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>
         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>
  222    253   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  223    254   
        self.inner = self.inner.set_additional_model_request_fields(input);
  224    255   
        self
  225    256   
    }
  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>
         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>
  227    258   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  228    259   
        self.inner.get_additional_model_request_fields()
  229    260   
    }
  230    261   
    ///
         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  +
    ///
  231    286   
    /// Appends an item to `additionalModelResponseFieldPaths`.
  232    287   
    ///
  233    288   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  234    289   
    ///
  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>
         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>
  236    291   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  237    292   
    /// <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>
  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>
         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>
  239    294   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  240    295   
        self.inner = self.inner.additional_model_response_field_paths(input.into());
  241    296   
        self
  242    297   
    }
  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>
         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>
  244    299   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  245    300   
    /// <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>
  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>
         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>
  247    302   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  248    303   
        self.inner = self.inner.set_additional_model_response_field_paths(input);
  249    304   
        self
  250    305   
    }
  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>
         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>
  252    307   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  253    308   
    /// <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>
  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>
         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>
  255    310   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  256    311   
        self.inner.get_additional_model_response_field_paths()
  257    312   
    }
         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  +
    }
  258    353   
}