跳至內容

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?

已提問 2 個月前檢視次數 54 次

1 個回答
1
已接受的答案

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

已回答 2 個月前

專家

已審閱 2 個月前

  • My bad. I should have checked the version first! Thanks AI! ;-)

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。