Class CfnAgent
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.bedrock.CfnAgent
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:39.491Z")
@Stability(Stable)
public class CfnAgent
extends CfnResource
implements IInspectable, ITaggableV2
Specifies an agent as a resource in a top-level template. Minimally, you must specify the following properties:.
- AgentName – Specify a name for the agent.
- AgentResourceRoleArn – Specify the Amazon Resource Name (ARN) of the service role with permissions to invoke API operations on the agent. For more information, see Create a service role for Agents for Amazon Bedrock .
- FoundationModel – Specify the model ID of a foundation model to use when invoking the agent. For more information, see Supported regions and models for Agents for Amazon Bedrock .
For more information about using agents in Amazon Bedrock , see Agents for Amazon Bedrock .
See the Properties section below for descriptions of both the required and optional properties.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.bedrock.*; CfnAgent cfnAgent = CfnAgent.Builder.create(this, "MyCfnAgent") .agentName("agentName") // the properties below are optional .actionGroups(List.of(AgentActionGroupProperty.builder() .actionGroupName("actionGroupName") // the properties below are optional .actionGroupExecutor(ActionGroupExecutorProperty.builder() .customControl("customControl") .lambda("lambda") .build()) .actionGroupState("actionGroupState") .apiSchema(APISchemaProperty.builder() .payload("payload") .s3(S3IdentifierProperty.builder() .s3BucketName("s3BucketName") .s3ObjectKey("s3ObjectKey") .build()) .build()) .description("description") .functionSchema(FunctionSchemaProperty.builder() .functions(List.of(FunctionProperty.builder() .name("name") // the properties below are optional .description("description") .parameters(Map.of( "parametersKey", ParameterDetailProperty.builder() .type("type") // the properties below are optional .description("description") .required(false) .build())) .build())) .build()) .parentActionGroupSignature("parentActionGroupSignature") .skipResourceInUseCheckOnDelete(false) .build())) .agentResourceRoleArn("agentResourceRoleArn") .autoPrepare(false) .customerEncryptionKeyArn("customerEncryptionKeyArn") .description("description") .foundationModel("foundationModel") .guardrailConfiguration(GuardrailConfigurationProperty.builder() .guardrailIdentifier("guardrailIdentifier") .guardrailVersion("guardrailVersion") .build()) .idleSessionTtlInSeconds(123) .instruction("instruction") .knowledgeBases(List.of(AgentKnowledgeBaseProperty.builder() .description("description") .knowledgeBaseId("knowledgeBaseId") // the properties below are optional .knowledgeBaseState("knowledgeBaseState") .build())) .promptOverrideConfiguration(PromptOverrideConfigurationProperty.builder() .promptConfigurations(List.of(PromptConfigurationProperty.builder() .basePromptTemplate("basePromptTemplate") .inferenceConfiguration(InferenceConfigurationProperty.builder() .maximumLength(123) .stopSequences(List.of("stopSequences")) .temperature(123) .topK(123) .topP(123) .build()) .parserMode("parserMode") .promptCreationMode("promptCreationMode") .promptState("promptState") .promptType("promptType") .build())) // the properties below are optional .overrideLambda("overrideLambda") .build()) .skipResourceInUseCheckOnDelete(false) .tags(Map.of( "tagsKey", "tags")) .testAliasTags(Map.of( "testAliasTagsKey", "testAliasTags")) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Contains details about 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.static interface
Contains details about an action group.static interface
Contains details about a knowledge base that is associated with an agent.static interface
Contains details about the OpenAPI schema for the action group.static final class
A fluent builder forCfnAgent
.static interface
Defines parameters that the agent needs to invoke from the user to complete the function.static interface
Defines functions that each define parameters that the agent needs to invoke from the user.static interface
Configuration information for a guardrail that you use with the Converse operation.static interface
Base inference parameters to pass to a model in a call to Converse or ConverseStream .static interface
Contains details about a parameter in a function for an action group.static interface
Contains configurations to override a prompt template in one part of an agent sequence.static interface
Contains configurations to override prompts in different parts of an agent sequence.static interface
The identifier information for an Amazon S3 bucket.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnAgent
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnAgent
(software.amazon.jsii.JsiiObjectRef objRef) CfnAgent
(software.constructs.Construct scope, String id, CfnAgentProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe action groups that belong to an agent.The name of the agent.The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.The Amazon Resource Name (ARN) of the agent.The unique identifier of the agent.The status of the agent and whether it is ready for use.The version of the agent.The time at which the agent was created.Contains reasons that the agent-related API that you invoked failed.The time at which the agent was last prepared.Contains recommended actions to take for the agent-related API that you invoked to succeed.The time at which the agent was last updated.Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent.Tag Manager which manages the tags for this resource.The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.The description of the agent.The foundation model used for orchestration by the agent.Details about the guardrail associated with the agent.The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.Instructions that tell the agent what it should do and how it should interact with users.The knowledge bases associated with the agent.Contains configurations to override prompt templates in different parts of an agent sequence.Specifies whether to delete the resource even if it's in use.getTags()
Metadata that you can assign to a resource as key-value pairs.Metadata that you can assign to a resource as key-value pairs.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setActionGroups
(List<Object> value) The action groups that belong to an agent.void
setActionGroups
(IResolvable value) The action groups that belong to an agent.void
setAgentName
(String value) The name of the agent.void
setAgentResourceRoleArn
(String value) The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.void
setAutoPrepare
(Boolean value) Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent.void
setAutoPrepare
(IResolvable value) Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent.void
The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.void
setDescription
(String value) The description of the agent.void
setFoundationModel
(String value) The foundation model used for orchestration by the agent.void
Details about the guardrail associated with the agent.void
Details about the guardrail associated with the agent.void
setIdleSessionTtlInSeconds
(Number value) The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.void
setInstruction
(String value) Instructions that tell the agent what it should do and how it should interact with users.void
setKnowledgeBases
(List<Object> value) The knowledge bases associated with the agent.void
setKnowledgeBases
(IResolvable value) The knowledge bases associated with the agent.void
Contains configurations to override prompt templates in different parts of an agent sequence.void
Contains configurations to override prompt templates in different parts of an agent sequence.void
Specifies whether to delete the resource even if it's in use.void
Specifies whether to delete the resource even if it's in use.void
Metadata that you can assign to a resource as key-value pairs.void
setTestAliasTags
(Map<String, String> value) Metadata that you can assign to a resource as key-value pairs.void
setTestAliasTags
(IResolvable value) Metadata that you can assign to a resource as key-value pairs.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAgent
protected CfnAgent(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAgent
protected CfnAgent(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAgent
@Stability(Stable) public CfnAgent(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAgentProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrAgentArn
The Amazon Resource Name (ARN) of the agent. -
getAttrAgentId
The unique identifier of the agent. -
getAttrAgentStatus
The status of the agent and whether it is ready for use. The following statuses are possible:.- CREATING – The agent is being created.
- PREPARING – The agent is being prepared.
- PREPARED – The agent is prepared and ready to be invoked.
- NOT_PREPARED – The agent has been created but not yet prepared.
- FAILED – The agent API operation failed.
- UPDATING – The agent is being updated.
- DELETING – The agent is being deleted.
-
getAttrAgentVersion
The version of the agent. -
getAttrCreatedAt
The time at which the agent was created. -
getAttrFailureReasons
Contains reasons that the agent-related API that you invoked failed. -
getAttrPreparedAt
The time at which the agent was last prepared. -
getAttrRecommendedActions
Contains recommended actions to take for the agent-related API that you invoked to succeed. -
getAttrUpdatedAt
The time at which the agent was last updated. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getAgentName
The name of the agent. -
setAgentName
The name of the agent. -
getActionGroups
The action groups that belong to an agent. -
setActionGroups
The action groups that belong to an agent. -
setActionGroups
The action groups that belong to an agent. -
getAgentResourceRoleArn
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent. -
setAgentResourceRoleArn
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent. -
getAutoPrepare
Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent. -
setAutoPrepare
Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent. -
setAutoPrepare
Specifies whether to automatically update theDRAFT
version of the agent after making changes to the agent. -
getCustomerEncryptionKeyArn
The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent. -
setCustomerEncryptionKeyArn
The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent. -
getDescription
The description of the agent. -
setDescription
The description of the agent. -
getFoundationModel
The foundation model used for orchestration by the agent. -
setFoundationModel
The foundation model used for orchestration by the agent. -
getGuardrailConfiguration
Details about the guardrail associated with the agent. -
setGuardrailConfiguration
Details about the guardrail associated with the agent. -
setGuardrailConfiguration
@Stability(Stable) public void setGuardrailConfiguration(@Nullable CfnAgent.GuardrailConfigurationProperty value) Details about the guardrail associated with the agent. -
getIdleSessionTtlInSeconds
The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent. -
setIdleSessionTtlInSeconds
The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent. -
getInstruction
Instructions that tell the agent what it should do and how it should interact with users. -
setInstruction
Instructions that tell the agent what it should do and how it should interact with users. -
getKnowledgeBases
The knowledge bases associated with the agent. -
setKnowledgeBases
The knowledge bases associated with the agent. -
setKnowledgeBases
The knowledge bases associated with the agent. -
getPromptOverrideConfiguration
Contains configurations to override prompt templates in different parts of an agent sequence. -
setPromptOverrideConfiguration
Contains configurations to override prompt templates in different parts of an agent sequence. -
setPromptOverrideConfiguration
@Stability(Stable) public void setPromptOverrideConfiguration(@Nullable CfnAgent.PromptOverrideConfigurationProperty value) Contains configurations to override prompt templates in different parts of an agent sequence. -
getSkipResourceInUseCheckOnDelete
Specifies whether to delete the resource even if it's in use. -
setSkipResourceInUseCheckOnDelete
Specifies whether to delete the resource even if it's in use. -
setSkipResourceInUseCheckOnDelete
Specifies whether to delete the resource even if it's in use. -
getTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
setTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
getTestAliasTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
setTestAliasTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
setTestAliasTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-