Create Agent
| bedrockagent_create_agent | R Documentation |
Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers¶
Description¶
Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers.
-
Specify the following fields for security purposes.
-
agentResourceRoleArn– The Amazon Resource Name (ARN) of the role with permissions to invoke API operations on an agent. -
(Optional)
customerEncryptionKeyArn– The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent. -
(Optional)
idleSessionTTLinSeconds– Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequentInvokeAgentrequest begins a new session. -
To enable your agent to retain conversational context across multiple sessions, include a
memoryConfigurationobject. For more information, see Configure memory. -
To override the default prompt behavior for agent orchestration and to use advanced prompts, include a
promptOverrideConfigurationobject. For more information, see Advanced prompts. -
If your agent fails to be created, the response returns a list of
failureReasonsalongside a list ofrecommendedActionsfor you to troubleshoot. -
The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
Usage¶
bedrockagent_create_agent(agentName, clientToken, instruction,
foundationModel, description, orchestrationType, customOrchestration,
idleSessionTTLInSeconds, agentResourceRoleArn, customerEncryptionKeyArn,
tags, promptOverrideConfiguration, guardrailConfiguration,
memoryConfiguration, agentCollaboration)
Arguments¶
agentName |
[required] A name for the agent that you create. |
clientToken |
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 Ensuring idempotency. |
instruction |
Instructions that tell the agent what it should do and how it should interact with users. |
foundationModel |
The identifier for the model that you want to be used for orchestration by the agent you create. The
|
description |
A description of the agent. |
orchestrationType |
Specifies the type of orchestration strategy for the agent. This
is set to |
customOrchestration |
Contains details of the custom orchestration configured for the agent. |
idleSessionTTLInSeconds |
The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent. A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout. |
agentResourceRoleArn |
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent. |
customerEncryptionKeyArn |
The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent. |
tags |
Any tags that you want to attach to the agent. |
promptOverrideConfiguration |
Contains configurations to override prompts in different parts of an agent sequence. For more information, see Advanced prompts. |
guardrailConfiguration |
The unique Guardrail configuration assigned to the agent when it is created. |
memoryConfiguration |
Contains the details of the memory configured for the agent. |
agentCollaboration |
The agent's collaboration role. |
Value¶
A list with the following syntax:
list(
agent = list(
agentId = "string",
agentName = "string",
agentArn = "string",
agentVersion = "string",
clientToken = "string",
instruction = "string",
agentStatus = "CREATING"|"PREPARING"|"PREPARED"|"NOT_PREPARED"|"DELETING"|"FAILED"|"VERSIONING"|"UPDATING",
foundationModel = "string",
description = "string",
orchestrationType = "DEFAULT"|"CUSTOM_ORCHESTRATION",
customOrchestration = list(
executor = list(
lambda = "string"
)
),
idleSessionTTLInSeconds = 123,
agentResourceRoleArn = "string",
customerEncryptionKeyArn = "string",
createdAt = as.POSIXct(
"2015-01-01"
),
updatedAt = as.POSIXct(
"2015-01-01"
),
preparedAt = as.POSIXct(
"2015-01-01"
),
failureReasons = list(
"string"
),
recommendedActions = list(
"string"
),
promptOverrideConfiguration = list(
promptConfigurations = list(
list(
promptType = "PRE_PROCESSING"|"ORCHESTRATION"|"POST_PROCESSING"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"MEMORY_SUMMARIZATION",
promptCreationMode = "DEFAULT"|"OVERRIDDEN",
promptState = "ENABLED"|"DISABLED",
basePromptTemplate = "string",
inferenceConfiguration = list(
temperature = 123.0,
topP = 123.0,
topK = 123,
maximumLength = 123,
stopSequences = list(
"string"
)
),
parserMode = "DEFAULT"|"OVERRIDDEN",
foundationModel = "string",
additionalModelRequestFields = list()
)
),
overrideLambda = "string"
),
guardrailConfiguration = list(
guardrailIdentifier = "string",
guardrailVersion = "string"
),
memoryConfiguration = list(
enabledMemoryTypes = list(
"SESSION_SUMMARY"
),
storageDays = 123,
sessionSummaryConfiguration = list(
maxRecentSessions = 123
)
),
agentCollaboration = "SUPERVISOR"|"SUPERVISOR_ROUTER"|"DISABLED"
)
)
Request syntax¶
svc$create_agent(
agentName = "string",
clientToken = "string",
instruction = "string",
foundationModel = "string",
description = "string",
orchestrationType = "DEFAULT"|"CUSTOM_ORCHESTRATION",
customOrchestration = list(
executor = list(
lambda = "string"
)
),
idleSessionTTLInSeconds = 123,
agentResourceRoleArn = "string",
customerEncryptionKeyArn = "string",
tags = list(
"string"
),
promptOverrideConfiguration = list(
promptConfigurations = list(
list(
promptType = "PRE_PROCESSING"|"ORCHESTRATION"|"POST_PROCESSING"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"MEMORY_SUMMARIZATION",
promptCreationMode = "DEFAULT"|"OVERRIDDEN",
promptState = "ENABLED"|"DISABLED",
basePromptTemplate = "string",
inferenceConfiguration = list(
temperature = 123.0,
topP = 123.0,
topK = 123,
maximumLength = 123,
stopSequences = list(
"string"
)
),
parserMode = "DEFAULT"|"OVERRIDDEN",
foundationModel = "string",
additionalModelRequestFields = list()
)
),
overrideLambda = "string"
),
guardrailConfiguration = list(
guardrailIdentifier = "string",
guardrailVersion = "string"
),
memoryConfiguration = list(
enabledMemoryTypes = list(
"SESSION_SUMMARY"
),
storageDays = 123,
sessionSummaryConfiguration = list(
maxRecentSessions = 123
)
),
agentCollaboration = "SUPERVISOR"|"SUPERVISOR_ROUTER"|"DISABLED"
)