feat(bedrock): Add token caching for any amazon-bedrock provider (#18959)

This commit is contained in:
Nicholas Hansen
2026-03-24 18:42:20 +00:00
committed by GitHub
parent bc608fb081
commit 024979f3fd
2 changed files with 41 additions and 1 deletions

View File

@@ -194,7 +194,10 @@ export namespace ProviderTransform {
}
for (const msg of unique([...system, ...final])) {
const useMessageLevelOptions = model.providerID === "anthropic" || model.providerID.includes("bedrock")
const useMessageLevelOptions =
model.providerID === "anthropic" ||
model.providerID.includes("bedrock") ||
model.api.npm === "@ai-sdk/amazon-bedrock"
const shouldUseContentOptions = !useMessageLevelOptions && Array.isArray(msg.content) && msg.content.length > 0
if (shouldUseContentOptions) {