aws_sdk_bedrockagent/operation/create_agent_action_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_agent_action_group::_create_agent_action_group_output::CreateAgentActionGroupOutputBuilder;
3
4pub use crate::operation::create_agent_action_group::_create_agent_action_group_input::CreateAgentActionGroupInputBuilder;
5
6impl crate::operation::create_agent_action_group::builders::CreateAgentActionGroupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_agent_action_group::CreateAgentActionGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_agent_action_group::CreateAgentActionGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_agent_action_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAgentActionGroup`.
24///
25/// <p>Creates an action group for an agent. An action group represents the actions that an agent can carry out for the customer by defining the APIs that an agent can call and the logic for calling them.</p>
26/// <p>To allow your agent to request the user for additional information when trying to complete a task, add an action group with the <code>parentActionGroupSignature</code> field set to <code>AMAZON.UserInput</code>.</p>
27/// <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, add an action group with the <code>parentActionGroupSignature</code> field set to <code>AMAZON.CodeInterpreter</code>.</p>
28/// <p>You must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields blank for this action group. During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html">Observation</a> reprompting the user for more information.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateAgentActionGroupFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_agent_action_group::builders::CreateAgentActionGroupInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_agent_action_group::CreateAgentActionGroupOutput,
38        crate::operation::create_agent_action_group::CreateAgentActionGroupError,
39    > for CreateAgentActionGroupFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_agent_action_group::CreateAgentActionGroupOutput,
47            crate::operation::create_agent_action_group::CreateAgentActionGroupError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateAgentActionGroupFluentBuilder {
54    /// Creates a new `CreateAgentActionGroupFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateAgentActionGroup as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_agent_action_group::builders::CreateAgentActionGroupInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_agent_action_group::CreateAgentActionGroupOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_agent_action_group::CreateAgentActionGroupError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_agent_action_group::CreateAgentActionGroup::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_agent_action_group::CreateAgentActionGroup::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_agent_action_group::CreateAgentActionGroupOutput,
100        crate::operation::create_agent_action_group::CreateAgentActionGroupError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The unique identifier of the agent for which to create the action group.</p>
115    pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.agent_id(input.into());
117        self
118    }
119    /// <p>The unique identifier of the agent for which to create the action group.</p>
120    pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_agent_id(input);
122        self
123    }
124    /// <p>The unique identifier of the agent for which to create the action group.</p>
125    pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_agent_id()
127    }
128    /// <p>The version of the agent for which to create the action group.</p>
129    pub fn agent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.agent_version(input.into());
131        self
132    }
133    /// <p>The version of the agent for which to create the action group.</p>
134    pub fn set_agent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_agent_version(input);
136        self
137    }
138    /// <p>The version of the agent for which to create the action group.</p>
139    pub fn get_agent_version(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_agent_version()
141    }
142    /// <p>The name to give the action group.</p>
143    pub fn action_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.action_group_name(input.into());
145        self
146    }
147    /// <p>The name to give the action group.</p>
148    pub fn set_action_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_action_group_name(input);
150        self
151    }
152    /// <p>The name to give the action group.</p>
153    pub fn get_action_group_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_action_group_name()
155    }
156    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
157    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.client_token(input.into());
159        self
160    }
161    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
162    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_client_token(input);
164        self
165    }
166    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
167    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_client_token()
169    }
170    /// <p>A description of the action group.</p>
171    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.description(input.into());
173        self
174    }
175    /// <p>A description of the action group.</p>
176    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_description(input);
178        self
179    }
180    /// <p>A description of the action group.</p>
181    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_description()
183    }
184    /// <p>Specify a built-in or computer use action for this action group. If you specify a value, you must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields empty for this action group.</p>
185    /// <ul>
186    /// <li>
187    /// <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>.</p></li>
188    /// <li>
189    /// <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>.</p></li>
190    /// <li>
191    /// <p>To allow your agent to use an Anthropic computer use tool, specify one of the following values.</p><important>
192    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. When operating computer use functionality, we recommend taking additional security precautions, such as executing computer actions in virtual environments with restricted data access and limited internet connectivity. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
193    /// </important>
194    /// <ul>
195    /// <li>
196    /// <p><code>ANTHROPIC.Computer</code> - Gives the agent permission to use the mouse and keyboard and take screenshots.</p></li>
197    /// <li>
198    /// <p><code>ANTHROPIC.TextEditor</code> - Gives the agent permission to view, create and edit files.</p></li>
199    /// <li>
200    /// <p><code>ANTHROPIC.Bash</code> - Gives the agent permission to run commands in a bash shell.</p></li>
201    /// </ul></li>
202    /// </ul>
203    pub fn parent_action_group_signature(mut self, input: crate::types::ActionGroupSignature) -> Self {
204        self.inner = self.inner.parent_action_group_signature(input);
205        self
206    }
207    /// <p>Specify a built-in or computer use action for this action group. If you specify a value, you must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields empty for this action group.</p>
208    /// <ul>
209    /// <li>
210    /// <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>.</p></li>
211    /// <li>
212    /// <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>.</p></li>
213    /// <li>
214    /// <p>To allow your agent to use an Anthropic computer use tool, specify one of the following values.</p><important>
215    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. When operating computer use functionality, we recommend taking additional security precautions, such as executing computer actions in virtual environments with restricted data access and limited internet connectivity. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
216    /// </important>
217    /// <ul>
218    /// <li>
219    /// <p><code>ANTHROPIC.Computer</code> - Gives the agent permission to use the mouse and keyboard and take screenshots.</p></li>
220    /// <li>
221    /// <p><code>ANTHROPIC.TextEditor</code> - Gives the agent permission to view, create and edit files.</p></li>
222    /// <li>
223    /// <p><code>ANTHROPIC.Bash</code> - Gives the agent permission to run commands in a bash shell.</p></li>
224    /// </ul></li>
225    /// </ul>
226    pub fn set_parent_action_group_signature(mut self, input: ::std::option::Option<crate::types::ActionGroupSignature>) -> Self {
227        self.inner = self.inner.set_parent_action_group_signature(input);
228        self
229    }
230    /// <p>Specify a built-in or computer use action for this action group. If you specify a value, you must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields empty for this action group.</p>
231    /// <ul>
232    /// <li>
233    /// <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>.</p></li>
234    /// <li>
235    /// <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>.</p></li>
236    /// <li>
237    /// <p>To allow your agent to use an Anthropic computer use tool, specify one of the following values.</p><important>
238    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. When operating computer use functionality, we recommend taking additional security precautions, such as executing computer actions in virtual environments with restricted data access and limited internet connectivity. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
239    /// </important>
240    /// <ul>
241    /// <li>
242    /// <p><code>ANTHROPIC.Computer</code> - Gives the agent permission to use the mouse and keyboard and take screenshots.</p></li>
243    /// <li>
244    /// <p><code>ANTHROPIC.TextEditor</code> - Gives the agent permission to view, create and edit files.</p></li>
245    /// <li>
246    /// <p><code>ANTHROPIC.Bash</code> - Gives the agent permission to run commands in a bash shell.</p></li>
247    /// </ul></li>
248    /// </ul>
249    pub fn get_parent_action_group_signature(&self) -> &::std::option::Option<crate::types::ActionGroupSignature> {
250        self.inner.get_parent_action_group_signature()
251    }
252    ///
253    /// Adds a key-value pair to `parentActionGroupSignatureParams`.
254    ///
255    /// To override the contents of this collection use [`set_parent_action_group_signature_params`](Self::set_parent_action_group_signature_params).
256    ///
257    /// <p>The configuration settings for a computer use action.</p><important>
258    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
259    /// </important>
260    pub fn parent_action_group_signature_params(
261        mut self,
262        k: impl ::std::convert::Into<::std::string::String>,
263        v: impl ::std::convert::Into<::std::string::String>,
264    ) -> Self {
265        self.inner = self.inner.parent_action_group_signature_params(k.into(), v.into());
266        self
267    }
268    /// <p>The configuration settings for a computer use action.</p><important>
269    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
270    /// </important>
271    pub fn set_parent_action_group_signature_params(
272        mut self,
273        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
274    ) -> Self {
275        self.inner = self.inner.set_parent_action_group_signature_params(input);
276        self
277    }
278    /// <p>The configuration settings for a computer use action.</p><important>
279    /// <p>Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.</p>
280    /// </important>
281    pub fn get_parent_action_group_signature_params(
282        &self,
283    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
284        self.inner.get_parent_action_group_signature_params()
285    }
286    /// <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.</p>
287    pub fn action_group_executor(mut self, input: crate::types::ActionGroupExecutor) -> Self {
288        self.inner = self.inner.action_group_executor(input);
289        self
290    }
291    /// <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.</p>
292    pub fn set_action_group_executor(mut self, input: ::std::option::Option<crate::types::ActionGroupExecutor>) -> Self {
293        self.inner = self.inner.set_action_group_executor(input);
294        self
295    }
296    /// <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.</p>
297    pub fn get_action_group_executor(&self) -> &::std::option::Option<crate::types::ActionGroupExecutor> {
298        self.inner.get_action_group_executor()
299    }
300    /// <p>Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html">Action group OpenAPI schemas</a>.</p>
301    pub fn api_schema(mut self, input: crate::types::ApiSchema) -> Self {
302        self.inner = self.inner.api_schema(input);
303        self
304    }
305    /// <p>Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html">Action group OpenAPI schemas</a>.</p>
306    pub fn set_api_schema(mut self, input: ::std::option::Option<crate::types::ApiSchema>) -> Self {
307        self.inner = self.inner.set_api_schema(input);
308        self
309    }
310    /// <p>Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html">Action group OpenAPI schemas</a>.</p>
311    pub fn get_api_schema(&self) -> &::std::option::Option<crate::types::ApiSchema> {
312        self.inner.get_api_schema()
313    }
314    /// <p>Specifies whether the action group is available for the agent to invoke or not when sending an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request.</p>
315    pub fn action_group_state(mut self, input: crate::types::ActionGroupState) -> Self {
316        self.inner = self.inner.action_group_state(input);
317        self
318    }
319    /// <p>Specifies whether the action group is available for the agent to invoke or not when sending an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request.</p>
320    pub fn set_action_group_state(mut self, input: ::std::option::Option<crate::types::ActionGroupState>) -> Self {
321        self.inner = self.inner.set_action_group_state(input);
322        self
323    }
324    /// <p>Specifies whether the action group is available for the agent to invoke or not when sending an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request.</p>
325    pub fn get_action_group_state(&self) -> &::std::option::Option<crate::types::ActionGroupState> {
326        self.inner.get_action_group_state()
327    }
328    /// <p>Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.</p>
329    pub fn function_schema(mut self, input: crate::types::FunctionSchema) -> Self {
330        self.inner = self.inner.function_schema(input);
331        self
332    }
333    /// <p>Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.</p>
334    pub fn set_function_schema(mut self, input: ::std::option::Option<crate::types::FunctionSchema>) -> Self {
335        self.inner = self.inner.set_function_schema(input);
336        self
337    }
338    /// <p>Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.</p>
339    pub fn get_function_schema(&self) -> &::std::option::Option<crate::types::FunctionSchema> {
340        self.inner.get_function_schema()
341    }
342}