Skip to content

Why does the Javascript v3 API not support the Bedrock converse CachePointBlock ttl attribute?

0

I am using the AWS SDK for JavaScript v3. The documentation for the client-bedrock-runtime ConverseCommand states that one of the ContentBlocks provided can be a CachePointBlock, which includes the ttl attribute ("5m" || "1h"). However, when I try to set that attribute, Typescript complains that it does not exist. I checked the definition, and it is indeed not included:

export interface CachePointBlock {
    /**
     * <p>Specifies the type of cache point within the CachePointBlock.</p>
     * @public
     */
    type: CachePointType | undefined;
}

Does anyone know why this is not configurable via the Javascript API?

asked a month ago44 views
1 Answer
1
Accepted Answer

Based on the available information, the CachePointBlock's ttl attribute is an optional field that enables extended TTL caching with specified durations of either "5m" or "1h". When the ttl is omitted, the CachePointBlock uses the type value for caching behavior instead.

However, I don't have specific information about why the JavaScript v3 SDK's TypeScript definitions might not include the ttl attribute in the CachePointBlock interface, even though it's documented in the API reference. This could be due to several possibilities:

  1. The SDK version you're using may not yet include support for the ttl attribute if it was added more recently to the Bedrock API
  2. There may be a lag between API feature releases and SDK updates
  3. The feature might be in a preview or limited availability state

I'd recommend checking if you're using the latest version of the @aws-sdk/client-bedrock-runtime package, as updating to the most recent version may resolve this discrepancy. If the issue persists with the latest SDK version, you may want to file an issue with the AWS SDK for JavaScript repository on GitHub, as this would represent a gap between the documented API capabilities and the SDK's type definitions.
Sources
CachePointBlock - Amazon Bedrock
CacheDetail - Amazon Bedrock

answered a month ago
EXPERT
reviewed a month ago
  • My bad. I should have checked the version first! Thanks AI! ;-)

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.