aws_sdk_bedrockagentruntime/operation/invoke_agent/
_invoke_agent_input.rs

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