From d1994a148dceb07721bc82d22e8936ecedb79a1c Mon Sep 17 00:00:00 2001 From: shin-bot-litellm Date: Wed, 4 Feb 2026 15:44:45 -0800 Subject: [PATCH] Fix mypy type error in fireworks_ai transformation (#20391) Cast message to dict before calling pop() to satisfy mypy's type checker. The message is typed as a Union of TypedDicts which don't have the 'provider_specific_fields' key, but the runtime check already confirms it's a dict with this key. --- litellm/llms/fireworks_ai/chat/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index f6ea9c57f7..7ec32fecc4 100644 --- a/litellm/llms/fireworks_ai/chat/transformation.py +++ b/litellm/llms/fireworks_ai/chat/transformation.py @@ -239,7 +239,7 @@ class FireworksAIConfig(OpenAIGPTConfig): # 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) + cast(dict, message).pop("provider_specific_fields", None) return messages