From 033a6ebcd0158001cd893a309ef34f627468680a Mon Sep 17 00:00:00 2001 From: Vasilisa Parshikova Date: Thu, 5 Mar 2026 20:09:44 +0400 Subject: [PATCH] (sap) fix after bot review --- docs/my-website/docs/providers/sap.md | 6 +++--- litellm/llms/sap/credentials.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/my-website/docs/providers/sap.md b/docs/my-website/docs/providers/sap.md index c796fff8b25..3877cb6ef19 100644 --- a/docs/my-website/docs/providers/sap.md +++ b/docs/my-website/docs/providers/sap.md @@ -70,18 +70,18 @@ pip install litellm -The simplest approach - paste your entire service key as a single environment variable. The service key must be wrapped in a `credentials` object: +The simplest approach - paste your entire service key as a single environment variable. + +> **Note:** the service key no more needs to be wrapped in a "credentials" key. ```bash export AICORE_SERVICE_KEY='{ - "credentials": { "clientid": "your-client-id", "clientsecret": "your-client-secret", "url": "https://.authentication.sap.hana.ondemand.com", "serviceurls": { "AI_API_URL": "https://api.ai..aws.ml.hana.ondemand.com" } - } }' export AICORE_RESOURCE_GROUP="default" ``` diff --git a/litellm/llms/sap/credentials.py b/litellm/llms/sap/credentials.py index 55c50a033f0..fc2a456c2ff 100644 --- a/litellm/llms/sap/credentials.py +++ b/litellm/llms/sap/credentials.py @@ -280,6 +280,7 @@ def get_token_creator( service_key: Optional[Union[str, dict]] = None, profile: Optional[str] = None, *, + timeout: float = 30.0, expiry_buffer_minutes: int = 60, **overrides, ) -> Tuple[Callable[[], str], str, str]: @@ -294,6 +295,7 @@ def get_token_creator( Args: profile: Optional AICore profile name + timeout: Timeout for HTTP requests expiry_buffer_minutes: Refresh the token this many minutes before expiry overrides: Any explicit credential overrides (client_id, client_secret, etc.) @@ -330,10 +332,10 @@ def get_token_creator( if cert_pair: with httpx.Client(cert=cert_pair) as raw_client: handler = HTTPHandler(client=raw_client) - resp = handler.post(auth_url, data=data) # type: ignore[arg-type] + resp = handler.post(auth_url, data=data, timeout=timeout) # type: ignore[arg-type] else: handler = _get_httpx_client() - resp = handler.post(auth_url, data=data) # type: ignore[arg-type] + resp = handler.post(auth_url, data=data, timeout=timeout) # type: ignore[arg-type] payload = resp.json() access_token = payload["access_token"] expires_in = int(payload.get("expires_in", 3600))