I am getting resource not found when trying to invoke AWS Bedrock agent through python

211 Views Asked by At

Below is the error I am getting

An error occurred (resourceNotFoundException) when calling the InvokeAgent operation: Failed to retrieve resource because it doesn't exist. Retry the request with a different resource identifier.

Below is how I am calling it.

        response = bedrock_runtime_client.invoke_agent(
            agentId="NNVBJK5YNE",
            agentAliasId="TestAlias",
            sessionId=session_id,
            inputText=prompt,
        )
1

There are 1 best solutions below

0
On

I tested using TSTALIASID in the request to invoke the DRAFT version and got answer from the agent without errors.

agentAliasId="TSTALIASID"

Reference documentation on agents test