fix: 🚑 Fix bedrock conversation prompt caching

This commit is contained in:
chezsmithy 2025-09-09 08:49:40 -07:00
parent b3f4b82600
commit 7725a6f018

View file

@ -513,7 +513,7 @@ class Bedrock extends BaseLLM {
// The second-to-last because it retrieves potentially already cached contents,
// The last one because we want it cached for later retrieval.
// See: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
if (this.cacheBehavior?.cacheConversation) {
if (this.cacheBehavior?.cacheConversation || this.completionOptions.promptCaching) {
this._addCachingToLastTwoUserMessages(converted);
}