aws_sdk_bedrockagentruntime/operation/invoke_agent/_invoke_agent_input.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct InvokeAgentInput {
/// <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub session_state: ::std::option::Option<crate::types::SessionState>,
/// <p>The unique identifier of the agent to use.</p>
pub agent_id: ::std::option::Option<::std::string::String>,
/// <p>The alias of the agent to use.</p>
pub agent_alias_id: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier of the session. Use the same value across requests to continue the same conversation.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>Specifies whether to end the session with the agent or not.</p>
pub end_session: ::std::option::Option<bool>,
/// <p>Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
pub enable_trace: ::std::option::Option<bool>,
/// <p>The prompt text to send the agent.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub input_text: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier of the agent memory.</p>
pub memory_id: ::std::option::Option<::std::string::String>,
/// <p>Model performance settings for the request.</p>
pub bedrock_model_configurations: ::std::option::Option<crate::types::BedrockModelConfigurations>,
/// <p>Specifies the configurations for streaming.</p><note>
/// <p>To use agent streaming, you need permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
/// </note>
pub streaming_configurations: ::std::option::Option<crate::types::StreamingConfigurations>,
/// <p>The ARN of the resource making the request.</p>
pub source_arn: ::std::option::Option<::std::string::String>,
}
impl InvokeAgentInput {
/// <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn session_state(&self) -> ::std::option::Option<&crate::types::SessionState> {
self.session_state.as_ref()
}
/// <p>The unique identifier of the agent to use.</p>
pub fn agent_id(&self) -> ::std::option::Option<&str> {
self.agent_id.as_deref()
}
/// <p>The alias of the agent to use.</p>
pub fn agent_alias_id(&self) -> ::std::option::Option<&str> {
self.agent_alias_id.as_deref()
}
/// <p>The unique identifier of the session. Use the same value across requests to continue the same conversation.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>Specifies whether to end the session with the agent or not.</p>
pub fn end_session(&self) -> ::std::option::Option<bool> {
self.end_session
}
/// <p>Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
pub fn enable_trace(&self) -> ::std::option::Option<bool> {
self.enable_trace
}
/// <p>The prompt text to send the agent.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn input_text(&self) -> ::std::option::Option<&str> {
self.input_text.as_deref()
}
/// <p>The unique identifier of the agent memory.</p>
pub fn memory_id(&self) -> ::std::option::Option<&str> {
self.memory_id.as_deref()
}
/// <p>Model performance settings for the request.</p>
pub fn bedrock_model_configurations(&self) -> ::std::option::Option<&crate::types::BedrockModelConfigurations> {
self.bedrock_model_configurations.as_ref()
}
/// <p>Specifies the configurations for streaming.</p><note>
/// <p>To use agent streaming, you need permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
/// </note>
pub fn streaming_configurations(&self) -> ::std::option::Option<&crate::types::StreamingConfigurations> {
self.streaming_configurations.as_ref()
}
/// <p>The ARN of the resource making the request.</p>
pub fn source_arn(&self) -> ::std::option::Option<&str> {
self.source_arn.as_deref()
}
}
impl ::std::fmt::Debug for InvokeAgentInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("InvokeAgentInput");
formatter.field("session_state", &self.session_state);
formatter.field("agent_id", &self.agent_id);
formatter.field("agent_alias_id", &self.agent_alias_id);
formatter.field("session_id", &self.session_id);
formatter.field("end_session", &self.end_session);
formatter.field("enable_trace", &self.enable_trace);
formatter.field("input_text", &"*** Sensitive Data Redacted ***");
formatter.field("memory_id", &self.memory_id);
formatter.field("bedrock_model_configurations", &self.bedrock_model_configurations);
formatter.field("streaming_configurations", &self.streaming_configurations);
formatter.field("source_arn", &self.source_arn);
formatter.finish()
}
}
impl InvokeAgentInput {
/// Creates a new builder-style object to manufacture [`InvokeAgentInput`](crate::operation::invoke_agent::InvokeAgentInput).
pub fn builder() -> crate::operation::invoke_agent::builders::InvokeAgentInputBuilder {
crate::operation::invoke_agent::builders::InvokeAgentInputBuilder::default()
}
}
/// A builder for [`InvokeAgentInput`](crate::operation::invoke_agent::InvokeAgentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct InvokeAgentInputBuilder {
pub(crate) session_state: ::std::option::Option<crate::types::SessionState>,
pub(crate) agent_id: ::std::option::Option<::std::string::String>,
pub(crate) agent_alias_id: ::std::option::Option<::std::string::String>,
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) end_session: ::std::option::Option<bool>,
pub(crate) enable_trace: ::std::option::Option<bool>,
pub(crate) input_text: ::std::option::Option<::std::string::String>,
pub(crate) memory_id: ::std::option::Option<::std::string::String>,
pub(crate) bedrock_model_configurations: ::std::option::Option<crate::types::BedrockModelConfigurations>,
pub(crate) streaming_configurations: ::std::option::Option<crate::types::StreamingConfigurations>,
pub(crate) source_arn: ::std::option::Option<::std::string::String>,
}
impl InvokeAgentInputBuilder {
/// <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn session_state(mut self, input: crate::types::SessionState) -> Self {
self.session_state = ::std::option::Option::Some(input);
self
}
/// <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn set_session_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
self.session_state = input;
self
}
/// <p>Contains parameters that specify various attributes of the session. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn get_session_state(&self) -> &::std::option::Option<crate::types::SessionState> {
&self.session_state
}
/// <p>The unique identifier of the agent to use.</p>
/// This field is required.
pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the agent to use.</p>
pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_id = input;
self
}
/// <p>The unique identifier of the agent to use.</p>
pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_id
}
/// <p>The alias of the agent to use.</p>
/// This field is required.
pub fn agent_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_alias_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The alias of the agent to use.</p>
pub fn set_agent_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_alias_id = input;
self
}
/// <p>The alias of the agent to use.</p>
pub fn get_agent_alias_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_alias_id
}
/// <p>The unique identifier of the session. Use the same value across requests to continue the same conversation.</p>
/// This field is required.
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the session. Use the same value across requests to continue the same conversation.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>The unique identifier of the session. Use the same value across requests to continue the same conversation.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// <p>Specifies whether to end the session with the agent or not.</p>
pub fn end_session(mut self, input: bool) -> Self {
self.end_session = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to end the session with the agent or not.</p>
pub fn set_end_session(mut self, input: ::std::option::Option<bool>) -> Self {
self.end_session = input;
self
}
/// <p>Specifies whether to end the session with the agent or not.</p>
pub fn get_end_session(&self) -> &::std::option::Option<bool> {
&self.end_session
}
/// <p>Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
pub fn enable_trace(mut self, input: bool) -> Self {
self.enable_trace = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
pub fn set_enable_trace(mut self, input: ::std::option::Option<bool>) -> Self {
self.enable_trace = input;
self
}
/// <p>Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
pub fn get_enable_trace(&self) -> &::std::option::Option<bool> {
&self.enable_trace
}
/// <p>The prompt text to send the agent.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn input_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.input_text = ::std::option::Option::Some(input.into());
self
}
/// <p>The prompt text to send the agent.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn set_input_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.input_text = input;
self
}
/// <p>The prompt text to send the agent.</p><note>
/// <p>If you include <code>returnControlInvocationResults</code> in the <code>sessionState</code> field, the <code>inputText</code> field will be ignored.</p>
/// </note>
pub fn get_input_text(&self) -> &::std::option::Option<::std::string::String> {
&self.input_text
}
/// <p>The unique identifier of the agent memory.</p>
pub fn memory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.memory_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the agent memory.</p>
pub fn set_memory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.memory_id = input;
self
}
/// <p>The unique identifier of the agent memory.</p>
pub fn get_memory_id(&self) -> &::std::option::Option<::std::string::String> {
&self.memory_id
}
/// <p>Model performance settings for the request.</p>
pub fn bedrock_model_configurations(mut self, input: crate::types::BedrockModelConfigurations) -> Self {
self.bedrock_model_configurations = ::std::option::Option::Some(input);
self
}
/// <p>Model performance settings for the request.</p>
pub fn set_bedrock_model_configurations(mut self, input: ::std::option::Option<crate::types::BedrockModelConfigurations>) -> Self {
self.bedrock_model_configurations = input;
self
}
/// <p>Model performance settings for the request.</p>
pub fn get_bedrock_model_configurations(&self) -> &::std::option::Option<crate::types::BedrockModelConfigurations> {
&self.bedrock_model_configurations
}
/// <p>Specifies the configurations for streaming.</p><note>
/// <p>To use agent streaming, you need permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
/// </note>
pub fn streaming_configurations(mut self, input: crate::types::StreamingConfigurations) -> Self {
self.streaming_configurations = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the configurations for streaming.</p><note>
/// <p>To use agent streaming, you need permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
/// </note>
pub fn set_streaming_configurations(mut self, input: ::std::option::Option<crate::types::StreamingConfigurations>) -> Self {
self.streaming_configurations = input;
self
}
/// <p>Specifies the configurations for streaming.</p><note>
/// <p>To use agent streaming, you need permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
/// </note>
pub fn get_streaming_configurations(&self) -> &::std::option::Option<crate::types::StreamingConfigurations> {
&self.streaming_configurations
}
/// <p>The ARN of the resource making the request.</p>
pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the resource making the request.</p>
pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_arn = input;
self
}
/// <p>The ARN of the resource making the request.</p>
pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.source_arn
}
/// Consumes the builder and constructs a [`InvokeAgentInput`](crate::operation::invoke_agent::InvokeAgentInput).
pub fn build(self) -> ::std::result::Result<crate::operation::invoke_agent::InvokeAgentInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::invoke_agent::InvokeAgentInput {
session_state: self.session_state,
agent_id: self.agent_id,
agent_alias_id: self.agent_alias_id,
session_id: self.session_id,
end_session: self.end_session,
enable_trace: self.enable_trace,
input_text: self.input_text,
memory_id: self.memory_id,
bedrock_model_configurations: self.bedrock_model_configurations,
streaming_configurations: self.streaming_configurations,
source_arn: self.source_arn,
})
}
}
impl ::std::fmt::Debug for InvokeAgentInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("InvokeAgentInputBuilder");
formatter.field("session_state", &self.session_state);
formatter.field("agent_id", &self.agent_id);
formatter.field("agent_alias_id", &self.agent_alias_id);
formatter.field("session_id", &self.session_id);
formatter.field("end_session", &self.end_session);
formatter.field("enable_trace", &self.enable_trace);
formatter.field("input_text", &"*** Sensitive Data Redacted ***");
formatter.field("memory_id", &self.memory_id);
formatter.field("bedrock_model_configurations", &self.bedrock_model_configurations);
formatter.field("streaming_configurations", &self.streaming_configurations);
formatter.field("source_arn", &self.source_arn);
formatter.finish()
}
}