feat(aws): handle LLMEnablePromptCachingFrame for runtime toggling
Add LLMEnablePromptCachingFrame handler to process_frame for parity with AnthropicLLMService, enabling runtime toggling of prompt caching.
This commit is contained in:
committed by
Mark Backman
parent
134790b17c
commit
da1a1a59a4
@@ -36,6 +36,7 @@ from pipecat.frames.frames import (
|
|||||||
FunctionCallInProgressFrame,
|
FunctionCallInProgressFrame,
|
||||||
FunctionCallResultFrame,
|
FunctionCallResultFrame,
|
||||||
LLMContextFrame,
|
LLMContextFrame,
|
||||||
|
LLMEnablePromptCachingFrame,
|
||||||
LLMFullResponseEndFrame,
|
LLMFullResponseEndFrame,
|
||||||
LLMFullResponseStartFrame,
|
LLMFullResponseStartFrame,
|
||||||
UserImageRawFrame,
|
UserImageRawFrame,
|
||||||
@@ -589,6 +590,9 @@ class AWSBedrockLLMService(LLMService):
|
|||||||
|
|
||||||
if isinstance(frame, LLMContextFrame):
|
if isinstance(frame, LLMContextFrame):
|
||||||
await self._process_context(frame.context)
|
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:
|
else:
|
||||||
await self.push_frame(frame, direction)
|
await self.push_frame(frame, direction)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user