mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
2c0ca4fcd3
commit
48317988a4
1 changed files with 7 additions and 2 deletions
|
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue