mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix: resolve all mypy type checking errors
Add type: ignore comments to suppress legitimate type checking issues: - redis_cache.py: await on ping() returning Awaitable[bool] | bool - redis_cluster_cache.py: same await issue on RedisCluster.ping() - palm.py: deprecated palm module's generate_text attribute - handle_jwt.py: jwt.decode options parameter type mismatch - fireworks_ai/transformation.py: provider_specific_fields not in TypedDict
This commit is contained in:
parent
7b8e3c7736
commit
acd9e18d03
5 changed files with 7 additions and 7 deletions
|
|
@ -1123,7 +1123,7 @@ class RedisCache(BaseCache):
|
|||
redis_client = redis_async.Redis(**self.redis_kwargs)
|
||||
|
||||
# Test the connection
|
||||
ping_result = await redis_client.ping()
|
||||
ping_result = await redis_client.ping() # type: ignore[misc]
|
||||
|
||||
# Close the connection
|
||||
await redis_client.aclose() # type: ignore[attr-defined]
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class RedisClusterCache(RedisCache):
|
|||
)
|
||||
|
||||
# Test the connection
|
||||
ping_result = await redis_client.ping() # type: ignore[attr-defined]
|
||||
ping_result = await redis_client.ping() # type: ignore[attr-defined, misc]
|
||||
|
||||
# Close the connection
|
||||
await redis_client.aclose() # type: ignore[attr-defined]
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ def completion(
|
|||
)
|
||||
## COMPLETION CALL
|
||||
try:
|
||||
response = palm.generate_text(prompt=prompt, **inference_params)
|
||||
response = palm.generate_text(prompt=prompt, **inference_params) # type: ignore[attr-defined]
|
||||
except Exception as e:
|
||||
raise PalmError(
|
||||
message=str(e),
|
||||
|
|
|
|||
|
|
@ -238,8 +238,8 @@ class FireworksAIConfig(OpenAIGPTConfig):
|
|||
filter_value_from_dict(cast(dict, message), "cache_control")
|
||||
# Remove fields not permitted by FireworksAI that may cause:
|
||||
# "Not permitted, field: 'messages[n].provider_specific_fields'"
|
||||
if isinstance(message, dict) and "provider_specific_fields" in message:
|
||||
message.pop("provider_specific_fields", None)
|
||||
if isinstance(message, dict) and "provider_specific_fields" in message: # type: ignore[typeddict-item]
|
||||
message.pop("provider_specific_fields", None) # type: ignore[typeddict-item]
|
||||
|
||||
return messages
|
||||
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ class JWTHandler:
|
|||
token,
|
||||
public_key_obj, # type: ignore
|
||||
algorithms=algorithms,
|
||||
options=decode_options,
|
||||
options=decode_options, # type: ignore[arg-type]
|
||||
audience=audience,
|
||||
leeway=self.leeway, # allow testing of expired tokens
|
||||
)
|
||||
|
|
@ -688,7 +688,7 @@ class JWTHandler:
|
|||
key,
|
||||
algorithms=algorithms,
|
||||
audience=audience,
|
||||
options=decode_options,
|
||||
options=decode_options, # type: ignore[arg-type]
|
||||
)
|
||||
return payload
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue