AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

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

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

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

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

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

@@ -1,1 +67,58 @@
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     16   
        >,
   17     17   
    > {
   18     18   
        let mut fluent_builder = client.converse_stream();
   19     19   
        fluent_builder.inner = self;
   20     20   
        fluent_builder.send().await
   21     21   
    }
   22     22   
}
   23     23   
/// Fluent builder constructing a request to `ConverseStream`.
   24     24   
///
   25         -
/// <p>Sends messages to the specified Amazon Bedrock model and returns the response in a stream. <code>ConverseStream</code> provides a consistent API that works with all Amazon Bedrock 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.</p>
   26         -
/// <p>To find out if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a> and check the <code>responseStreamingSupported</code> field in the response.</p><note>
   27         -
/// <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>ConverseStream</code>.</p>
   28         -
/// </note>
   29         -
/// <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>
   30         -
/// <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>
   31         -
/// <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>
   32         -
/// <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>
   33         -
/// <p>For example code, see <i>Conversation streaming example</i> in the <i>Amazon Bedrock User Guide</i>.</p>
   34         -
/// <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p><important>
   35         -
/// <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>
   36         -
/// </important>
   37         -
/// <p>For troubleshooting some of the common errors you might encounter when using the <code>ConverseStream</code> API, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
          25  +
/// <p>Sends messages to the specified Amazon Bedrock model and returns the response in a stream. <code>ConverseStream</code> provides a consistent API that works with all Amazon Bedrock 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>To find out if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a> and check the <code>responseStreamingSupported</code> field in the response.</p>
          27  +
/// <p>For example code, see <i>Invoke model with streaming code example</i> in the <i>Amazon Bedrock User Guide</i>.</p>
          28  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
   38     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   39     30   
pub struct ConverseStreamFluentBuilder {
   40     31   
    handle: ::std::sync::Arc<crate::client::Handle>,
   41     32   
    inner: crate::operation::converse_stream::builders::ConverseStreamInputBuilder,
   42     33   
    config_override: ::std::option::Option<crate::config::Builder>,
   43     34   
}
   44     35   
impl
   45     36   
    crate::client::customize::internal::CustomizableSend<
   46     37   
        crate::operation::converse_stream::ConverseStreamOutput,
   47     38   
        crate::operation::converse_stream::ConverseStreamError,
@@ -93,84 +365,269 @@
  113    104   
    }
  114    105   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  115    106   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  116    107   
        self
  117    108   
    }
  118    109   
  119    110   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  120    111   
        self.config_override = config_override;
  121    112   
        self
  122    113   
    }
  123         -
    /// <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>
         114  +
    /// <p>The ID for the model.</p>
         115  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  124    116   
    /// <ul>
  125    117   
    /// <li>
  126    118   
    /// <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>
  127    119   
    /// <li>
  128         -
    /// <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>
  129         -
    /// <li>
  130    120   
    /// <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>
  131    121   
    /// <li>
  132    122   
    /// <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>
  133         -
    /// <li>
  134         -
    /// <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>
  135    123   
    /// </ul>
  136         -
    /// <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>
  137    124   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  138    125   
        self.inner = self.inner.model_id(input.into());
  139    126   
        self
  140    127   
    }
  141         -
    /// <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>
         128  +
    /// <p>The ID for the model.</p>
         129  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  142    130   
    /// <ul>
  143    131   
    /// <li>
  144    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>
  145    133   
    /// <li>
  146         -
    /// <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>
  147         -
    /// <li>
  148    134   
    /// <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>
  149    135   
    /// <li>
  150    136   
    /// <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>
  151         -
    /// <li>
  152         -
    /// <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>
  153    137   
    /// </ul>
  154         -
    /// <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>
  155    138   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  156    139   
        self.inner = self.inner.set_model_id(input);
  157    140   
        self
  158    141   
    }
  159         -
    /// <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>
         142  +
    /// <p>The ID for the model.</p>
         143  +
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
  160    144   
    /// <ul>
  161    145   
    /// <li>
  162    146   
    /// <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>
  163    147   
    /// <li>
  164         -
    /// <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>
  165         -
    /// <li>
  166    148   
    /// <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>
  167    149   
    /// <li>
  168    150   
    /// <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>
  169         -
    /// <li>
  170         -
    /// <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>
  171    151   
    /// </ul>
  172         -
    /// <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>
  173    152   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  174    153   
        self.inner.get_model_id()
  175    154   
    }
  176    155   
    ///
  177    156   
    /// Appends an item to `messages`.
  178    157   
    ///
  179    158   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  180    159   
    ///
  181    160   
    /// <p>The messages that you want to send to the model.</p>
  182    161   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  183    162   
        self.inner = self.inner.messages(input);
  184    163   
        self
  185    164   
    }
  186    165   
    /// <p>The messages that you want to send to the model.</p>
  187    166   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  188    167   
        self.inner = self.inner.set_messages(input);
  189    168   
        self
  190    169   
    }
  191    170   
    /// <p>The messages that you want to send to the model.</p>
  192    171   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  193    172   
        self.inner.get_messages()
  194    173   
    }
  195    174   
    ///
  196    175   
    /// Appends an item to `system`.
  197    176   
    ///
  198    177   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  199    178   
    ///
  200         -
    /// <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  +
    /// <p>A system prompt to send to the model.</p>
  201    180   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  202    181   
        self.inner = self.inner.system(input);
  203    182   
        self
  204    183   
    }
  205         -
    /// <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  +
    /// <p>A system prompt to send to the model.</p>
  206    185   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  207    186   
        self.inner = self.inner.set_system(input);
  208    187   
        self
  209    188   
    }
  210         -
    /// <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>
         189  +
    /// <p>A system prompt to send to the model.</p>
  211    190   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  212    191   
        self.inner.get_system()
  213    192   
    }
  214         -
    /// <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  +
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</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>
  215    194   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  216    195   
        self.inner = self.inner.inference_config(input);
  217    196   
        self
  218    197   
    }
  219         -
    /// <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  +
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</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>
  220    199   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  221    200   
        self.inner = self.inner.set_inference_config(input);
  222    201   
        self
  223    202   
    }
  224         -
    /// <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>
         203  +
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</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>
  225    204   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  226    205   
        self.inner.get_inference_config()
  227    206   
    }
  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 streaming 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>
         207  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         208  +
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
         209  +
    /// </note>
  230    210   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  231    211   
        self.inner = self.inner.tool_config(input);
  232    212   
        self
  233    213   
    }
  234         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  235         -
    /// <p>For information about models that support streaming 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>
         214  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         215  +
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
         216  +
    /// </note>
  236    217   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  237    218   
        self.inner = self.inner.set_tool_config(input);
  238    219   
        self
  239    220   
    }
  240         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
  241         -
    /// <p>For information about models that support streaming 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>
         221  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
         222  +
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
         223  +
    /// </note>
  242    224   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  243    225   
        self.inner.get_tool_config()
  244    226   
    }
  245         -
    /// <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>
  246         -
    pub fn guardrail_config(mut self, input: crate::types::GuardrailStreamConfiguration) -> Self {
  247         -
        self.inner = self.inner.guardrail_config(input);
  248         -
        self
  249         -
    }
  250         -
    /// <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>
  251         -
    pub fn set_guardrail_config(mut self, input: ::std::option::Option<crate::types::GuardrailStreamConfiguration>) -> Self {
  252         -
        self.inner = self.inner.set_guardrail_config(input);
  253         -
        self
  254         -
    }
  255         -
    /// <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>
  256         -
    pub fn get_guardrail_config(&self) -> &::std::option::Option<crate::types::GuardrailStreamConfiguration> {
  257         -
        self.inner.get_guardrail_config()
  258         -
    }
  259         -
    /// <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  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
  260    228   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  261    229   
        self.inner = self.inner.additional_model_request_fields(input);
  262    230   
        self
  263    231   
    }
  264         -
    /// <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  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
  265    233   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  266    234   
        self.inner = self.inner.set_additional_model_request_fields(input);
  267    235   
        self
  268    236   
    }
  269         -
    /// <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>
         237  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
  270    238   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  271    239   
        self.inner.get_additional_model_request_fields()
  272    240   
    }
  273    241   
    ///
  274         -
    /// Adds a key-value pair to `promptVariables`.
  275         -
    ///
  276         -
    /// To override the contents of this collection use [`set_prompt_variables`](Self::set_prompt_variables).
  277         -
    ///
  278         -
    /// <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>
  279         -
    pub fn prompt_variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PromptVariableValues) -> Self {
  280         -
        self.inner = self.inner.prompt_variables(k.into(), v);
  281         -
        self
  282         -
    }
  283         -
    /// <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>
  284         -
    pub fn set_prompt_variables(
  285         -
        mut self,
  286         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
  287         -
    ) -> Self {
  288         -
        self.inner = self.inner.set_prompt_variables(input);
  289         -
        self
  290         -
    }
  291         -
    /// <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>
  292         -
    pub fn get_prompt_variables(
  293         -
        &self,
  294         -
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
  295         -
        self.inner.get_prompt_variables()
  296         -
    }
  297         -
    ///
  298    242   
    /// Appends an item to `additionalModelResponseFieldPaths`.
  299    243   
    ///
  300    244   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  301    245   
    ///
  302         -
    /// <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>
         246  +
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</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>
  303    247   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  304    248   
    /// <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>
  305         -
    /// <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>
         249  +
    /// <p><code>ConverseStream</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>ConverseStream</code>.</p>
  306    250   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  307    251   
        self.inner = self.inner.additional_model_response_field_paths(input.into());
  308    252   
        self
  309    253   
    }
  310         -
    /// <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>
         254  +
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</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>
  311    255   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  312    256   
    /// <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>
  313         -
    /// <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>
         257  +
    /// <p><code>ConverseStream</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>ConverseStream</code>.</p>
  314    258   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  315    259   
        self.inner = self.inner.set_additional_model_response_field_paths(input);
  316    260   
        self
  317    261   
    }
  318         -
    /// <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>
         262  +
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</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>
  319    263   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  320    264   
    /// <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>
  321         -
    /// <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>
         265  +
    /// <p><code>ConverseStream</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>ConverseStream</code>.</p>
  322    266   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  323    267   
        self.inner.get_additional_model_response_field_paths()
  324    268   
    }
  325         -
    ///
  326         -
    /// Adds a key-value pair to `requestMetadata`.
  327         -
    ///
  328         -
    /// To override the contents of this collection use [`set_request_metadata`](Self::set_request_metadata).
  329         -
    ///
  330         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  331         -
    pub fn request_metadata(
  332         -
        mut self,
  333         -
        k: impl ::std::convert::Into<::std::string::String>,
  334         -
        v: impl ::std::convert::Into<::std::string::String>,
  335         -
    ) -> Self {
  336         -
        self.inner = self.inner.request_metadata(k.into(), v.into());
  337         -
        self
  338         -
    }
  339         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  340         -
    pub fn set_request_metadata(
  341         -
        mut self,
  342         -
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  343         -
    ) -> Self {
  344         -
        self.inner = self.inner.set_request_metadata(input);
  345         -
        self
  346         -
    }
  347         -
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
  348         -
    pub fn get_request_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  349         -
        self.inner.get_request_metadata()
  350         -
    }
  351         -
    /// <p>Model performance settings for the request.</p>
  352         -
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
  353         -
        self.inner = self.inner.performance_config(input);
  354         -
        self
  355         -
    }
  356         -
    /// <p>Model performance settings for the request.</p>
  357         -
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
  358         -
        self.inner = self.inner.set_performance_config(input);
  359         -
        self
  360         -
    }
  361         -
    /// <p>Model performance settings for the request.</p>
  362         -
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
  363         -
        self.inner.get_performance_config()
  364         -
    }
  365    269   
}

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

@@ -1,0 +403,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Orchestration and serialization glue logic for `GetAsyncInvoke`.
    3         -
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4         -
#[non_exhaustive]
    5         -
pub struct GetAsyncInvoke;
    6         -
impl GetAsyncInvoke {
    7         -
    /// Creates a new `GetAsyncInvoke`
    8         -
    pub fn new() -> Self {
    9         -
        Self
   10         -
    }
   11         -
    pub(crate) async fn orchestrate(
   12         -
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13         -
        input: crate::operation::get_async_invoke::GetAsyncInvokeInput,
   14         -
    ) -> ::std::result::Result<
   15         -
        crate::operation::get_async_invoke::GetAsyncInvokeOutput,
   16         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   17         -
            crate::operation::get_async_invoke::GetAsyncInvokeError,
   18         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19         -
        >,
   20         -
    > {
   21         -
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
   22         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   23         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   24         -
        >| {
   25         -
            err.map_service_error(|err| {
   26         -
                err.downcast::<crate::operation::get_async_invoke::GetAsyncInvokeError>()
   27         -
                    .expect("correct error type")
   28         -
            })
   29         -
        };
   30         -
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
   31         -
            .await
   32         -
            .map_err(map_err)?;
   33         -
        let output = context.finalize().map_err(map_err)?;
   34         -
        ::std::result::Result::Ok(
   35         -
            output
   36         -
                .downcast::<crate::operation::get_async_invoke::GetAsyncInvokeOutput>()
   37         -
                .expect("correct output type"),
   38         -
        )
   39         -
    }
   40         -
   41         -
    pub(crate) async fn orchestrate_with_stop_point(
   42         -
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   43         -
        input: crate::operation::get_async_invoke::GetAsyncInvokeInput,
   44         -
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
   45         -
    ) -> ::std::result::Result<
   46         -
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
   47         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   48         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   49         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   50         -
        >,
   51         -
    > {
   52         -
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
   53         -
        use ::tracing::Instrument;
   54         -
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Bedrock Runtime", "GetAsyncInvoke", input, runtime_plugins, stop_point)
   55         -
            // Create a parent span for the entire operation. Includes a random, internal-only,
   56         -
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
   57         -
            .instrument(::tracing::debug_span!(
   58         -
                "Bedrock Runtime.GetAsyncInvoke",
   59         -
                "rpc.service" = "Bedrock Runtime",
   60         -
                "rpc.method" = "GetAsyncInvoke",
   61         -
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
   62         -
                "rpc.system" = "aws-api",
   63         -
            ))
   64         -
            .await
   65         -
    }
   66         -
   67         -
    pub(crate) fn operation_runtime_plugins(
   68         -
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   69         -
        client_config: &crate::config::Config,
   70         -
        config_override: ::std::option::Option<crate::config::Builder>,
   71         -
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
   72         -
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
   73         -
   74         -
        if let ::std::option::Option::Some(config_override) = config_override {
   75         -
            for plugin in config_override.runtime_plugins.iter().cloned() {
   76         -
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   77         -
            }
   78         -
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   79         -
                config_override,
   80         -
                client_config.config.clone(),
   81         -
                &client_config.runtime_components,
   82         -
            ));
   83         -
        }
   84         -
        runtime_plugins
   85         -
    }
   86         -
}
   87         -
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetAsyncInvoke {
   88         -
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   89         -
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetAsyncInvoke");
   90         -
   91         -
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   92         -
            GetAsyncInvokeRequestSerializer,
   93         -
        ));
   94         -
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   95         -
            GetAsyncInvokeResponseDeserializer,
   96         -
        ));
   97         -
   98         -
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   99         -
            crate::config::auth::Params::builder()
  100         -
                .operation_name("GetAsyncInvoke")
  101         -
                .build()
  102         -
                .expect("required fields set"),
  103         -
        ));
  104         -
  105         -
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
  106         -
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  107         -
            "GetAsyncInvoke",
  108         -
            "Bedrock Runtime",
  109         -
        ));
  110         -
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
  111         -
        signing_options.double_uri_encode = true;
  112         -
        signing_options.content_sha256_header = false;
  113         -
        signing_options.normalize_uri_path = true;
  114         -
        signing_options.payload_override = None;
  115         -
  116         -
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
  117         -
            signing_options,
  118         -
            ..::std::default::Default::default()
  119         -
        });
  120         -
  121         -
        ::std::option::Option::Some(cfg.freeze())
  122         -
    }
  123         -
  124         -
    fn runtime_components(
  125         -
        &self,
  126         -
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  127         -
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  128         -
        #[allow(unused_mut)]
  129         -
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetAsyncInvoke")
  130         -
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  131         -
            .with_interceptor(GetAsyncInvokeEndpointParamsInterceptor)
  132         -
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  133         -
                crate::operation::get_async_invoke::GetAsyncInvokeError,
  134         -
            >::new())
  135         -
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  136         -
                crate::operation::get_async_invoke::GetAsyncInvokeError,
  137         -
            >::new())
  138         -
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
  139         -
                crate::operation::get_async_invoke::GetAsyncInvokeError,
  140         -
            >::new());
  141         -
  142         -
        ::std::borrow::Cow::Owned(rcb)
  143         -
    }
  144         -
}
  145         -
  146         -
#[derive(Debug)]
  147         -
struct GetAsyncInvokeResponseDeserializer;
  148         -
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetAsyncInvokeResponseDeserializer {
  149         -
    fn deserialize_nonstreaming(
  150         -
        &self,
  151         -
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  152         -
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  153         -
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  154         -
        let headers = response.headers();
  155         -
        let body = response.body().bytes().expect("body loaded");
  156         -
        #[allow(unused_mut)]
  157         -
        let mut force_error = false;
  158         -
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
  159         -
        let parse_result = if !success && status != 200 || force_error {
  160         -
            crate::protocol_serde::shape_get_async_invoke::de_get_async_invoke_http_error(status, headers, body)
  161         -
        } else {
  162         -
            crate::protocol_serde::shape_get_async_invoke::de_get_async_invoke_http_response(status, headers, body)
  163         -
        };
  164         -
        crate::protocol_serde::type_erase_result(parse_result)
  165         -
    }
  166         -
}
  167         -
#[derive(Debug)]
  168         -
struct GetAsyncInvokeRequestSerializer;
  169         -
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetAsyncInvokeRequestSerializer {
  170         -
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  171         -
    fn serialize_input(
  172         -
        &self,
  173         -
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  174         -
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  175         -
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  176         -
        let input = input
  177         -
            .downcast::<crate::operation::get_async_invoke::GetAsyncInvokeInput>()
  178         -
            .expect("correct type");
  179         -
        let _header_serialization_settings = _cfg
  180         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  181         -
            .cloned()
  182         -
            .unwrap_or_default();
  183         -
        let mut request_builder = {
  184         -
            fn uri_base(
  185         -
                _input: &crate::operation::get_async_invoke::GetAsyncInvokeInput,
  186         -
                output: &mut ::std::string::String,
  187         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188         -
                use ::std::fmt::Write as _;
  189         -
                let input_1 = &_input.invocation_arn;
  190         -
                let input_1 = input_1
  191         -
                    .as_ref()
  192         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("invocation_arn", "cannot be empty or unset"))?;
  193         -
                let invocation_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  194         -
                if invocation_arn.is_empty() {
  195         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  196         -
                        "invocation_arn",
  197         -
                        "cannot be empty or unset",
  198         -
                    ));
  199         -
                }
  200         -
                ::std::write!(output, "/async-invoke/{invocationArn}", invocationArn = invocation_arn).expect("formatting should succeed");
  201         -
                ::std::result::Result::Ok(())
  202         -
            }
  203         -
            #[allow(clippy::unnecessary_wraps)]
  204         -
            fn update_http_builder(
  205         -
                input: &crate::operation::get_async_invoke::GetAsyncInvokeInput,
  206         -
                builder: ::http::request::Builder,
  207         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  208         -
                let mut uri = ::std::string::String::new();
  209         -
                uri_base(input, &mut uri)?;
  210         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  211         -
            }
  212         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  213         -
            builder
  214         -
        };
  215         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  216         -
  217         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  218         -
    }
  219         -
}
  220         -
#[derive(Debug)]
  221         -
struct GetAsyncInvokeEndpointParamsInterceptor;
  222         -
  223         -
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAsyncInvokeEndpointParamsInterceptor {
  224         -
    fn name(&self) -> &'static str {
  225         -
        "GetAsyncInvokeEndpointParamsInterceptor"
  226         -
    }
  227         -
  228         -
    fn read_before_execution(
  229         -
        &self,
  230         -
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  231         -
            '_,
  232         -
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  233         -
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  234         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  235         -
        >,
  236         -
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  237         -
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  238         -
        let _input = context
  239         -
            .input()
  240         -
            .downcast_ref::<GetAsyncInvokeInput>()
  241         -
            .ok_or("failed to downcast to GetAsyncInvokeInput")?;
  242         -
  243         -
        let params = crate::config::endpoint::Params::builder()
  244         -
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
  245         -
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
  246         -
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
  247         -
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
  248         -
            .build()
  249         -
            .map_err(|err| {
  250         -
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  251         -
            })?;
  252         -
        cfg.interceptor_state()
  253         -
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  254         -
        ::std::result::Result::Ok(())
  255         -
    }
  256         -
}
  257         -
  258         -
// The get_* functions below are generated from JMESPath expressions in the
  259         -
// operationContextParams trait. They target the operation's input shape.
  260         -
  261         -
/// Error type for the `GetAsyncInvokeError` operation.
  262         -
#[non_exhaustive]
  263         -
#[derive(::std::fmt::Debug)]
  264         -
pub enum GetAsyncInvokeError {
  265         -
    /// <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>
  266         -
    AccessDeniedException(crate::types::error::AccessDeniedException),
  267         -
    /// <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>
  268         -
    InternalServerException(crate::types::error::InternalServerException),
  269         -
    /// <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>
  270         -
    ThrottlingException(crate::types::error::ThrottlingException),
  271         -
    /// <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>
  272         -
    ValidationException(crate::types::error::ValidationException),
  273         -
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  274         -
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  275         -
    variable wildcard pattern and check `.code()`:
  276         -
     \
  277         -
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  278         -
     \
  279         -
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetAsyncInvokeError) for what information is available for the error.")]
  280         -
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  281         -
}
  282         -
impl GetAsyncInvokeError {
  283         -
    /// Creates the `GetAsyncInvokeError::Unhandled` variant from any error type.
  284         -
    pub fn unhandled(
  285         -
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  286         -
    ) -> Self {
  287         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  288         -
            source: err.into(),
  289         -
            meta: ::std::default::Default::default(),
  290         -
        })
  291         -
    }
  292         -
  293         -
    /// Creates the `GetAsyncInvokeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  294         -
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  295         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  296         -
            source: err.clone().into(),
  297         -
            meta: err,
  298         -
        })
  299         -
    }
  300         -
    ///
  301         -
    /// Returns error metadata, which includes the error code, message,
  302         -
    /// request ID, and potentially additional information.
  303         -
    ///
  304         -
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  305         -
        match self {
  306         -
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  307         -
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  308         -
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  309         -
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  310         -
            Self::Unhandled(e) => &e.meta,
  311         -
        }
  312         -
    }
  313         -
    /// Returns `true` if the error kind is `GetAsyncInvokeError::AccessDeniedException`.
  314         -
    pub fn is_access_denied_exception(&self) -> bool {
  315         -
        matches!(self, Self::AccessDeniedException(_))
  316         -
    }
  317         -
    /// Returns `true` if the error kind is `GetAsyncInvokeError::InternalServerException`.
  318         -
    pub fn is_internal_server_exception(&self) -> bool {
  319         -
        matches!(self, Self::InternalServerException(_))
  320         -
    }
  321         -
    /// Returns `true` if the error kind is `GetAsyncInvokeError::ThrottlingException`.
  322         -
    pub fn is_throttling_exception(&self) -> bool {
  323         -
        matches!(self, Self::ThrottlingException(_))
  324         -
    }
  325         -
    /// Returns `true` if the error kind is `GetAsyncInvokeError::ValidationException`.
  326         -
    pub fn is_validation_exception(&self) -> bool {
  327         -
        matches!(self, Self::ValidationException(_))
  328         -
    }
  329         -
}
  330         -
impl ::std::error::Error for GetAsyncInvokeError {
  331         -
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  332         -
        match self {
  333         -
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  334         -
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  335         -
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  336         -
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  337         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  338         -
        }
  339         -
    }
  340         -
}
  341         -
impl ::std::fmt::Display for GetAsyncInvokeError {
  342         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  343         -
        match self {
  344         -
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  345         -
            Self::InternalServerException(_inner) => _inner.fmt(f),
  346         -
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  347         -
            Self::ValidationException(_inner) => _inner.fmt(f),
  348         -
            Self::Unhandled(_inner) => {
  349         -
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  350         -
                    write!(f, "unhandled error ({code})")
  351         -
                } else {
  352         -
                    f.write_str("unhandled error")
  353         -
                }
  354         -
            }
  355         -
        }
  356         -
    }
  357         -
}
  358         -
impl ::aws_smithy_types::retry::ProvideErrorKind for GetAsyncInvokeError {
  359         -
    fn code(&self) -> ::std::option::Option<&str> {
  360         -
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  361         -
    }
  362         -
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  363         -
        ::std::option::Option::None
  364         -
    }
  365         -
}
  366         -
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetAsyncInvokeError {
  367         -
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  368         -
        match self {
  369         -
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  370         -
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  371         -
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  372         -
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  373         -
            Self::Unhandled(_inner) => &_inner.meta,
  374         -
        }
  375         -
    }
  376         -
}
  377         -
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetAsyncInvokeError {
  378         -
    fn create_unhandled_error(
  379         -
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  380         -
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  381         -
    ) -> Self {
  382         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  383         -
            source,
  384         -
            meta: meta.unwrap_or_default(),
  385         -
        })
  386         -
    }
  387         -
}
  388         -
impl ::aws_types::request_id::RequestId for crate::operation::get_async_invoke::GetAsyncInvokeError {
  389         -
    fn request_id(&self) -> Option<&str> {
  390         -
        self.meta().request_id()
  391         -
    }
  392         -
}
  393         -
  394         -
pub use crate::operation::get_async_invoke::_get_async_invoke_output::GetAsyncInvokeOutput;
  395         -
  396         -
pub use crate::operation::get_async_invoke::_get_async_invoke_input::GetAsyncInvokeInput;
  397         -
  398         -
mod _get_async_invoke_input;
  399         -
  400         -
mod _get_async_invoke_output;
  401         -
  402         -
/// Builders
  403         -
pub mod builders;

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

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct GetAsyncInvokeInput {
    6         -
    /// <p>The invocation's ARN.</p>
    7         -
    pub invocation_arn: ::std::option::Option<::std::string::String>,
    8         -
}
    9         -
impl GetAsyncInvokeInput {
   10         -
    /// <p>The invocation's ARN.</p>
   11         -
    pub fn invocation_arn(&self) -> ::std::option::Option<&str> {
   12         -
        self.invocation_arn.as_deref()
   13         -
    }
   14         -
}
   15         -
impl GetAsyncInvokeInput {
   16         -
    /// Creates a new builder-style object to manufacture [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
   17         -
    pub fn builder() -> crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder {
   18         -
        crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder::default()
   19         -
    }
   20         -
}
   21         -
   22         -
/// A builder for [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
   23         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   24         -
#[non_exhaustive]
   25         -
pub struct GetAsyncInvokeInputBuilder {
   26         -
    pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
   27         -
}
   28         -
impl GetAsyncInvokeInputBuilder {
   29         -
    /// <p>The invocation's ARN.</p>
   30         -
    /// This field is required.
   31         -
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   32         -
        self.invocation_arn = ::std::option::Option::Some(input.into());
   33         -
        self
   34         -
    }
   35         -
    /// <p>The invocation's ARN.</p>
   36         -
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   37         -
        self.invocation_arn = input;
   38         -
        self
   39         -
    }
   40         -
    /// <p>The invocation's ARN.</p>
   41         -
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
   42         -
        &self.invocation_arn
   43         -
    }
   44         -
    /// Consumes the builder and constructs a [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
   45         -
    pub fn build(
   46         -
        self,
   47         -
    ) -> ::std::result::Result<crate::operation::get_async_invoke::GetAsyncInvokeInput, ::aws_smithy_types::error::operation::BuildError> {
   48         -
        ::std::result::Result::Ok(crate::operation::get_async_invoke::GetAsyncInvokeInput {
   49         -
            invocation_arn: self.invocation_arn,
   50         -
        })
   51         -
    }
   52         -
}

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

@@ -1,0 +308,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    5         -
pub struct GetAsyncInvokeOutput {
    6         -
    /// <p>The invocation's ARN.</p>
    7         -
    pub invocation_arn: ::std::string::String,
    8         -
    /// <p>The invocation's model ARN.</p>
    9         -
    pub model_arn: ::std::string::String,
   10         -
    /// <p>The invocation's idempotency token.</p>
   11         -
    pub client_request_token: ::std::option::Option<::std::string::String>,
   12         -
    /// <p>The invocation's status.</p>
   13         -
    pub status: crate::types::AsyncInvokeStatus,
   14         -
    /// <p>An error message.</p>
   15         -
    pub failure_message: ::std::option::Option<::std::string::String>,
   16         -
    /// <p>When the invocation request was submitted.</p>
   17         -
    pub submit_time: ::aws_smithy_types::DateTime,
   18         -
    /// <p>The invocation's last modified time.</p>
   19         -
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   20         -
    /// <p>When the invocation ended.</p>
   21         -
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   22         -
    /// <p>Output data settings.</p>
   23         -
    pub output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
   24         -
    _request_id: Option<String>,
   25         -
}
   26         -
impl GetAsyncInvokeOutput {
   27         -
    /// <p>The invocation's ARN.</p>
   28         -
    pub fn invocation_arn(&self) -> &str {
   29         -
        use std::ops::Deref;
   30         -
        self.invocation_arn.deref()
   31         -
    }
   32         -
    /// <p>The invocation's model ARN.</p>
   33         -
    pub fn model_arn(&self) -> &str {
   34         -
        use std::ops::Deref;
   35         -
        self.model_arn.deref()
   36         -
    }
   37         -
    /// <p>The invocation's idempotency token.</p>
   38         -
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
   39         -
        self.client_request_token.as_deref()
   40         -
    }
   41         -
    /// <p>The invocation's status.</p>
   42         -
    pub fn status(&self) -> &crate::types::AsyncInvokeStatus {
   43         -
        &self.status
   44         -
    }
   45         -
    /// <p>An error message.</p>
   46         -
    pub fn failure_message(&self) -> ::std::option::Option<&str> {
   47         -
        self.failure_message.as_deref()
   48         -
    }
   49         -
    /// <p>When the invocation request was submitted.</p>
   50         -
    pub fn submit_time(&self) -> &::aws_smithy_types::DateTime {
   51         -
        &self.submit_time
   52         -
    }
   53         -
    /// <p>The invocation's last modified time.</p>
   54         -
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
   55         -
        self.last_modified_time.as_ref()
   56         -
    }
   57         -
    /// <p>When the invocation ended.</p>
   58         -
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
   59         -
        self.end_time.as_ref()
   60         -
    }
   61         -
    /// <p>Output data settings.</p>
   62         -
    pub fn output_data_config(&self) -> ::std::option::Option<&crate::types::AsyncInvokeOutputDataConfig> {
   63         -
        self.output_data_config.as_ref()
   64         -
    }
   65         -
}
   66         -
impl ::std::fmt::Debug for GetAsyncInvokeOutput {
   67         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   68         -
        let mut formatter = f.debug_struct("GetAsyncInvokeOutput");
   69         -
        formatter.field("invocation_arn", &self.invocation_arn);
   70         -
        formatter.field("model_arn", &self.model_arn);
   71         -
        formatter.field("client_request_token", &self.client_request_token);
   72         -
        formatter.field("status", &self.status);
   73         -
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
   74         -
        formatter.field("submit_time", &self.submit_time);
   75         -
        formatter.field("last_modified_time", &self.last_modified_time);
   76         -
        formatter.field("end_time", &self.end_time);
   77         -
        formatter.field("output_data_config", &self.output_data_config);
   78         -
        formatter.field("_request_id", &self._request_id);
   79         -
        formatter.finish()
   80         -
    }
   81         -
}
   82         -
impl ::aws_types::request_id::RequestId for GetAsyncInvokeOutput {
   83         -
    fn request_id(&self) -> Option<&str> {
   84         -
        self._request_id.as_deref()
   85         -
    }
   86         -
}
   87         -
impl GetAsyncInvokeOutput {
   88         -
    /// Creates a new builder-style object to manufacture [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
   89         -
    pub fn builder() -> crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder {
   90         -
        crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::default()
   91         -
    }
   92         -
}
   93         -
   94         -
/// A builder for [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
   95         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   96         -
#[non_exhaustive]
   97         -
pub struct GetAsyncInvokeOutputBuilder {
   98         -
    pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
   99         -
    pub(crate) model_arn: ::std::option::Option<::std::string::String>,
  100         -
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
  101         -
    pub(crate) status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
  102         -
    pub(crate) failure_message: ::std::option::Option<::std::string::String>,
  103         -
    pub(crate) submit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  104         -
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  105         -
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  106         -
    pub(crate) output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
  107         -
    _request_id: Option<String>,
  108         -
}
  109         -
impl GetAsyncInvokeOutputBuilder {
  110         -
    /// <p>The invocation's ARN.</p>
  111         -
    /// This field is required.
  112         -
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113         -
        self.invocation_arn = ::std::option::Option::Some(input.into());
  114         -
        self
  115         -
    }
  116         -
    /// <p>The invocation's ARN.</p>
  117         -
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118         -
        self.invocation_arn = input;
  119         -
        self
  120         -
    }
  121         -
    /// <p>The invocation's ARN.</p>
  122         -
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
  123         -
        &self.invocation_arn
  124         -
    }
  125         -
    /// <p>The invocation's model ARN.</p>
  126         -
    /// This field is required.
  127         -
    pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  128         -
        self.model_arn = ::std::option::Option::Some(input.into());
  129         -
        self
  130         -
    }
  131         -
    /// <p>The invocation's model ARN.</p>
  132         -
    pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  133         -
        self.model_arn = input;
  134         -
        self
  135         -
    }
  136         -
    /// <p>The invocation's model ARN.</p>
  137         -
    pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
  138         -
        &self.model_arn
  139         -
    }
  140         -
    /// <p>The invocation's idempotency token.</p>
  141         -
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  142         -
        self.client_request_token = ::std::option::Option::Some(input.into());
  143         -
        self
  144         -
    }
  145         -
    /// <p>The invocation's idempotency token.</p>
  146         -
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  147         -
        self.client_request_token = input;
  148         -
        self
  149         -
    }
  150         -
    /// <p>The invocation's idempotency token.</p>
  151         -
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
  152         -
        &self.client_request_token
  153         -
    }
  154         -
    /// <p>The invocation's status.</p>
  155         -
    /// This field is required.
  156         -
    pub fn status(mut self, input: crate::types::AsyncInvokeStatus) -> Self {
  157         -
        self.status = ::std::option::Option::Some(input);
  158         -
        self
  159         -
    }
  160         -
    /// <p>The invocation's status.</p>
  161         -
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AsyncInvokeStatus>) -> Self {
  162         -
        self.status = input;
  163         -
        self
  164         -
    }
  165         -
    /// <p>The invocation's status.</p>
  166         -
    pub fn get_status(&self) -> &::std::option::Option<crate::types::AsyncInvokeStatus> {
  167         -
        &self.status
  168         -
    }
  169         -
    /// <p>An error message.</p>
  170         -
    pub fn failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  171         -
        self.failure_message = ::std::option::Option::Some(input.into());
  172         -
        self
  173         -
    }
  174         -
    /// <p>An error message.</p>
  175         -
    pub fn set_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  176         -
        self.failure_message = input;
  177         -
        self
  178         -
    }
  179         -
    /// <p>An error message.</p>
  180         -
    pub fn get_failure_message(&self) -> &::std::option::Option<::std::string::String> {
  181         -
        &self.failure_message
  182         -
    }
  183         -
    /// <p>When the invocation request was submitted.</p>
  184         -
    /// This field is required.
  185         -
    pub fn submit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  186         -
        self.submit_time = ::std::option::Option::Some(input);
  187         -
        self
  188         -
    }
  189         -
    /// <p>When the invocation request was submitted.</p>
  190         -
    pub fn set_submit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  191         -
        self.submit_time = input;
  192         -
        self
  193         -
    }
  194         -
    /// <p>When the invocation request was submitted.</p>
  195         -
    pub fn get_submit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  196         -
        &self.submit_time
  197         -
    }
  198         -
    /// <p>The invocation's last modified time.</p>
  199         -
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  200         -
        self.last_modified_time = ::std::option::Option::Some(input);
  201         -
        self
  202         -
    }
  203         -
    /// <p>The invocation's last modified time.</p>
  204         -
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  205         -
        self.last_modified_time = input;
  206         -
        self
  207         -
    }
  208         -
    /// <p>The invocation's last modified time.</p>
  209         -
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  210         -
        &self.last_modified_time
  211         -
    }
  212         -
    /// <p>When the invocation ended.</p>
  213         -
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  214         -
        self.end_time = ::std::option::Option::Some(input);
  215         -
        self
  216         -
    }
  217         -
    /// <p>When the invocation ended.</p>
  218         -
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  219         -
        self.end_time = input;
  220         -
        self
  221         -
    }
  222         -
    /// <p>When the invocation ended.</p>
  223         -
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  224         -
        &self.end_time
  225         -
    }
  226         -
    /// <p>Output data settings.</p>
  227         -
    /// This field is required.
  228         -
    pub fn output_data_config(mut self, input: crate::types::AsyncInvokeOutputDataConfig) -> Self {
  229         -
        self.output_data_config = ::std::option::Option::Some(input);
  230         -
        self
  231         -
    }
  232         -
    /// <p>Output data settings.</p>
  233         -
    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>) -> Self {
  234         -
        self.output_data_config = input;
  235         -
        self
  236         -
    }
  237         -
    /// <p>Output data settings.</p>
  238         -
    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::AsyncInvokeOutputDataConfig> {
  239         -
        &self.output_data_config
  240         -
    }
  241         -
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
  242         -
        self._request_id = Some(request_id.into());
  243         -
        self
  244         -
    }
  245         -
  246         -
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
  247         -
        self._request_id = request_id;
  248         -
        self
  249         -
    }
  250         -
    /// Consumes the builder and constructs a [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
  251         -
    /// This method will fail if any of the following fields are not set:
  252         -
    /// - [`invocation_arn`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::invocation_arn)
  253         -
    /// - [`model_arn`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::model_arn)
  254         -
    /// - [`status`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::status)
  255         -
    /// - [`submit_time`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::submit_time)
  256         -
    pub fn build(
  257         -
        self,
  258         -
    ) -> ::std::result::Result<crate::operation::get_async_invoke::GetAsyncInvokeOutput, ::aws_smithy_types::error::operation::BuildError> {
  259         -
        ::std::result::Result::Ok(crate::operation::get_async_invoke::GetAsyncInvokeOutput {
  260         -
            invocation_arn: self.invocation_arn.ok_or_else(|| {
  261         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  262         -
                    "invocation_arn",
  263         -
                    "invocation_arn was not specified but it is required when building GetAsyncInvokeOutput",
  264         -
                )
  265         -
            })?,
  266         -
            model_arn: self.model_arn.ok_or_else(|| {
  267         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  268         -
                    "model_arn",
  269         -
                    "model_arn was not specified but it is required when building GetAsyncInvokeOutput",
  270         -
                )
  271         -
            })?,
  272         -
            client_request_token: self.client_request_token,
  273         -
            status: self.status.ok_or_else(|| {
  274         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  275         -
                    "status",
  276         -
                    "status was not specified but it is required when building GetAsyncInvokeOutput",
  277         -
                )
  278         -
            })?,
  279         -
            failure_message: self.failure_message,
  280         -
            submit_time: self.submit_time.ok_or_else(|| {
  281         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  282         -
                    "submit_time",
  283         -
                    "submit_time was not specified but it is required when building GetAsyncInvokeOutput",
  284         -
                )
  285         -
            })?,
  286         -
            last_modified_time: self.last_modified_time,
  287         -
            end_time: self.end_time,
  288         -
            output_data_config: self.output_data_config,
  289         -
            _request_id: self._request_id,
  290         -
        })
  291         -
    }
  292         -
}
  293         -
impl ::std::fmt::Debug for GetAsyncInvokeOutputBuilder {
  294         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  295         -
        let mut formatter = f.debug_struct("GetAsyncInvokeOutputBuilder");
  296         -
        formatter.field("invocation_arn", &self.invocation_arn);
  297         -
        formatter.field("model_arn", &self.model_arn);
  298         -
        formatter.field("client_request_token", &self.client_request_token);
  299         -
        formatter.field("status", &self.status);
  300         -
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
  301         -
        formatter.field("submit_time", &self.submit_time);
  302         -
        formatter.field("last_modified_time", &self.last_modified_time);
  303         -
        formatter.field("end_time", &self.end_time);
  304         -
        formatter.field("output_data_config", &self.output_data_config);
  305         -
        formatter.field("_request_id", &self._request_id);
  306         -
        formatter.finish()
  307         -
    }
  308         -
}