AgentsforBedrock / Client / get_agent

get_agent#

AgentsforBedrock.Client.get_agent(**kwargs)#

Gets an Agent for existing Amazon Bedrock Agent

See also: AWS API Documentation

Request Syntax

response = client.get_agent(
    agentId='string'
)
Parameters:

agentId (string) –

[REQUIRED]

Id generated at the server side when an Agent is created

Return type:

dict

Returns:

Response Syntax

{
    'agent': {
        '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',
        'idleSessionTTLInSeconds': 123,
        'agentResourceRoleArn': 'string',
        'customerEncryptionKeyArn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'updatedAt': datetime(2015, 1, 1),
        'preparedAt': datetime(2015, 1, 1),
        'failureReasons': [
            'string',
        ],
        'recommendedActions': [
            'string',
        ],
        'promptOverrideConfiguration': {
            'promptConfigurations': [
                {
                    'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION',
                    'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptState': 'ENABLED'|'DISABLED',
                    'basePromptTemplate': 'string',
                    'inferenceConfiguration': {
                        'temperature': ...,
                        'topP': ...,
                        'topK': 123,
                        'maximumLength': 123,
                        'stopSequences': [
                            'string',
                        ]
                    },
                    'parserMode': 'DEFAULT'|'OVERRIDDEN'
                },
            ],
            'overrideLambda': 'string'
        }
    }
}

Response Structure

  • (dict) –

    Get Agent Response

    • agent (dict) –

      Contains the information of an agent

      • agentId (string) –

        Identifier for a resource.

      • agentName (string) –

        Name for a resource.

      • agentArn (string) –

        Arn representation of the Agent.

      • agentVersion (string) –

        Draft Agent Version.

      • clientToken (string) –

        Client specified token used for idempotency checks

      • instruction (string) –

        Instruction for the agent.

      • agentStatus (string) –

        Schema Type for Action APIs.

      • foundationModel (string) –

        ARN or name of a Bedrock model.

      • description (string) –

        Description of the Resource.

      • idleSessionTTLInSeconds (integer) –

        Max Session Time.

      • agentResourceRoleArn (string) –

        ARN of a IAM role.

      • customerEncryptionKeyArn (string) –

        A KMS key ARN

      • createdAt (datetime) –

        Time Stamp.

      • updatedAt (datetime) –

        Time Stamp.

      • preparedAt (datetime) –

        Time Stamp.

      • failureReasons (list) –

        Failure Reasons for Error.

        • (string) –

          Failure Reason for Error.

      • recommendedActions (list) –

        The recommended actions users can take to resolve an error in failureReasons.

        • (string) –

          The recommended action users can take to resolve an error in failureReasons.

      • promptOverrideConfiguration (dict) –

        Configuration for prompt override.

        • promptConfigurations (list) –

          List of BasePromptConfiguration

          • (dict) –

            BasePromptConfiguration per Prompt Type.

            • promptType (string) –

              Prompt Type.

            • promptCreationMode (string) –

              Creation Mode for Prompt Configuration.

            • promptState (string) –

              Prompt State.

            • basePromptTemplate (string) –

              Base Prompt Template.

            • inferenceConfiguration (dict) –

              Configuration for inference in prompt configuration

              • temperature (float) –

                Controls randomness, higher values increase diversity

              • topP (float) –

                Cumulative probability cutoff for token selection

              • topK (integer) –

                Sample from the k most likely next tokens

              • maximumLength (integer) –

                Maximum length of output

              • stopSequences (list) –

                List of stop sequences

                • (string) –

            • parserMode (string) –

              Creation Mode for Prompt Configuration.

        • overrideLambda (string) –

          ARN of a Lambda.

Exceptions

  • AgentsforBedrock.Client.exceptions.ThrottlingException

  • AgentsforBedrock.Client.exceptions.AccessDeniedException

  • AgentsforBedrock.Client.exceptions.ValidationException

  • AgentsforBedrock.Client.exceptions.InternalServerException

  • AgentsforBedrock.Client.exceptions.ResourceNotFoundException