Class AgentProps.Builder
java.lang.Object
software.amazon.awscdk.services.bedrock.alpha.AgentProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AgentProps>
- Enclosing interface:
AgentProps
@Stability(Experimental)
public static final class AgentProps.Builder
extends Object
implements software.amazon.jsii.Builder<AgentProps>
A builder for
AgentProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactionGroups(List<? extends AgentActionGroup> actionGroups) Sets the value ofAgentProps.getActionGroups()agentCollaboration(AgentCollaboration agentCollaboration) Sets the value ofAgentProps.getAgentCollaboration()Sets the value ofAgentProps.getAgentName()build()Builds the configured instance.codeInterpreterEnabled(Boolean codeInterpreterEnabled) Sets the value ofAgentProps.getCodeInterpreterEnabled()customOrchestrationExecutor(CustomOrchestrationExecutor customOrchestrationExecutor) Sets the value ofAgentProps.getCustomOrchestrationExecutor()description(String description) Sets the value ofAgentProps.getDescription()existingRole(IRole existingRole) Sets the value ofAgentProps.getExistingRole()forceDelete(Boolean forceDelete) Sets the value ofAgentProps.getForceDelete()foundationModel(IBedrockInvokable foundationModel) Sets the value ofAgentProps.getFoundationModel()guardrail(IGuardrail guardrail) Sets the value ofAgentProps.getGuardrail()idleSessionTtl(Duration idleSessionTtl) Sets the value ofinvalid reference
AgentProps#getIdleSessionTtlinstruction(String instruction) Sets the value ofAgentProps.getInstruction()Sets the value ofAgentProps.getKmsKey()Sets the value ofAgentProps.getMemory()promptOverrideConfiguration(PromptOverrideConfiguration promptOverrideConfiguration) Sets the value ofAgentProps.getPromptOverrideConfiguration()shouldPrepareAgent(Boolean shouldPrepareAgent) Sets the value ofAgentProps.getShouldPrepareAgent()userInputEnabled(Boolean userInputEnabled) Sets the value ofAgentProps.getUserInputEnabled()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
foundationModel
@Stability(Experimental) public AgentProps.Builder foundationModel(IBedrockInvokable foundationModel) Sets the value ofAgentProps.getFoundationModel()- Parameters:
foundationModel- The foundation model used for orchestration by the agent. This parameter is required.- Returns:
this
-
instruction
Sets the value ofAgentProps.getInstruction()- Parameters:
instruction- The instruction used by the agent. This parameter is required. This determines how the agent will perform his task. This instruction must have a minimum of 40 characters.- Returns:
this
-
actionGroups
@Stability(Experimental) public AgentProps.Builder actionGroups(List<? extends AgentActionGroup> actionGroups) Sets the value ofAgentProps.getActionGroups()- Parameters:
actionGroups- The Action Groups associated with the agent.- Returns:
this
-
agentCollaboration
@Stability(Experimental) public AgentProps.Builder agentCollaboration(AgentCollaboration agentCollaboration) Sets the value ofAgentProps.getAgentCollaboration()- Parameters:
agentCollaboration- Configuration for agent collaboration settings, including AgentCollaboratorType and AgentCollaborators. This property allows you to define how the agent collaborates with other agents and what collaborators it can work with.- Returns:
this
-
agentName
Sets the value ofAgentProps.getAgentName()- Parameters:
agentName- The name of the agent. This will be used as the physical name of the agent.- Returns:
this
-
codeInterpreterEnabled
@Stability(Experimental) public AgentProps.Builder codeInterpreterEnabled(Boolean codeInterpreterEnabled) Sets the value ofAgentProps.getCodeInterpreterEnabled()- Parameters:
codeInterpreterEnabled- Select whether the agent can generate, run, and troubleshoot code when trying to complete a task.- Returns:
this
-
customOrchestrationExecutor
@Stability(Experimental) public AgentProps.Builder customOrchestrationExecutor(CustomOrchestrationExecutor customOrchestrationExecutor) Sets the value ofAgentProps.getCustomOrchestrationExecutor()- Parameters:
customOrchestrationExecutor- The Lambda function to use for custom orchestration. If provided, custom orchestration will be used. If not provided, default orchestration will be used.- Returns:
this
-
description
Sets the value ofAgentProps.getDescription()- Parameters:
description- A description of the agent.- Returns:
this
-
existingRole
Sets the value ofAgentProps.getExistingRole()- Parameters:
existingRole- An existing IAM Role to associate with this agent. Use this property when you want to reuse an existing IAM role rather than create a new one. The role must have a trust policy that allows the Bedrock service to assume it.- Returns:
this
-
forceDelete
Sets the value ofAgentProps.getForceDelete()- Parameters:
forceDelete- Whether to delete the resource even if it's in use.- Returns:
this
-
guardrail
Sets the value ofAgentProps.getGuardrail()- Parameters:
guardrail- The guardrail that will be associated with the agent.- Returns:
this
-
idleSessionTtl
Sets the value ofinvalid reference
AgentProps#getIdleSessionTtl- Parameters:
idleSessionTtl- How long sessions should be kept open for the agent. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.- Returns:
this
-
kmsKey
Sets the value ofAgentProps.getKmsKey()- Parameters:
kmsKey- The KMS key of the agent if custom encryption is configured.- Returns:
this
-
memory
Sets the value ofAgentProps.getMemory()- Parameters:
memory- The type and configuration of the memory to maintain context across multiple sessions and recall past interactions. This can be useful for maintaining continuity in multi-turn conversations and recalling user preferences or past interactions.- Returns:
this
-
promptOverrideConfiguration
@Stability(Experimental) public AgentProps.Builder promptOverrideConfiguration(PromptOverrideConfiguration promptOverrideConfiguration) Sets the value ofAgentProps.getPromptOverrideConfiguration()- Parameters:
promptOverrideConfiguration- Overrides some prompt templates in different parts of an agent sequence configuration.- Returns:
this
-
shouldPrepareAgent
Sets the value ofAgentProps.getShouldPrepareAgent()- Parameters:
shouldPrepareAgent- Specifies whether to automatically update theDRAFTversion of the agent after making changes to the agent. TheDRAFTversion can be continually iterated upon during internal development.- Returns:
this
-
userInputEnabled
Sets the value ofAgentProps.getUserInputEnabled()- Parameters:
userInputEnabled- Select whether the agent can prompt additional information from the user when it does not have enough information to respond to an utterance.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<AgentProps>- Returns:
- a new instance of
AgentProps - Throws:
NullPointerException- if any required attribute was not provided
-