AgentsforBedrockRuntime / Client / get_agent_memory

get_agent_memory#

AgentsforBedrockRuntime.Client.get_agent_memory(**kwargs)#

Gets the sessions stored in the memory of the agent.

See also: AWS API Documentation

Request Syntax

response = client.get_agent_memory(
    agentAliasId='string',
    agentId='string',
    maxItems=123,
    memoryId='string',
    memoryType='SESSION_SUMMARY',
    nextToken='string'
)
Parameters:
  • agentAliasId (string) –

    [REQUIRED]

    The unique identifier of an alias of an agent.

  • agentId (string) –

    [REQUIRED]

    The unique identifier of the agent to which the alias belongs.

  • maxItems (integer) – The maximum number of items to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

  • memoryId (string) –

    [REQUIRED]

    The unique identifier of the memory.

  • memoryType (string) –

    [REQUIRED]

    The type of memory.

  • nextToken (string) – If the total number of results is greater than the maxItems value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Return type:

dict

Returns:

Response Syntax

{
    'memoryContents': [
        {
            'sessionSummary': {
                'memoryId': 'string',
                'sessionExpiryTime': datetime(2015, 1, 1),
                'sessionId': 'string',
                'sessionStartTime': datetime(2015, 1, 1),
                'summaryText': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • memoryContents (list) –

      Contains details of the sessions stored in the memory

      • (dict) –

        Contains sessions summaries.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: sessionSummary. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • sessionSummary (dict) –

          Contains summary of a session.

          • memoryId (string) –

            The unique identifier of the memory where the session summary is stored.

          • sessionExpiryTime (datetime) –

            The time when the memory duration for the session is set to end.

          • sessionId (string) –

            The identifier for this session.

          • sessionStartTime (datetime) –

            The start time for this session.

          • summaryText (string) –

            The summarized text for this session.

    • nextToken (string) –

      If the total number of results is greater than the maxItems value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Exceptions

  • AgentsforBedrockRuntime.Client.exceptions.ConflictException

  • AgentsforBedrockRuntime.Client.exceptions.ResourceNotFoundException

  • AgentsforBedrockRuntime.Client.exceptions.ValidationException

  • AgentsforBedrockRuntime.Client.exceptions.InternalServerException

  • AgentsforBedrockRuntime.Client.exceptions.DependencyFailedException

  • AgentsforBedrockRuntime.Client.exceptions.BadGatewayException

  • AgentsforBedrockRuntime.Client.exceptions.ThrottlingException

  • AgentsforBedrockRuntime.Client.exceptions.AccessDeniedException

  • AgentsforBedrockRuntime.Client.exceptions.ServiceQuotaExceededException