diff --git a/Cargo.lock b/Cargo.lock index e42a889e24..2c7e6b2926 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,7 +87,7 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "amzn-codewhisperer-client" -version = "0.1.8200" +version = "0.1.8646" dependencies = [ "aws-credential-types", "aws-runtime", diff --git a/crates/amzn-codewhisperer-client/Cargo.toml b/crates/amzn-codewhisperer-client/Cargo.toml index 792ed67667..53d65d69a9 100644 --- a/crates/amzn-codewhisperer-client/Cargo.toml +++ b/crates/amzn-codewhisperer-client/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "amzn-codewhisperer-client" -version = "0.1.8200" +version = "0.1.8646" authors = ["Grant Gurvis "] build = false exclude = [ diff --git a/crates/amzn-codewhisperer-client/src/config.rs b/crates/amzn-codewhisperer-client/src/config.rs index 180b8afcca..3fd4d42e44 100644 --- a/crates/amzn-codewhisperer-client/src/config.rs +++ b/crates/amzn-codewhisperer-client/src/config.rs @@ -609,6 +609,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_codewhisperer_client::config::IdentityCache; /// @@ -620,6 +621,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// @@ -656,6 +658,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_codewhisperer_client::config::IdentityCache; /// @@ -667,6 +670,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// @@ -1167,6 +1171,7 @@ impl Builder { /// /// Set the behavior major version to `latest`. This is equivalent to enabling the /// `behavior-version-latest` cargo feature. + /// /// ```no_run /// use amzn_codewhisperer_client::config::BehaviorVersion; /// @@ -1178,6 +1183,7 @@ impl Builder { /// ``` /// /// Customizing behavior major version: + /// /// ```no_run /// use amzn_codewhisperer_client::config::BehaviorVersion; /// diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_input_message.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_input_message.rs index 716eb41329..2c43086677 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_input_message.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_input_message.rs @@ -30,5 +30,8 @@ pub fn ser_user_input_message( } array_6.finish(); } + if let Some(var_9) = &input.model_id { + object.key("modelId").string(var_9.as_str()); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/types/_user_input_message.rs b/crates/amzn-codewhisperer-client/src/types/_user_input_message.rs index 1d8e987387..725358a632 100644 --- a/crates/amzn-codewhisperer-client/src/types/_user_input_message.rs +++ b/crates/amzn-codewhisperer-client/src/types/_user_input_message.rs @@ -14,6 +14,8 @@ pub struct UserInputMessage { pub origin: ::std::option::Option, /// Images associated with the Chat Message. pub images: ::std::option::Option<::std::vec::Vec>, + /// Unique identifier for the model used in this conversation + pub model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessage { /// The content of the chat message. @@ -44,6 +46,11 @@ impl UserInputMessage { pub fn images(&self) -> &[crate::types::ImageBlock] { self.images.as_deref().unwrap_or_default() } + + /// Unique identifier for the model used in this conversation + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl ::std::fmt::Debug for UserInputMessage { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -53,6 +60,7 @@ impl ::std::fmt::Debug for UserInputMessage { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } } @@ -73,6 +81,7 @@ pub struct UserInputMessageBuilder { pub(crate) user_intent: ::std::option::Option, pub(crate) origin: ::std::option::Option, pub(crate) images: ::std::option::Option<::std::vec::Vec>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessageBuilder { /// The content of the chat message. @@ -170,6 +179,23 @@ impl UserInputMessageBuilder { &self.images } + /// Unique identifier for the model used in this conversation + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model used in this conversation + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model used in this conversation + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + /// Consumes the builder and constructs a [`UserInputMessage`](crate::types::UserInputMessage). /// This method will fail if any of the following fields are not set: /// - [`content`](crate::types::builders::UserInputMessageBuilder::content) @@ -187,6 +213,7 @@ impl UserInputMessageBuilder { user_intent: self.user_intent, origin: self.origin, images: self.images, + model_id: self.model_id, }) } } @@ -198,6 +225,7 @@ impl ::std::fmt::Debug for UserInputMessageBuilder { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } }