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.104.0 (build e79254c)",
date="2024-11-06T23:25:05.037Z")
@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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContains 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 interfaceContains details about an action group.static interfaceContains details about a knowledge base that is associated with an agent.static interfaceContains details about the OpenAPI schema for the action group.static final classA fluent builder forCfnAgent.static interfaceDefines parameters that the agent needs to invoke from the user to complete the function.static interfaceDefines functions that each define parameters that the agent needs to invoke from the user.static interfaceConfiguration information for a guardrail that you use with the Converse operation.static interfaceBase inference parameters to pass to a model in a call to Converse or ConverseStream .static interfaceContains details about a parameter in a function for an action group.static interfaceContains configurations to override a prompt template in one part of an agent sequence.static interfaceContains configurations to override prompts in different parts of an agent sequence.static interfaceThe identifier information for an Amazon S3 bucket.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAgent(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAgent(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 theDRAFTversion 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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetActionGroups(List<Object> value) The action groups that belong to an agent.voidsetActionGroups(IResolvable value) The action groups that belong to an agent.voidsetAgentName(String value) The name of the agent.voidsetAgentResourceRoleArn(String value) The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.voidsetAutoPrepare(Boolean value) Specifies whether to automatically update theDRAFTversion of the agent after making changes to the agent.voidsetAutoPrepare(IResolvable value) Specifies whether to automatically update theDRAFTversion of the agent after making changes to the agent.voidThe Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.voidsetDescription(String value) The description of the agent.voidsetFoundationModel(String value) The foundation model used for orchestration by the agent.voidDetails about the guardrail associated with the agent.voidDetails about the guardrail associated with the agent.voidsetIdleSessionTtlInSeconds(Number value) The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.voidsetInstruction(String value) Instructions that tell the agent what it should do and how it should interact with users.voidsetKnowledgeBases(List<Object> value) The knowledge bases associated with the agent.voidsetKnowledgeBases(IResolvable value) The knowledge bases associated with the agent.voidContains configurations to override prompt templates in different parts of an agent sequence.voidContains configurations to override prompt templates in different parts of an agent sequence.voidSpecifies whether to delete the resource even if it's in use.voidSpecifies whether to delete the resource even if it's in use.voidMetadata that you can assign to a resource as key-value pairs.voidsetTestAliasTags(Map<String, String> value) Metadata that you can assign to a resource as key-value pairs.voidsetTestAliasTags(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, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
inspectin 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:
renderPropertiesin 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:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin 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 theDRAFTversion of the agent after making changes to the agent. -
setAutoPrepare
Specifies whether to automatically update theDRAFTversion of the agent after making changes to the agent. -
setAutoPrepare
Specifies whether to automatically update theDRAFTversion 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:.
-