Skip to content

boto3 bedrock-runtime "amazon.nova-lite-v1:0",converst API Unknown parameter "cachePoint"

0

based on prompt-caching-guide while using boto3 'bedrock-runtime' converse API, with model "amazon.nova-lite-v1:0", getting ParamValidationError with message "Unknown parameter in messages[0].content[1]: cachePoint" how rectify this error & what is the correct parameter to enable prompt-caching for amazon.nova-lite-v1:0 in converse API call?

asked a year ago517 views

2 Answers
0

Hello.

What version of boto3 are you using?
I was able to reproduce the error in my environment, but the version of boto3 I was using was "1.37.22".
I used the latest version (1.38.19) as of May 2025 and confirmed that the code could be executed without errors.
If you are using an older version of boto3, try updating to a newer version.
The code used for testing is the following:

import boto3
import json

client = boto3.client("bedrock-runtime")

system = [{ "text": "You are a helpful assistant" }]

messages = [
    {
        "role": "user", 
        "content": [
            {
                "text": "Write a short story about dragons"
            },
            {
                "cachePoint": {
                    "type": "default"
                }
            }
        ]
    },
]

inf_params = {"maxTokens": 300, "topP": 0.1, "temperature": 0.3}

additionalModelRequestFields = {
    "inferenceConfig": {
         "topK": 20
    }
}

model_response = client.converse(
        modelId="us.amazon.nova-lite-v1:0", 
    messages=messages, 
    system=system, 
    inferenceConfig=inf_params,
    additionalModelRequestFields=additionalModelRequestFields
)

print("\n[Full Response]")
print(json.dumps(model_response, indent=2))

print("\n[Response Content Text]")
print(model_response["output"]["message"]["content"][0]["text"])
EXPERT

answered a year ago

  • thank you @riku I had updated boto3 to latest 1.38.19 & was able to test a prompt-caching py using the model anthropic.claude-3-7-sonnet-20250219-v1:0 but, while setting up a new venv, got the below warning: aiobotocore 2.22.0 requires botocore<1.37.4,>=1.37.2, but you have botocore 1.38.19 which is incompatible. I tried to upgrade the package aiobotocore, it reset boto3 & botocore to 1.37

  • I checked this in my environment, and I think the latest version of boto3 cannot be used due to version dependencies. https://pypi.org/project/aiobotocore/

    awscli and boto3 depend on a single version, or a narrow range of versions, of botocore. However, aiobotocore only supports a specific range of botocore versions. To ensure you install the latest version of awscli and boto3 that your specific combination or aiobotocore and botocore can support use:

    There is also discussion about the botocore version in the following GitHub issue, so I expect it will probably be addressed soon. https://github.com/aio-libs/aiobotocore/issues/1318

-1

I apologize, but there seems to be a misunderstanding in your question. Based on the available information about the Amazon Bedrock Runtime and the Converse API for Amazon Nova Lite, there is no direct support for a "cachePoint" parameter or prompt caching in the way you've described.

The error you're encountering, "Unknown parameter in messages[0].content[1]: cachePoint", suggests that you're trying to use a parameter that is not recognized by the API for this model.

For the Amazon Nova Lite model (amazon.nova-lite-v1:0) using the Converse API, the standard parameters you can use include:

  1. modelId: Specifies the model to use (in this case, "amazon.nova-lite-v1:0")
  2. messages: An array of message objects representing the conversation
  3. inferenceConfig: Contains parameters like maxTokens, temperature, and topP

The Converse API for Amazon Nova does not have a built-in parameter for prompt caching as described in your question. The prompt caching guide you referenced is likely for a different service or API.

To rectify the error, you should remove the "cachePoint" parameter from your API call. If you need to optimize performance or reduce latency, you might want to look into other AWS services or caching strategies at the application level, rather than trying to use a non-existent parameter in the Converse API call.

Here's an example of a correct Converse API call for Amazon Nova Lite:

response = client.converse(
    modelId="amazon.nova-lite-v1:0",
    messages=[
        {
            "role": "user",
            "content": [{"text": "Your message here"}]
        }
    ],
    inferenceConfig={
        "maxTokens": 512,
        "temperature": 0.5,
        "topP": 0.9
    }
)

This should resolve the ParamValidationError you're encountering. Remember to adjust the inferenceConfig parameters as needed for your specific use case.
Sources
Using the Converse API - Amazon Nova
Amazon Bedrock Runtime examples using SDK for Python (Boto3) - AWS SDK Code Examples
Invoke Amazon Nova on Amazon Bedrock using Bedrock's Converse API - AWS SDK Code Examples
Invoke Amazon Nova on Amazon Bedrock using Bedrock's Converse API - Amazon Bedrock

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.