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(
    nextToken='string',
    maxItems=123,
    agentId='string',
    agentAliasId='string',
    memoryType='SESSION_SUMMARY',
    memoryId='string'
)
Parameters:
  • 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.

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

  • agentId (string) –

    [REQUIRED]

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

  • agentAliasId (string) –

    [REQUIRED]

    The unique identifier of an alias of an agent.

  • memoryType (string) –

    [REQUIRED]

    The type of memory.

  • memoryId (string) –

    [REQUIRED]

    The unique identifier of the memory.

Return type:

dict

Returns:

Response Syntax

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

Response Structure

  • (dict) –

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

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

          • sessionId (string) –

            The identifier for this session.

          • sessionStartTime (datetime) –

            The start time for this session.

          • sessionExpiryTime (datetime) –

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

          • summaryText (string) –

            The summarized text for this session.

Exceptions

  • AgentsforBedrockRuntime.Client.exceptions.ResourceNotFoundException

  • AgentsforBedrockRuntime.Client.exceptions.ConflictException

  • 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