From 48317988a427546d26b03f97694aaea1e4bbc004 Mon Sep 17 00:00:00 2001 From: Ilya Bogin Date: Thu, 22 Oct 2026 09:03:42 +0300 Subject: [PATCH] fix(keenable): keep the basedpyright gate at its merge-base count - Type the Authorization header entry as Mapping[str, str], so validate_environment returns dict[str, str] (reportReturnType). - Give the read of Logging's untyped optional_params dict a reasoned pyright ignore, as other providers do (reportUnknownMemberType). Co-Authored-By: Claude Opus 5.5 --- litellm/llms/keenable/search/transformation.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/llms/keenable/search/transformation.py b/litellm/llms/keenable/search/transformation.py index 8b1e1e34709..2a27c9e2c12 100644 --- a/litellm/llms/keenable/search/transformation.py +++ b/litellm/llms/keenable/search/transformation.py @@ -114,11 +114,16 @@ class KeenableSearchConfig(BaseSearchConfig): a second time after ``litellm/search/main.py`` already did, so it has to be idempotent. """ resolved_api_key: Final = self._resolve_api_key(api_key, api_base) + auth: Final[Mapping[str, str]] = ( + MappingProxyType({"Authorization": f"Bearer {resolved_api_key}"}) + if resolved_api_key + else MappingProxyType({}) + ) return { **headers, "Content-Type": "application/json", "X-Keenable-Title": _APP_TITLE, - **_optional("Authorization", f"Bearer {resolved_api_key}" if resolved_api_key else None), + **auth, } def get_complete_url( @@ -212,7 +217,7 @@ class KeenableSearchConfig(BaseSearchConfig): ) logging_obj.optional_params = { # rebind-ok: hands the keyless flag to the search cost calculator - **logging_obj.optional_params, + **logging_obj.optional_params, # pyright: ignore[reportUnknownMemberType] # Logging.optional_params is a legacy untyped dict KEENABLE_KEYLESS_PARAM: _answered_keyless(raw_response), }