From da1a1a59a442f669883cf1fe72cd88cfde0c2fdc Mon Sep 17 00:00:00 2001 From: Luke Halley Date: Thu, 2 Apr 2026 16:44:25 +0800 Subject: [PATCH] feat(aws): handle LLMEnablePromptCachingFrame for runtime toggling Add LLMEnablePromptCachingFrame handler to process_frame for parity with AnthropicLLMService, enabling runtime toggling of prompt caching. --- src/pipecat/services/aws/llm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pipecat/services/aws/llm.py b/src/pipecat/services/aws/llm.py index 83b970874..9393db279 100644 --- a/src/pipecat/services/aws/llm.py +++ b/src/pipecat/services/aws/llm.py @@ -36,6 +36,7 @@ from pipecat.frames.frames import ( FunctionCallInProgressFrame, FunctionCallResultFrame, LLMContextFrame, + LLMEnablePromptCachingFrame, LLMFullResponseEndFrame, LLMFullResponseStartFrame, UserImageRawFrame, @@ -589,6 +590,9 @@ class AWSBedrockLLMService(LLMService): if isinstance(frame, LLMContextFrame): await self._process_context(frame.context) + elif isinstance(frame, LLMEnablePromptCachingFrame): + logger.debug(f"Setting enable prompt caching to: [{frame.enable}]") + self._settings.enable_prompt_caching = frame.enable else: await self.push_frame(frame, direction)