CfnAgent

class aws_cdk.aws_bedrock.CfnAgent(scope, id, *, agent_name, action_groups=None, agent_resource_role_arn=None, auto_prepare=None, customer_encryption_key_arn=None, description=None, foundation_model=None, guardrail_configuration=None, idle_session_ttl_in_seconds=None, instruction=None, knowledge_bases=None, prompt_override_configuration=None, skip_resource_in_use_check_on_delete=None, tags=None, test_alias_tags=None)

Bases: CfnResource

Specifies an agent as a resource in a top-level template. Minimally, you must specify the following properties:.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-agent.html

CloudformationResource:

AWS::Bedrock::Agent

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

cfn_agent = bedrock.CfnAgent(self, "MyCfnAgent",
    agent_name="agentName",

    # the properties below are optional
    action_groups=[bedrock.CfnAgent.AgentActionGroupProperty(
        action_group_name="actionGroupName",

        # the properties below are optional
        action_group_executor=bedrock.CfnAgent.ActionGroupExecutorProperty(
            custom_control="customControl",
            lambda_="lambda"
        ),
        action_group_state="actionGroupState",
        api_schema=bedrock.CfnAgent.APISchemaProperty(
            payload="payload",
            s3=bedrock.CfnAgent.S3IdentifierProperty(
                s3_bucket_name="s3BucketName",
                s3_object_key="s3ObjectKey"
            )
        ),
        description="description",
        function_schema=bedrock.CfnAgent.FunctionSchemaProperty(
            functions=[bedrock.CfnAgent.FunctionProperty(
                name="name",

                # the properties below are optional
                description="description",
                parameters={
                    "parameters_key": bedrock.CfnAgent.ParameterDetailProperty(
                        type="type",

                        # the properties below are optional
                        description="description",
                        required=False
                    )
                }
            )]
        ),
        parent_action_group_signature="parentActionGroupSignature",
        skip_resource_in_use_check_on_delete=False
    )],
    agent_resource_role_arn="agentResourceRoleArn",
    auto_prepare=False,
    customer_encryption_key_arn="customerEncryptionKeyArn",
    description="description",
    foundation_model="foundationModel",
    guardrail_configuration=bedrock.CfnAgent.GuardrailConfigurationProperty(
        guardrail_identifier="guardrailIdentifier",
        guardrail_version="guardrailVersion"
    ),
    idle_session_ttl_in_seconds=123,
    instruction="instruction",
    knowledge_bases=[bedrock.CfnAgent.AgentKnowledgeBaseProperty(
        description="description",
        knowledge_base_id="knowledgeBaseId",

        # the properties below are optional
        knowledge_base_state="knowledgeBaseState"
    )],
    prompt_override_configuration=bedrock.CfnAgent.PromptOverrideConfigurationProperty(
        prompt_configurations=[bedrock.CfnAgent.PromptConfigurationProperty(
            base_prompt_template="basePromptTemplate",
            inference_configuration=bedrock.CfnAgent.InferenceConfigurationProperty(
                maximum_length=123,
                stop_sequences=["stopSequences"],
                temperature=123,
                top_k=123,
                top_p=123
            ),
            parser_mode="parserMode",
            prompt_creation_mode="promptCreationMode",
            prompt_state="promptState",
            prompt_type="promptType"
        )],

        # the properties below are optional
        override_lambda="overrideLambda"
    ),
    skip_resource_in_use_check_on_delete=False,
    tags={
        "tags_key": "tags"
    },
    test_alias_tags={
        "test_alias_tags_key": "testAliasTags"
    }
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

  • agent_name (str) – The name of the agent.

  • action_groups (Union[IResolvable, Sequence[Union[IResolvable, AgentActionGroupProperty, Dict[str, Any]]], None]) – The action groups that belong to an agent.

  • agent_resource_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

  • auto_prepare (Union[bool, IResolvable, None]) – Specifies whether to automatically update the DRAFT version of the agent after making changes to the agent. The DRAFT version can be continually iterated upon during internal development. By default, this value is false . Default: - false

  • customer_encryption_key_arn (Optional[str]) – The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.

  • description (Optional[str]) – The description of the agent.

  • foundation_model (Optional[str]) – The foundation model used for orchestration by the agent.

  • guardrail_configuration (Union[IResolvable, GuardrailConfigurationProperty, Dict[str, Any], None]) – Details about the guardrail associated with the agent.

  • idle_session_ttl_in_seconds (Union[int, float, None]) – 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.

  • instruction (Optional[str]) – Instructions that tell the agent what it should do and how it should interact with users.

  • knowledge_bases (Union[IResolvable, Sequence[Union[IResolvable, AgentKnowledgeBaseProperty, Dict[str, Any]]], None]) – The knowledge bases associated with the agent.

  • prompt_override_configuration (Union[IResolvable, PromptOverrideConfigurationProperty, Dict[str, Any], None]) – Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see Advanced prompts .

  • skip_resource_in_use_check_on_delete (Union[bool, IResolvable, None]) – Specifies whether to delete the resource even if it’s in use. By default, this value is false . Default: - false

  • tags (Optional[Mapping[str, str]]) – Metadata that you can assign to a resource as key-value pairs. For more information, see the following resources:. - Tag naming limits and requirements - Tagging best practices

  • test_alias_tags (Union[IResolvable, Mapping[str, str], None]) –

    Metadata that you can assign to a resource as key-value pairs. For more information, see the following resources:. - Tag naming limits and requirements - Tagging best practices

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_dependency(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_depends_on(target)

(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:
  • attribute_name (str) – The name of the attribute.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::Bedrock::Agent'
action_groups

The action groups that belong to an agent.

agent_name

The name of the agent.

agent_resource_role_arn

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

attr_agent_arn

The Amazon Resource Name (ARN) of the agent.

CloudformationAttribute:

AgentArn

attr_agent_id

The unique identifier of the agent.

CloudformationAttribute:

AgentId

attr_agent_status

.

  • 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.

CloudformationAttribute:

AgentStatus

Type:

The status of the agent and whether it is ready for use. The following statuses are possible

attr_agent_version

The version of the agent.

CloudformationAttribute:

AgentVersion

attr_created_at

The time at which the agent was created.

CloudformationAttribute:

CreatedAt

attr_failure_reasons

Contains reasons that the agent-related API that you invoked failed.

CloudformationAttribute:

FailureReasons

attr_prepared_at

The time at which the agent was last prepared.

CloudformationAttribute:

PreparedAt

Contains recommended actions to take for the agent-related API that you invoked to succeed.

CloudformationAttribute:

RecommendedActions

attr_updated_at

The time at which the agent was last updated.

CloudformationAttribute:

UpdatedAt

auto_prepare

Specifies whether to automatically update the DRAFT version of the agent after making changes to the agent.

cdk_tag_manager

Tag Manager which manages the tags for this resource.

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

customer_encryption_key_arn

The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.

description

The description of the agent.

foundation_model

The foundation model used for orchestration by the agent.

guardrail_configuration

Details about the guardrail associated with the agent.

idle_session_ttl_in_seconds

The number of seconds for which Amazon Bedrock keeps information about a user’s conversation with the agent.

instruction

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

knowledge_bases

The knowledge bases associated with the agent.

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The tree node.

prompt_override_configuration

Contains configurations to override prompt templates in different parts of an agent sequence.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

skip_resource_in_use_check_on_delete

Specifies whether to delete the resource even if it’s in use.

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

tags

Metadata that you can assign to a resource as key-value pairs.

For more information, see the following resources:.

test_alias_tags

Metadata that you can assign to a resource as key-value pairs.

For more information, see the following resources:.

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

APISchemaProperty

class CfnAgent.APISchemaProperty(*, payload=None, s3=None)

Bases: object

Contains details about the OpenAPI schema for the action group.

For more information, see Action group OpenAPI schemas . You can either include the schema directly in the payload field or you can upload it to an S3 bucket and specify the S3 bucket location in the s3 field.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-apischema.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

a_pISchema_property = bedrock.CfnAgent.APISchemaProperty(
    payload="payload",
    s3=bedrock.CfnAgent.S3IdentifierProperty(
        s3_bucket_name="s3BucketName",
        s3_object_key="s3ObjectKey"
    )
)

Attributes

payload

The JSON or YAML-formatted payload defining the OpenAPI schema for the action group.

For more information, see Action group OpenAPI schemas .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-apischema.html#cfn-bedrock-agent-apischema-payload

s3

Contains details about the S3 object containing the OpenAPI schema for the action group.

For more information, see Action group OpenAPI schemas .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-apischema.html#cfn-bedrock-agent-apischema-s3

ActionGroupExecutorProperty

class CfnAgent.ActionGroupExecutorProperty(*, custom_control=None, lambda_=None)

Bases: object

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.

Parameters:
  • custom_control (Optional[str]) – To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .

  • lambda – The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-actiongroupexecutor.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

action_group_executor_property = bedrock.CfnAgent.ActionGroupExecutorProperty(
    custom_control="customControl",
    lambda_="lambda"
)

Attributes

custom_control

To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-actiongroupexecutor.html#cfn-bedrock-agent-actiongroupexecutor-customcontrol

lambda_

The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-actiongroupexecutor.html#cfn-bedrock-agent-actiongroupexecutor-lambda

AgentActionGroupProperty

class CfnAgent.AgentActionGroupProperty(*, action_group_name, action_group_executor=None, action_group_state=None, api_schema=None, description=None, function_schema=None, parent_action_group_signature=None, skip_resource_in_use_check_on_delete=None)

Bases: object

Contains details about an action group.

Parameters:
  • action_group_name (str) – The name of the action group.

  • action_group_executor (Union[IResolvable, ActionGroupExecutorProperty, Dict[str, Any], None]) – The Amazon Resource Name (ARN) of 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.

  • action_group_state (Optional[str]) – Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

  • api_schema (Union[IResolvable, APISchemaProperty, Dict[str, Any], None]) –

    Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas .

  • description (Optional[str]) – The description of the action group.

  • function_schema (Union[IResolvable, FunctionSchemaProperty, Dict[str, Any], None]) – Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.

  • parent_action_group_signature (Optional[str]) – If this field is set as AMAZON.UserInput , the agent can request the user for additional information when trying to complete a task. The description , apiSchema , and actionGroupExecutor fields must be blank for this action group. During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn’t have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

  • skip_resource_in_use_check_on_delete (Union[bool, IResolvable, None]) – Specifies whether to delete the resource even if it’s in use. By default, this value is false . Default: - false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

agent_action_group_property = bedrock.CfnAgent.AgentActionGroupProperty(
    action_group_name="actionGroupName",

    # the properties below are optional
    action_group_executor=bedrock.CfnAgent.ActionGroupExecutorProperty(
        custom_control="customControl",
        lambda_="lambda"
    ),
    action_group_state="actionGroupState",
    api_schema=bedrock.CfnAgent.APISchemaProperty(
        payload="payload",
        s3=bedrock.CfnAgent.S3IdentifierProperty(
            s3_bucket_name="s3BucketName",
            s3_object_key="s3ObjectKey"
        )
    ),
    description="description",
    function_schema=bedrock.CfnAgent.FunctionSchemaProperty(
        functions=[bedrock.CfnAgent.FunctionProperty(
            name="name",

            # the properties below are optional
            description="description",
            parameters={
                "parameters_key": bedrock.CfnAgent.ParameterDetailProperty(
                    type="type",

                    # the properties below are optional
                    description="description",
                    required=False
                )
            }
        )]
    ),
    parent_action_group_signature="parentActionGroupSignature",
    skip_resource_in_use_check_on_delete=False
)

Attributes

action_group_executor

The Amazon Resource Name (ARN) of 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-actiongroupexecutor

action_group_name

The name of the action group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-actiongroupname

action_group_state

//docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html>`_ request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-actiongroupstate

Type:

Specifies whether the action group is available for the agent to invoke or not when sending an `InvokeAgent <https

api_schema

Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema.

For more information, see Action group OpenAPI schemas .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-apischema

description

The description of the action group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-description

function_schema

Defines functions that each define parameters that the agent needs to invoke from the user.

Each function represents an action in an action group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-functionschema

parent_action_group_signature

If this field is set as AMAZON.UserInput , the agent can request the user for additional information when trying to complete a task. The description , apiSchema , and actionGroupExecutor fields must be blank for this action group.

During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn’t have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-parentactiongroupsignature

skip_resource_in_use_check_on_delete

Specifies whether to delete the resource even if it’s in use.

By default, this value is false .

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentactiongroup.html#cfn-bedrock-agent-agentactiongroup-skipresourceinusecheckondelete

AgentKnowledgeBaseProperty

class CfnAgent.AgentKnowledgeBaseProperty(*, description, knowledge_base_id, knowledge_base_state=None)

Bases: object

Contains details about a knowledge base that is associated with an agent.

Parameters:
  • description (str) – The description of the association between the agent and the knowledge base.

  • knowledge_base_id (str) – The unique identifier of the association between the agent and the knowledge base.

  • knowledge_base_state (Optional[str]) –

    Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentknowledgebase.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

agent_knowledge_base_property = bedrock.CfnAgent.AgentKnowledgeBaseProperty(
    description="description",
    knowledge_base_id="knowledgeBaseId",

    # the properties below are optional
    knowledge_base_state="knowledgeBaseState"
)

Attributes

description

The description of the association between the agent and the knowledge base.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentknowledgebase.html#cfn-bedrock-agent-agentknowledgebase-description

knowledge_base_id

The unique identifier of the association between the agent and the knowledge base.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentknowledgebase.html#cfn-bedrock-agent-agentknowledgebase-knowledgebaseid

knowledge_base_state

//docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html>`_ request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-agentknowledgebase.html#cfn-bedrock-agent-agentknowledgebase-knowledgebasestate

Type:

Specifies whether to use the knowledge base or not when sending an `InvokeAgent <https

FunctionProperty

class CfnAgent.FunctionProperty(*, name, description=None, parameters=None)

Bases: object

Defines parameters that the agent needs to invoke from the user to complete the function.

Corresponds to an action in an action group.

This data type is used in the following API operations:

Parameters:
  • name (str) – A name for the function.

  • description (Optional[str]) – A description of the function and its purpose.

  • parameters (Union[IResolvable, Mapping[str, Union[IResolvable, ParameterDetailProperty, Dict[str, Any]]], None]) – The parameters that the agent elicits from the user to fulfill the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-function.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

function_property = bedrock.CfnAgent.FunctionProperty(
    name="name",

    # the properties below are optional
    description="description",
    parameters={
        "parameters_key": bedrock.CfnAgent.ParameterDetailProperty(
            type="type",

            # the properties below are optional
            description="description",
            required=False
        )
    }
)

Attributes

description

A description of the function and its purpose.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-function.html#cfn-bedrock-agent-function-description

name

A name for the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-function.html#cfn-bedrock-agent-function-name

parameters

The parameters that the agent elicits from the user to fulfill the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-function.html#cfn-bedrock-agent-function-parameters

FunctionSchemaProperty

class CfnAgent.FunctionSchemaProperty(*, functions)

Bases: object

Defines functions that each define parameters that the agent needs to invoke from the user.

Each function represents an action in an action group.

This data type is used in the following API operations:

Parameters:

functions (Union[IResolvable, Sequence[Union[IResolvable, FunctionProperty, Dict[str, Any]]]]) – A list of functions that each define an action in the action group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-functionschema.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

function_schema_property = bedrock.CfnAgent.FunctionSchemaProperty(
    functions=[bedrock.CfnAgent.FunctionProperty(
        name="name",

        # the properties below are optional
        description="description",
        parameters={
            "parameters_key": bedrock.CfnAgent.ParameterDetailProperty(
                type="type",

                # the properties below are optional
                description="description",
                required=False
            )
        }
    )]
)

Attributes

functions

A list of functions that each define an action in the action group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-functionschema.html#cfn-bedrock-agent-functionschema-functions

GuardrailConfigurationProperty

class CfnAgent.GuardrailConfigurationProperty(*, guardrail_identifier=None, guardrail_version=None)

Bases: object

Configuration information for a guardrail that you use with the Converse action.

Parameters:
  • guardrail_identifier (Optional[str]) – The identifier for the guardrail.

  • guardrail_version (Optional[str]) – The version of the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-guardrailconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

guardrail_configuration_property = bedrock.CfnAgent.GuardrailConfigurationProperty(
    guardrail_identifier="guardrailIdentifier",
    guardrail_version="guardrailVersion"
)

Attributes

guardrail_identifier

The identifier for the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-guardrailconfiguration.html#cfn-bedrock-agent-guardrailconfiguration-guardrailidentifier

guardrail_version

The version of the guardrail.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-guardrailconfiguration.html#cfn-bedrock-agent-guardrailconfiguration-guardrailversion

InferenceConfigurationProperty

class CfnAgent.InferenceConfigurationProperty(*, maximum_length=None, stop_sequences=None, temperature=None, top_k=None, top_p=None)

Bases: object

Base inference parameters to pass to a model in a call to Converse or ConverseStream . For more information, see Inference parameters for foundation models .

If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field in the call to Converse or ConverseStream . For more information, see Model parameters .

Parameters:
  • maximum_length (Union[int, float, None]) – The maximum number of tokens allowed in the generated response.

  • stop_sequences (Optional[Sequence[str]]) – A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

  • temperature (Union[int, float, None]) –

    The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options. The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .

  • top_k (Union[int, float, None]) – While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

  • top_p (Union[int, float, None]) –

    The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for topP , the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence. The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

inference_configuration_property = bedrock.CfnAgent.InferenceConfigurationProperty(
    maximum_length=123,
    stop_sequences=["stopSequences"],
    temperature=123,
    top_k=123,
    top_p=123
)

Attributes

maximum_length

The maximum number of tokens allowed in the generated response.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html#cfn-bedrock-agent-inferenceconfiguration-maximumlength

stop_sequences

A list of stop sequences.

A stop sequence is a sequence of characters that causes the model to stop generating the response.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html#cfn-bedrock-agent-inferenceconfiguration-stopsequences

temperature

The likelihood of the model selecting higher-probability options while generating a response.

A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html#cfn-bedrock-agent-inferenceconfiguration-temperature

top_k

While generating a response, the model determines the probability of the following token at each point of generation.

The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html#cfn-bedrock-agent-inferenceconfiguration-topk

top_p

The percentage of most-likely candidates that the model considers for the next token.

For example, if you choose a value of 0.8 for topP , the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence.

The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-inferenceconfiguration.html#cfn-bedrock-agent-inferenceconfiguration-topp

ParameterDetailProperty

class CfnAgent.ParameterDetailProperty(*, type, description=None, required=None)

Bases: object

Contains details about a parameter in a function for an action group.

This data type is used in the following API operations:

Parameters:
  • type (str) – The data type of the parameter.

  • description (Optional[str]) – A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

  • required (Union[bool, IResolvable, None]) – Whether the parameter is required for the agent to complete the function for action group invocation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-parameterdetail.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

parameter_detail_property = bedrock.CfnAgent.ParameterDetailProperty(
    type="type",

    # the properties below are optional
    description="description",
    required=False
)

Attributes

description

A description of the parameter.

Helps the foundation model determine how to elicit the parameters from the user.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-parameterdetail.html#cfn-bedrock-agent-parameterdetail-description

required

Whether the parameter is required for the agent to complete the function for action group invocation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-parameterdetail.html#cfn-bedrock-agent-parameterdetail-required

type

The data type of the parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-parameterdetail.html#cfn-bedrock-agent-parameterdetail-type

PromptConfigurationProperty

class CfnAgent.PromptConfigurationProperty(*, base_prompt_template=None, inference_configuration=None, parser_mode=None, prompt_creation_mode=None, prompt_state=None, prompt_type=None)

Bases: object

Contains configurations to override a prompt template in one part of an agent sequence.

For more information, see Advanced prompts .

Parameters:
  • base_prompt_template (Optional[str]) – Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables . For more information, see Configure the prompt templates .

  • inference_configuration (Union[IResolvable, InferenceConfigurationProperty, Dict[str, Any], None]) –

    Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType . For more information, see Inference parameters for foundation models .

  • parser_mode (Optional[str]) – Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType . If you set the field as OVERRIDEN , the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

  • prompt_creation_mode (Optional[str]) – Specifies whether to override the default prompt template for this promptType . Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate . If you leave it as DEFAULT , the agent uses a default prompt template.

  • prompt_state (Optional[str]) – Specifies whether to allow the agent to carry out the step specified in the promptType . If you set this value to DISABLED , the agent skips that step. The default state for each promptType is as follows. - PRE_PROCESSINGENABLED - ORCHESTRATIONENABLED - KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED - POST_PROCESSINGDISABLED

  • prompt_type (Optional[str]) – The step in the agent sequence that this prompt configuration applies to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

prompt_configuration_property = bedrock.CfnAgent.PromptConfigurationProperty(
    base_prompt_template="basePromptTemplate",
    inference_configuration=bedrock.CfnAgent.InferenceConfigurationProperty(
        maximum_length=123,
        stop_sequences=["stopSequences"],
        temperature=123,
        top_k=123,
        top_p=123
    ),
    parser_mode="parserMode",
    prompt_creation_mode="promptCreationMode",
    prompt_state="promptState",
    prompt_type="promptType"
)

Attributes

base_prompt_template

Defines the prompt template with which to replace the default prompt template.

You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables . For more information, see Configure the prompt templates .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-baseprompttemplate

inference_configuration

Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType .

For more information, see Inference parameters for foundation models .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-inferenceconfiguration

parser_mode

Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType .

If you set the field as OVERRIDEN , the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-parsermode

prompt_creation_mode

Specifies whether to override the default prompt template for this promptType .

Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate . If you leave it as DEFAULT , the agent uses a default prompt template.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-promptcreationmode

prompt_state

Specifies whether to allow the agent to carry out the step specified in the promptType .

If you set this value to DISABLED , the agent skips that step. The default state for each promptType is as follows.

  • PRE_PROCESSINGENABLED

  • ORCHESTRATIONENABLED

  • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

  • POST_PROCESSINGDISABLED

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-promptstate

prompt_type

The step in the agent sequence that this prompt configuration applies to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptconfiguration.html#cfn-bedrock-agent-promptconfiguration-prompttype

PromptOverrideConfigurationProperty

class CfnAgent.PromptOverrideConfigurationProperty(*, prompt_configurations, override_lambda=None)

Bases: object

Contains configurations to override prompts in different parts of an agent sequence.

For more information, see Advanced prompts .

Parameters:
  • prompt_configurations (Union[IResolvable, Sequence[Union[IResolvable, PromptConfigurationProperty, Dict[str, Any]]]]) –

    Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts .

  • override_lambda (Optional[str]) – The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN . For more information, see Parser Lambda function in Agents for Amazon Bedrock .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptoverrideconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

prompt_override_configuration_property = bedrock.CfnAgent.PromptOverrideConfigurationProperty(
    prompt_configurations=[bedrock.CfnAgent.PromptConfigurationProperty(
        base_prompt_template="basePromptTemplate",
        inference_configuration=bedrock.CfnAgent.InferenceConfigurationProperty(
            maximum_length=123,
            stop_sequences=["stopSequences"],
            temperature=123,
            top_k=123,
            top_p=123
        ),
        parser_mode="parserMode",
        prompt_creation_mode="promptCreationMode",
        prompt_state="promptState",
        prompt_type="promptType"
    )],

    # the properties below are optional
    override_lambda="overrideLambda"
)

Attributes

override_lambda

The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence.

If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN . For more information, see Parser Lambda function in Agents for Amazon Bedrock .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptoverrideconfiguration.html#cfn-bedrock-agent-promptoverrideconfiguration-overridelambda

prompt_configurations

Contains configurations to override a prompt template in one part of an agent sequence.

For more information, see Advanced prompts .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-promptoverrideconfiguration.html#cfn-bedrock-agent-promptoverrideconfiguration-promptconfigurations

S3IdentifierProperty

class CfnAgent.S3IdentifierProperty(*, s3_bucket_name=None, s3_object_key=None)

Bases: object

Contains information about the S3 object containing the resource.

Parameters:
  • s3_bucket_name (Optional[str]) – The name of the S3 bucket.

  • s3_object_key (Optional[str]) – The S3 object key containing the resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-s3identifier.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

s3_identifier_property = bedrock.CfnAgent.S3IdentifierProperty(
    s3_bucket_name="s3BucketName",
    s3_object_key="s3ObjectKey"
)

Attributes

s3_bucket_name

The name of the S3 bucket.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-s3identifier.html#cfn-bedrock-agent-s3identifier-s3bucketname

s3_object_key

The S3 object key containing the resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-agent-s3identifier.html#cfn-bedrock-agent-s3identifier-s3objectkey