From a23f13a645e0636824477862243c11893f11f165 Mon Sep 17 00:00:00 2001 From: Yamac Ay Date: Fri, 25 Sep 2026 10:03:50 +0200 Subject: [PATCH] fix: changes after review --- litellm/llms/sap/chat/models.py | 2 +- litellm/llms/sap/chat/transformation.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/llms/sap/chat/models.py b/litellm/llms/sap/chat/models.py index babe8aa3d0c..a378bf42375 100644 --- a/litellm/llms/sap/chat/models.py +++ b/litellm/llms/sap/chat/models.py @@ -15,7 +15,7 @@ from pydantic import ( class CacheControl(BaseModel): type: Literal["ephemeral"] - ttl: str | None = None + ttl: Literal["5m", "1h"] | None = None @model_serializer(mode="wrap") def _serialize( diff --git a/litellm/llms/sap/chat/transformation.py b/litellm/llms/sap/chat/transformation.py index 25a18bdd2e9..907fb82fa16 100755 --- a/litellm/llms/sap/chat/transformation.py +++ b/litellm/llms/sap/chat/transformation.py @@ -73,18 +73,18 @@ def _fold_message_cache_control( breakpoint for the whole block. In all other cases (empty list, None, unrecognized type) the marker is silently dropped. """ - cc = message.get("cache_control") - if cc is None: + cache_control = message.get("cache_control") + if cache_control is None: return message base = {k: v for k, v in message.items() if k != "cache_control"} content = message.get("content") if isinstance(content, str): - base["content"] = [{"type": "text", "text": content, "cache_control": cc}] + base["content"] = [{"type": "text", "text": content, "cache_control": cache_control}] return base if isinstance(content, list) and content and isinstance(content[-1], dict): base["content"] = [ *content[:-1], - {**content[-1], "cache_control": cc}, + {**content[-1], "cache_control": cache_control}, ] return base return base