From dadada18ce6f9c9be3448f27c54181b99e2815f3 Mon Sep 17 00:00:00 2001 From: Cole Murray Date: Sun, 8 Sep 2024 15:09:14 -0700 Subject: [PATCH] Add Anthropic Models to Cache Prompt (#3775) * Add Anthropic Models to Cache Prompt * Update Cache Prompt Active Check for Partial String Matching --- openhands/llm/llm.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index 7f98d0c413b9..86f1fab2cbf1 100644 --- a/openhands/llm/llm.py +++ b/openhands/llm/llm.py @@ -478,9 +478,8 @@ def is_caching_prompt_active(self) -> bool: Returns: boolean: True if prompt caching is active for the given model. """ - return ( - self.config.caching_prompt is True - and self.config.model in cache_prompting_supported_models + return self.config.caching_prompt is True and any( + model in self.config.model for model in cache_prompting_supported_models ) def _post_completion(self, response) -> None: