Skip to content

get_memory async

get_memory(
    memory_id: MemoryId,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    view: Optional[MemoryView] = None,
) -> GetMemoryOutput

Retrieve an existing Amazon Bedrock AgentCore Memory resource.

Parameters:

  • memory_id (MemoryId) –

    The unique identifier of the memory to retrieve.

  • view (Optional[MemoryView], default: None ) –

    The level of detail to return for the memory.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def get_memory(
    self,
    memory_id: "capo_bedrock_agentcore_control.types.memory_id.MemoryId",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    view: Optional[
        "capo_bedrock_agentcore_control.types.memory_view.MemoryView"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.get_memory_output.GetMemoryOutput":
    """<p>Retrieve an existing Amazon Bedrock AgentCore Memory resource.</p>

    Args:
        memory_id: <p>The unique identifier of the memory to retrieve.</p>
        view: <p>The level of detail to return for the memory.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.service_exception.ServiceException: <p>An internal error occurred.</p>
        capo_bedrock_agentcore_control.errors.throttled_exception.ThrottledException: <p>API rate limit has been exceeded.</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore_control.types.get_memory_input.GetMemoryInput]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.get_memory_output.GetMemoryOutput"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.get_memory

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.get_memory.async_get_memory(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_bedrock_agentcore_control.types.get_memory_output.GetMemoryOutput",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.get_memory_output

        return (
            capo_bedrock_agentcore_control.types.get_memory_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetMemory", redact_output=_redact_output),
    )
    input_: capo_bedrock_agentcore_control.types.get_memory_input.GetMemoryInput = {
        "memory_id": memory_id
    }
    if view is not None:
        input_["view"] = view

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output