Skip to content

/AWS1/CL_BDA=>CREATEAGENT()

About CreateAgent

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 subsequent InvokeAgent request begins a new session.

  • To override the default prompt behavior for agent orchestration and to use advanced prompts, include a promptOverrideConfiguration object. For more information, see Advanced prompts.

  • If you agent fails to be created, the response returns a list of failureReasons alongside a list of recommendedActions for you to troubleshoot.

Method Signature

IMPORTING

Required arguments:

IV_AGENTNAME TYPE /AWS1/BDANAME /AWS1/BDANAME

A name for the agent that you create.

Optional arguments:

IV_CLIENTTOKEN TYPE /AWS1/BDACLIENTTOKEN /AWS1/BDACLIENTTOKEN

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.

IV_INSTRUCTION TYPE /AWS1/BDAINSTRUCTION /AWS1/BDAINSTRUCTION

Instructions that tell the agent what it should do and how it should interact with users.

IV_FOUNDATIONMODEL TYPE /AWS1/BDAMODELIDENTIFIER /AWS1/BDAMODELIDENTIFIER

The foundation model to be used for orchestration by the agent you create.

IV_DESCRIPTION TYPE /AWS1/BDADESCRIPTION /AWS1/BDADESCRIPTION

A description of the agent.

IV_IDLESESSIONTTLINSECONDS TYPE /AWS1/BDASESSIONTTL /AWS1/BDASESSIONTTL

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.

IV_AGENTRESOURCEROLEARN TYPE /AWS1/BDAAGENTROLEARN /AWS1/BDAAGENTROLEARN

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

IV_CUSTOMERENCRYPTIONKEYARN TYPE /AWS1/BDAKMSKEYARN /AWS1/BDAKMSKEYARN

The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.

IT_TAGS TYPE /AWS1/CL_BDATAGSMAP_W=>TT_TAGSMAP TT_TAGSMAP

Any tags that you want to attach to the agent.

IO_PROMPTOVERRIDECONF TYPE REF TO /AWS1/CL_BDAPROMPTOVERRIDECONF /AWS1/CL_BDAPROMPTOVERRIDECONF

Contains configurations to override prompts in different parts of an agent sequence. For more information, see Advanced prompts.

IO_GUARDRAILCONFIGURATION TYPE REF TO /AWS1/CL_BDAGUARDRAILCONF /AWS1/CL_BDAGUARDRAILCONF

The unique Guardrail configuration assigned to the agent when it is created.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_BDACREATEAGENTRSP /AWS1/CL_BDACREATEAGENTRSP