Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/amzn-codewhisperer-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[package]
edition = "2021"
name = "amzn-codewhisperer-client"
version = "0.1.8200"
version = "0.1.8646"
authors = ["Grant Gurvis <[email protected]>"]
build = false
exclude = [
Expand Down
6 changes: 6 additions & 0 deletions crates/amzn-codewhisperer-client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ impl Builder {
/// # Examples
///
/// Disabling identity caching:
///
/// ```no_run
/// use amzn_codewhisperer_client::config::IdentityCache;
///
Expand All @@ -620,6 +621,7 @@ impl Builder {
/// ```
///
/// Customizing lazy caching:
///
/// ```no_run
/// use std::time::Duration;
///
Expand Down Expand Up @@ -656,6 +658,7 @@ impl Builder {
/// # Examples
///
/// Disabling identity caching:
///
/// ```no_run
/// use amzn_codewhisperer_client::config::IdentityCache;
///
Expand All @@ -667,6 +670,7 @@ impl Builder {
/// ```
///
/// Customizing lazy caching:
///
/// ```no_run
/// use std::time::Duration;
///
Expand Down Expand Up @@ -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;
///
Expand All @@ -1178,6 +1183,7 @@ impl Builder {
/// ```
///
/// Customizing behavior major version:
///
/// ```no_run
/// use amzn_codewhisperer_client::config::BehaviorVersion;
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
28 changes: 28 additions & 0 deletions crates/amzn-codewhisperer-client/src/types/_user_input_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub struct UserInputMessage {
pub origin: ::std::option::Option<crate::types::Origin>,
/// Images associated with the Chat Message.
pub images: ::std::option::Option<::std::vec::Vec<crate::types::ImageBlock>>,
/// 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.
Expand Down Expand Up @@ -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 {
Expand All @@ -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()
}
}
Expand All @@ -73,6 +81,7 @@ pub struct UserInputMessageBuilder {
pub(crate) user_intent: ::std::option::Option<crate::types::UserIntent>,
pub(crate) origin: ::std::option::Option<crate::types::Origin>,
pub(crate) images: ::std::option::Option<::std::vec::Vec<crate::types::ImageBlock>>,
pub(crate) model_id: ::std::option::Option<::std::string::String>,
}
impl UserInputMessageBuilder {
/// The content of the chat message.
Expand Down Expand Up @@ -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)
Expand All @@ -187,6 +213,7 @@ impl UserInputMessageBuilder {
user_intent: self.user_intent,
origin: self.origin,
images: self.images,
model_id: self.model_id,
})
}
}
Expand All @@ -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()
}
}
Loading